find-dialog.c: Replace exp10 with our own integer version
[pspp] / src / ui / gui / psppire-conf.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2009, 2010  Free Software Foundation
3
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.
8
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.
13
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/>. */
16
17
18 #include <glib-object.h>
19 #include <glib.h>
20
21 #include <gtk/gtk.h>
22
23 #ifndef __PSPPIRE_CONF_H__
24 #define __PSPPIRE_CONF_H__
25
26 G_BEGIN_DECLS
27
28
29 #define PSPPIRE_TYPE_CONF (psppire_conf_get_type ())
30
31 #define PSPPIRE_CONF(obj)       \
32                      (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
33                     PSPPIRE_TYPE_CONF, PsppireConf))
34
35 #define PSPPIRE_CONF_CLASS(klass) \
36                      (G_TYPE_CHECK_CLASS_CAST ((klass), \
37                                  PSPPIRE_TYPE_CONF, \
38                                  PsppireConfClass))
39
40
41 #define PSPPIRE_IS_CONF(obj) \
42                      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_CONF))
43
44 #define PSPPIRE_IS_CONF_CLASS(klass) \
45                      (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_CONF))
46
47
48 #define PSPPIRE_CONF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
49                                    PSPPIRE_TYPE_CONF, \
50                                    PsppireConfClass))
51
52 typedef struct _PsppireConf       PsppireConf;
53 typedef struct _PsppireConfClass  PsppireConfClass;
54
55
56 struct _PsppireConf
57 {
58   GObject parent;
59
60   /*< private >*/
61   gboolean dispose_has_run ;
62
63   GKeyFile *keyfile;
64   gchar *filename;
65   guint idle;
66 };
67
68
69 struct _PsppireConfClass
70 {
71   GObjectClass parent_class;
72 };
73
74
75 GType psppire_conf_get_type (void) G_GNUC_CONST;
76
77 PsppireConf * psppire_conf_new (void);
78
79 gboolean psppire_conf_get_int (PsppireConf *,
80                                const gchar *, const gchar *, int *);
81
82 gboolean psppire_conf_get_string (PsppireConf *,
83                                const gchar *, const gchar *, gchar **);
84
85 gboolean psppire_conf_get_boolean (PsppireConf *,
86                                    const gchar *, const gchar *, gboolean *);
87
88
89 gboolean psppire_conf_get_variant (PsppireConf *,
90                                    const gchar *, const gchar *, GVariant **);
91
92
93 gboolean psppire_conf_get_enum (PsppireConf *conf, const gchar *base,
94                                 const gchar *name,
95                                 GType t,
96                                 int *v);
97
98 void psppire_conf_set_int (PsppireConf *conf,
99                            const gchar *base, const gchar *name,
100                            gint value);
101
102 void psppire_conf_set_boolean (PsppireConf *conf,
103                                const gchar *base, const gchar *name,
104                                gboolean value);
105
106 void psppire_conf_set_string (PsppireConf *conf,
107                                const gchar *base, const gchar *name,
108                               const gchar *value);
109
110
111 void psppire_conf_set_variant (PsppireConf *conf,
112                                const gchar *base, const gchar *name,
113                                GVariant *value);
114
115
116 void psppire_conf_set_enum (PsppireConf *conf,
117                             const gchar *base, const gchar *name,
118                             GType enum_type,
119                             int value);
120
121 void psppire_conf_set_window_geometry (PsppireConf *conf,
122                                        const gchar *base,
123                                        GtkWindow *window);
124
125 void psppire_conf_save_window_geometry (PsppireConf *,
126                                         const gchar *,
127                                         GtkWindow *);
128
129
130 G_END_DECLS
131
132 #endif /* __PSPPIRE_CONF_H__ */