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 <gtksheet/gsheetmodel.h>
21 #include "psppire-dict.h"
22 #include "psppire-case-file.h"
24 #define FIRST_CASE_NUMBER 1
29 #endif /* __cplusplus */
31 #define GTK_TYPE_DATA_STORE (psppire_data_store_get_type ())
33 #define PSPPIRE_DATA_STORE(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
35 GTK_TYPE_DATA_STORE, PsppireDataStore))
37 #define PSPPIRE_DATA_STORE_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), \
39 GTK_TYPE_DATA_STORE, \
40 PsppireDataStoreClass))
43 #define PSPPIRE_IS_DATA_STORE(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
46 #define PSPPIRE_IS_DATA_STORE_CLASS(klass) \
47 (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
49 #define PSPPIRE_DATA_STORE_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
51 GTK_TYPE_DATA_STORE, \
52 PsppireDataStoreClass))
54 typedef struct _PsppireDataStore PsppireDataStore;
55 typedef struct _PsppireDataStoreClass PsppireDataStoreClass;
59 struct _PsppireDataStore
65 PsppireCaseFile *case_file;
66 const PangoFontDescription *font_desc;
68 /* The width of an upper case 'M' rendered in the current font */
77 struct _PsppireDataStoreClass
79 GObjectClass parent_class;
81 /* Padding for future expansion */
82 void (*_gtk_reserved1) (void);
83 void (*_gtk_reserved2) (void);
84 void (*_gtk_reserved3) (void);
85 void (*_gtk_reserved4) (void);
89 inline GType psppire_data_store_get_type (void) G_GNUC_CONST;
90 PsppireDataStore *psppire_data_store_new (PsppireDict *dict);
92 void psppire_data_store_set_case_file (PsppireDataStore *data_store,
95 void psppire_data_store_set_dictionary (PsppireDataStore *data_store,
98 void psppire_data_store_set_font (PsppireDataStore *store,
99 const PangoFontDescription *fd);
101 void psppire_data_store_show_labels (PsppireDataStore *store,
102 gboolean show_labels);
104 void psppire_data_store_clear (PsppireDataStore *data_store);
106 gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn);
109 gboolean psppire_data_store_delete_cases (PsppireDataStore *ds, casenumber first, casenumber count);
112 struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds);
114 gchar * psppire_data_store_get_string (PsppireDataStore *ds,
115 casenumber row, glong column);
117 gboolean psppire_data_store_set_string (PsppireDataStore *ds,
119 glong row, glong column);
121 casenumber psppire_data_store_get_case_count (PsppireDataStore *store);
126 #endif /* __cplusplus */
129 #endif /* __PSPPIRE_DATA_STORE_H__ */