1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2006, 2009, 2011, 2012 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"
22 #define FIRST_CASE_NUMBER 1
27 #define PSPPIRE_TYPE_DATA_STORE (psppire_data_store_get_type ())
29 #define PSPPIRE_DATA_STORE(obj) \
30 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
31 PSPPIRE_TYPE_DATA_STORE, PsppireDataStore))
33 #define PSPPIRE_DATA_STORE_CLASS(klass) \
34 (G_TYPE_CHECK_CLASS_CAST ((klass), \
35 PSPPIRE_TYPE_DATA_STORE, \
36 PsppireDataStoreClass))
39 #define PSPPIRE_IS_DATA_STORE(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DATA_STORE))
42 #define PSPPIRE_IS_DATA_STORE_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DATA_STORE))
45 #define PSPPIRE_DATA_STORE_GET_CLASS(obj) \
46 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
47 PSPPIRE_TYPE_DATA_STORE, \
48 PsppireDataStoreClass))
50 typedef struct _PsppireDataStore PsppireDataStore;
51 typedef struct _PsppireDataStoreClass PsppireDataStoreClass;
56 enum dict_signal_handler {
67 struct _PsppireDataStore
72 gboolean dispose_has_run ;
74 struct datasheet *datasheet;
76 gint dict_handler_id [n_dict_signals];
79 struct _PsppireDataStoreClass
81 GObjectClass parent_class;
85 GType psppire_data_store_get_type (void) G_GNUC_CONST;
86 PsppireDataStore *psppire_data_store_new (PsppireDict *dict);
89 void psppire_data_store_set_reader (PsppireDataStore *ds,
90 struct casereader *reader);
92 void psppire_data_store_set_dictionary (PsppireDataStore *data_store,
95 void psppire_data_store_clear (PsppireDataStore *data_store);
97 gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn);
100 gboolean psppire_data_store_delete_cases (PsppireDataStore *ds, casenumber first, casenumber count);
103 struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds);
105 gchar *psppire_data_store_get_string (PsppireDataStore *,
106 glong row, const struct variable *,
107 bool use_value_label);
108 gboolean psppire_data_store_set_value (PsppireDataStore *,
110 const struct variable *,
111 const union value *);
112 gboolean psppire_data_store_set_string (PsppireDataStore *ds,
114 glong row, const struct variable *,
115 gboolean use_value_label);
118 gboolean psppire_data_store_filtered (PsppireDataStore *ds,
122 casenumber psppire_data_store_get_case_count (const PsppireDataStore *ds);
123 size_t psppire_data_store_get_value_count (const PsppireDataStore *ds);
124 const struct caseproto *psppire_data_store_get_proto (const PsppireDataStore *);
128 struct ccase *psppire_data_store_get_case (const PsppireDataStore *ds,
136 #endif /* __PSPPIRE_DATA_STORE_H__ */