Merge commit 'origin/stable'
[pspp-builds.git] / src / ui / gui / psppire-data-editor.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2008 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 #ifndef __PSPPIRE_DATA_EDITOR_H__
18 #define __PSPPIRE_DATA_EDITOR_H__
19
20
21 #include <glib.h>
22 #include <glib-object.h>
23 #include <gtk/gtknotebook.h>
24
25 #include <ui/gui/sheet/psppire-axis.h>
26 #include "psppire-var-store.h"
27 #include "psppire-data-store.h"
28
29 G_BEGIN_DECLS
30
31 #define PSPPIRE_DATA_EDITOR_TYPE            (psppire_data_editor_get_type ())
32 #define PSPPIRE_DATA_EDITOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditor))
33 #define PSPPIRE_DATA_EDITOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditorClass))
34 #define PSPPIRE_IS_DATA_EDITOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_DATA_EDITOR_TYPE))
35 #define PSPPIRE_IS_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_DATA_EDITOR_TYPE))
36
37
38 typedef struct _PsppireDataEditor       PsppireDataEditor;
39 typedef struct _PsppireDataEditorClass  PsppireDataEditorClass;
40
41 /* All members are private. */
42 struct _PsppireDataEditor
43 {
44   GtkNotebook parent;
45
46   /* <private> */
47   gboolean dispose_has_run;
48   GtkWidget *cell_ref_entry;
49   GtkWidget *datum_entry;
50   GtkWidget *var_sheet;
51   PsppireDataStore *data_store;
52   PsppireVarStore *var_store;
53
54   GtkWidget *sheet_bin[4];
55   GtkWidget *data_sheet[4];
56
57   GtkWidget *data_vbox;
58
59   GtkWidget *paned;
60   gboolean split;
61
62   PsppireAxis *vaxis[2];
63
64   /* There's only one horizontal axis, since the
65      column widths are parameters of the variables */
66   PsppireAxis *haxis;
67 };
68
69
70 struct _PsppireDataEditorClass
71 {
72   GtkNotebookClass parent_class;
73 };
74
75
76 GType          psppire_data_editor_get_type        (void);
77 GtkWidget*     psppire_data_editor_new             (PsppireVarStore *, PsppireDataStore *);
78 void           psppire_data_editor_clip_copy       (PsppireDataEditor *);
79 void           psppire_data_editor_clip_paste      (PsppireDataEditor *);
80 void           psppire_data_editor_clip_cut        (PsppireDataEditor *);
81 void           psppire_data_editor_sort_ascending  (PsppireDataEditor *);
82 void           psppire_data_editor_sort_descending (PsppireDataEditor *);
83 void           psppire_data_editor_insert_variable (PsppireDataEditor *);
84 void           psppire_data_editor_delete_variables (PsppireDataEditor *);
85 void           psppire_data_editor_show_grid       (PsppireDataEditor *, gboolean);
86 void           psppire_data_editor_insert_case     (PsppireDataEditor *);
87 void           psppire_data_editor_delete_cases    (PsppireDataEditor *);
88 void           psppire_data_editor_set_font        (PsppireDataEditor *, PangoFontDescription *);
89 void           psppire_data_editor_delete_cases    (PsppireDataEditor *);
90 void           psppire_data_editor_split_window    (PsppireDataEditor *, gboolean );
91
92
93 G_END_DECLS
94
95 enum {PSPPIRE_DATA_EDITOR_DATA_VIEW = 0, PSPPIRE_DATA_EDITOR_VARIABLE_VIEW};
96
97
98 #endif /* __PSPPIRE_DATA_EDITOR_H__ */