1 /* psppire-data-store.h
3 PSPPIRE --- A Graphical User Interface for PSPP
4 Copyright (C) 2006 Free Software Foundation
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef __PSPPIRE_DATA_STORE_H__
22 #define __PSPPIRE_DATA_STORE_H__
24 #include <gtksheet/gsheetmodel.h>
25 #include "psppire-dict.h"
26 #include "psppire-case-file.h"
28 #define FIRST_CASE_NUMBER 1
33 #endif /* __cplusplus */
35 #define GTK_TYPE_DATA_STORE (psppire_data_store_get_type ())
37 #define PSPPIRE_DATA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
38 GTK_TYPE_DATA_STORE, PsppireDataStore))
40 #define PSPPIRE_DATA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
41 GTK_TYPE_DATA_STORE, \
42 PsppireDataStoreClass))
44 #define PSPPIRE_IS_DATA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
46 #define PSPPIRE_IS_DATA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
48 #define PSPPIRE_DATA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
49 GTK_TYPE_DATA_STORE, \
50 PsppireDataStoreClass))
52 typedef struct _PsppireDataStore PsppireDataStore;
53 typedef struct _PsppireDataStoreClass PsppireDataStoreClass;
57 struct _PsppireDataStore
63 PsppireCaseFile *case_file;
64 const PangoFontDescription *font_desc;
66 /* The width of an upper case 'M' rendered in the current font */
75 struct _PsppireDataStoreClass
77 GObjectClass parent_class;
79 /* Padding for future expansion */
80 void (*_gtk_reserved1) (void);
81 void (*_gtk_reserved2) (void);
82 void (*_gtk_reserved3) (void);
83 void (*_gtk_reserved4) (void);
87 inline GType psppire_data_store_get_type (void) G_GNUC_CONST;
88 PsppireDataStore *psppire_data_store_new (PsppireDict *dict);
90 void psppire_data_store_set_case_file (PsppireDataStore *data_store,
93 void psppire_data_store_set_dictionary (PsppireDataStore *data_store,
96 void psppire_data_store_set_font (PsppireDataStore *store,
97 const PangoFontDescription *fd);
99 void psppire_data_store_show_labels (PsppireDataStore *store,
100 gboolean show_labels);
102 void psppire_data_store_clear (PsppireDataStore *data_store);
104 gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn);
106 struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds);
108 gchar * psppire_data_store_get_string (PsppireDataStore *ds,
109 gint row, gint column);
111 gboolean psppire_data_store_set_string (PsppireDataStore *ds,
113 gint row, gint column);
117 #endif /* __cplusplus */
120 #endif /* __PSPPIRE_DATA_STORE_H__ */