gui: Redo var sheet, data sheet, text import with PsppSheetView.
[pspp] / src / ui / gui / psppire-var-store.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2006, 2011, 2012  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 #ifndef __PSPPIRE_VAR_STORE_H__
18 #define __PSPPIRE_VAR_STORE_H__
19
20 #include "psppire-dict.h"
21 #include <gdk/gdk.h>
22
23 G_BEGIN_DECLS
24
25 /* PSPPIRE variable store. */
26 #define GTK_TYPE_VAR_STORE             (psppire_var_store_get_type ())
27
28 #define PSPPIRE_VAR_STORE(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
29                                                                     GTK_TYPE_VAR_STORE, PsppireVarStore))
30
31 #define PSPPIRE_VAR_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
32                                                                  GTK_TYPE_VAR_STORE, \
33                                                                  PsppireVarStoreClass))
34
35 #define PSPPIRE_IS_VAR_STORE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VAR_STORE))
36
37 #define PSPPIRE_IS_VAR_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VAR_STORE))
38
39 #define PSPPIRE_VAR_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
40                                                                    GTK_TYPE_VAR_STORE, \
41                                                                    PsppireVarStoreClass))
42
43 typedef struct _PsppireVarStore       PsppireVarStore;
44 typedef struct _PsppireVarStoreClass  PsppireVarStoreClass;
45
46 struct _PsppireVarStore
47 {
48   GObject parent;
49
50   /*< private >*/
51   PsppireDict *dictionary;
52 };
53
54 struct _PsppireVarStoreClass
55 {
56   GObjectClass parent_class;
57
58   /* Padding for future expansion */
59   void (*_gtk_reserved1) (void);
60   void (*_gtk_reserved2) (void);
61   void (*_gtk_reserved3) (void);
62   void (*_gtk_reserved4) (void);
63 };
64
65
66 GType         psppire_var_store_get_type         (void) G_GNUC_CONST;
67 PsppireVarStore *psppire_var_store_new              (PsppireDict *dict);
68 struct variable * psppire_var_store_get_var (PsppireVarStore *store, glong row);
69
70 /* Return the number of variables */
71 gint psppire_var_store_get_var_cnt (PsppireVarStore      *var_store);
72
73 G_END_DECLS
74
75 #endif /* __PSPPIRE_VAR_STORE_H__ */