1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2006 Free Software Foundation
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.
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.
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/>. */
17 #ifndef __PSPPIRE_DATA_STORE_H__
18 #define __PSPPIRE_DATA_STORE_H__
20 #include "psppire-dict.h"
21 #include "psppire-case-file.h"
23 #define FIRST_CASE_NUMBER 1
28 #endif /* __cplusplus */
30 #define GTK_TYPE_DATA_STORE (psppire_data_store_get_type ())
32 #define PSPPIRE_DATA_STORE(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
34 GTK_TYPE_DATA_STORE, PsppireDataStore))
36 #define PSPPIRE_DATA_STORE_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), \
38 GTK_TYPE_DATA_STORE, \
39 PsppireDataStoreClass))
42 #define PSPPIRE_IS_DATA_STORE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
45 #define PSPPIRE_IS_DATA_STORE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
48 #define PSPPIRE_DATA_STORE_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
50 GTK_TYPE_DATA_STORE, \
51 PsppireDataStoreClass))
53 typedef struct _PsppireDataStore PsppireDataStore;
54 typedef struct _PsppireDataStoreClass PsppireDataStoreClass;
59 enum cf_signal_handler {
67 enum dict_signal_handler {
75 void do_this_thing (PsppireDict *, struct dictionary *, void *);
78 struct _PsppireDataStore
83 gboolean dispose_has_run ;
85 PsppireCaseFile *case_file;
92 gint cf_handler_id [n_cf_signals];
93 gint dict_handler_id [n_dict_signals];
96 struct _PsppireDataStoreClass
98 GObjectClass parent_class;
100 /* Padding for future expansion */
101 void (*_gtk_reserved1) (void);
102 void (*_gtk_reserved2) (void);
103 void (*_gtk_reserved3) (void);
104 void (*_gtk_reserved4) (void);
108 GType psppire_data_store_get_type (void) G_GNUC_CONST;
109 PsppireDataStore *psppire_data_store_new (PsppireDict *dict);
111 void psppire_data_store_set_case_file (PsppireDataStore *data_store,
112 PsppireCaseFile *cf);
114 void psppire_data_store_set_dictionary (PsppireDataStore *data_store,
117 void psppire_data_store_show_labels (PsppireDataStore *store,
118 gboolean show_labels);
120 void psppire_data_store_clear (PsppireDataStore *data_store);
122 gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn);
125 gboolean psppire_data_store_delete_cases (PsppireDataStore *ds, casenumber first, casenumber count);
128 struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds);
130 gchar * psppire_data_store_get_string (PsppireDataStore *ds,
131 casenumber row, glong column);
133 gboolean psppire_data_store_set_string (PsppireDataStore *ds,
135 glong row, glong column);
137 casenumber psppire_data_store_get_case_count (const PsppireDataStore *ds);
138 size_t psppire_data_store_get_value_count (const PsppireDataStore *ds);
142 #endif /* __cplusplus */
145 #endif /* __PSPPIRE_DATA_STORE_H__ */