0787f116c4511beac19b6cb28898c72a6fc64b05
[pspp-builds.git] / src / ui / gui / psppire-data-store.h
1 /* psppire-data-store.h
2  
3    PSPPIRE --- A Graphical User Interface for PSPP
4    Copyright (C) 2006  Free Software Foundation
5    Written by John Darrington
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301, USA. */
21
22 #ifndef __PSPPIRE_DATA_STORE_H__
23 #define __PSPPIRE_DATA_STORE_H__
24
25 #include <gtksheet/gsheetmodel.h>
26 #include "psppire-dict.h"
27 #include "psppire-case-file.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33 #define GTK_TYPE_DATA_STORE            (psppire_data_store_get_type ())
34
35 #define PSPPIRE_DATA_STORE(obj)        (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
36                                                                     GTK_TYPE_DATA_STORE, PsppireDataStore))
37
38 #define PSPPIRE_DATA_STORE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), \
39                                                                  GTK_TYPE_DATA_STORE, \
40                                                                  PsppireDataStoreClass))
41
42 #define PSPPIRE_IS_DATA_STORE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATA_STORE))
43
44 #define PSPPIRE_IS_DATA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATA_STORE))
45
46 #define PSPPIRE_DATA_STORE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
47                                                                    GTK_TYPE_DATA_STORE, \
48                                                                    PsppireDataStoreClass))
49
50 typedef struct _PsppireDataStore       PsppireDataStore;
51 typedef struct _PsppireDataStoreClass  PsppireDataStoreClass;
52
53 struct dictionary;
54
55 struct _PsppireDataStore
56 {
57   GObject parent;
58
59   /*< private >*/
60   PsppireDict *dict;
61   PsppireCaseFile *case_file;
62   const PangoFontDescription *font_desc;
63
64   /* The width of an upper case 'M' rendered in the current font */
65   gint width_of_m ; 
66   
67   gboolean show_labels;
68
69   /* Geometry */
70   gint margin_width;
71 };
72
73 struct _PsppireDataStoreClass
74 {
75   GObjectClass parent_class;
76
77   /* Padding for future expansion */
78   void (*_gtk_reserved1) (void);
79   void (*_gtk_reserved2) (void);
80   void (*_gtk_reserved3) (void);
81   void (*_gtk_reserved4) (void);
82 };
83
84
85 inline GType psppire_data_store_get_type (void) G_GNUC_CONST;
86 PsppireDataStore *psppire_data_store_new     (PsppireDict *dict);
87
88 void psppire_data_store_set_dictionary(PsppireDataStore *data_store, 
89                                        PsppireDict *dict);
90
91 void psppire_data_store_set_font(PsppireDataStore *store, 
92                                  const PangoFontDescription *fd);
93
94 void psppire_data_store_show_labels(PsppireDataStore *store, 
95                                     gboolean show_labels);
96   
97 void psppire_data_store_clear(PsppireDataStore *data_store);
98
99 struct file_handle;
100
101 void psppire_data_store_create_system_file (PsppireDataStore *store,
102                                             struct file_handle *handle);
103
104 gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn);
105
106
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112
113 #endif /* __PSPPIRE_DATA_STORE_H__ */