Implement DATASET commands.
[pspp-builds.git] / src / ui / gui / psppire-data-window.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2008, 2010, 2011  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 __PSPPIRE_DATA_WINDOW_H__
19 #define __PSPPIRE_DATA_WINDOW_H__
20
21
22 #include <glib.h>
23 #include <glib-object.h>
24 #include <gtk/gtk.h>
25
26 #include "libpspp/ll.h"
27 #include "ui/gui/psppire-window.h"
28 #include "ui/gui/psppire-data-editor.h"
29
30 G_BEGIN_DECLS
31
32 #define PSPPIRE_DATA_WINDOW_TYPE            (psppire_data_window_get_type ())
33 #define PSPPIRE_DATA_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_DATA_WINDOW_TYPE, PsppireDataWindow))
34 #define PSPPIRE_DATA_WINDOW_CLASS(class)    (G_TYPE_CHECK_CLASS_CAST ((class), \
35     PSPPIRE_DATA_WINDOW_TYPE, PsppireData_WindowClass))
36 #define PSPPIRE_IS_DATA_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
37     PSPPIRE_DATA_WINDOW_TYPE))
38 #define PSPPIRE_IS_DATA_WINDOW_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
39     PSPPIRE_DATA_WINDOW_TYPE))
40
41
42 typedef struct _PsppireDataWindow       PsppireDataWindow;
43 typedef struct _PsppireDataWindowClass  PsppireDataWindowClass;
44
45
46 struct _PsppireDataWindow
47 {
48   PsppireWindow parent;
49
50   /* <private> */
51   PsppireDataEditor *data_editor;
52   GtkBuilder *builder;
53
54   PsppireVarStore *var_store;
55   struct dataset *dataset;
56   PsppireDataStore *data_store;
57
58   GtkAction *invoke_goto_dialog;
59
60   GtkAction *insert_variable;
61   GtkAction *insert_case;
62   GtkAction *delete_variables;
63   GtkAction *delete_cases;
64
65
66   gboolean save_as_portable;
67
68   struct ll ll;                 /* In global 'all_data_windows' list. */
69   unsigned long int lazy_serial;
70   unsigned int dataset_seqno;
71 };
72
73 struct _PsppireDataWindowClass
74 {
75   PsppireWindowClass parent_class;
76 };
77
78 extern struct session *the_session;
79 extern struct ll_list all_data_windows;
80
81 GType      psppire_data_window_get_type        (void);
82 GtkWidget* psppire_data_window_new             (struct dataset *);
83
84 PsppireDataWindow *psppire_default_data_window (void);
85 void psppire_data_window_set_default (PsppireDataWindow *);
86 void psppire_data_window_undefault (PsppireDataWindow *);
87
88 PsppireDataWindow *psppire_data_window_for_dataset (struct dataset *);
89
90 bool psppire_data_window_is_empty (PsppireDataWindow *);
91 void create_data_window (void);
92
93 G_END_DECLS
94
95 #endif /* __PSPPIRE_DATA_WINDOW_H__ */