New module psppire-var-view
[pspp-builds.git] / src / ui / gui / dialog-common.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2007 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 /* Some common routines used in the implementation of dialog boxes */
18
19
20 #ifndef DIALOG_COMMON_H
21 #define DIALOG_COMMON_H
22
23 #include <gtk/gtk.h>
24 #include "psppire-dict.h"
25
26 /* A (*GtkTreeCellDataFunc) function.
27    This function expects TREEMODEL to hold G_TYPE_INT.  The ints it holds
28    are the indices of the variables in the dictionary, which DATA points to.
29    It renders the name of the variable into CELL.
30 */
31 void XXX_cell_var_name (GtkTreeViewColumn *tree_column,
32                     GtkCellRenderer *cell,
33                     GtkTreeModel *tree_model,
34                     GtkTreeIter *iter,
35                     gpointer data);
36
37
38 /* Returns FALSE if the variables represented by the union of the rows
39    currently selected by SOURCE widget, and contents of the DEST
40    widget, are of different types.
41
42    In other words, this function when passed as the argument to
43    psppire_selector_set_allow, ensures that the selector selects only
44    string  variables, or only numeric variables, not a mixture.
45 */
46 gboolean homogeneous_types (GtkWidget *source, GtkWidget *dest);
47
48 /* Returns TRUE if all of the variable(s) represented by the rows
49    currently selected by SOURCE widget, are numeric. DEST is ignored.
50
51    In other words, this function when passed as the argument to
52    psppire_selector_set_allow, ensures that the selector selects only
53    numeric variables.
54 */
55 gboolean numeric_only (GtkWidget *source, GtkWidget *dest);
56
57
58 #endif