Cleanup gtksheet and add features to var-sheet.[ch]
[pspp-builds.git] / src / ui / gui / var-sheet.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2004, 2005, 2006  Free Software Foundation
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
18 #ifndef VAR_SHEET_H
19 #define VAR_SHEET_H
20
21 #include <gtksheet/gtksheet.h>
22
23 #include "psppire-dict.h"
24 #include "psppire-var-store.h"
25
26 #define PSPPIRE_TYPE_VAR_SHEET                  (psppire_var_sheet_get_type ())
27 #define PSPPIRE_VAR_SHEET(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_TYPE_VAR_SHEET, PsppireVarSheet))
28 #define PSPPIRE_VAR_SHEET_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_TYPE_VAR_SHEET, PsppireVarSheetClass))
29 #define PSPPIRE_IS_VAR_SHEET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_VAR_SHEET))
30 #define PSPPIRE_IS_VAR_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_VAR_SHEET))
31 #define PSPPIRE_VAR_SHEET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PSPPIRE_TYPE_VAR_SHEET, PsppireVarSheetClass))
32
33 typedef struct _PsppireVarSheet PsppireVarSheet;
34 typedef struct _PsppireVarSheetClass PsppireVarSheetClass;
35
36 enum {COL_NAME,
37       COL_TYPE,
38       COL_WIDTH,
39       COL_DECIMALS,
40       COL_LABEL,
41       COL_VALUES,
42       COL_MISSING,
43       COL_COLUMNS,
44       COL_ALIGN,
45       COL_MEASURE,
46       n_COLS};
47
48 struct _PsppireVarSheet {
49   GtkSheet parent;
50   gboolean may_create_vars;
51 };
52
53 struct _PsppireVarSheetClass {
54   GtkSheetClass parent;
55 };
56
57 GType psppire_var_sheet_get_type (void);
58
59 /* Create the var sheet */
60 GtkWidget* psppire_var_sheet_new_with_var_store (PsppireVarStore *);
61
62 /* Glade interface for creating a var sheet. */
63 GtkWidget* psppire_variable_sheet_create (gchar *widget_name,
64                                           gchar *string1,
65                                           gchar *string2,
66                                           gint int1, gint int2);
67
68 void psppire_var_sheet_range_set_editable (PsppireVarSheet *sheet,
69                                            const GtkSheetRange *urange,
70                                            gboolean editable);
71
72 void psppire_var_sheet_set_may_create_vars (PsppireVarSheet *sheet,
73                                             gboolean may_create_vars);
74
75
76 #define n_ALIGNMENTS 3
77
78 extern const gchar *const alignments[n_ALIGNMENTS + 1];
79
80 #define n_MEASURES 3
81
82 extern const gchar *const measures[n_MEASURES + 1];
83
84
85 #endif