]> git.sur5r.net Git - glabels/blob - glabels2/src/prefs-model.h
- Changed gl_prefs from a simple structure to a full-fledged object (prefs_model).
[glabels] / glabels2 / src / prefs-model.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  prefs-model.h:  Application preferences model module header file
5  *
6  *  Copyright (C) 2001-2003  Jim Evins <evins@snaught.com>.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  */
22 #ifndef __PREFS_MODEL_H__
23 #define __PREFS_MODEL_H__
24
25 #include <glib-object.h>
26 #include <gtk/gtk.h>
27 #include <gconf/gconf-client.h>
28 #include <libgnomeprint/gnome-font.h>
29
30 G_BEGIN_DECLS
31
32 typedef enum {
33         GL_TOOLBAR_SYSTEM = 0,
34         GL_TOOLBAR_ICONS,
35         GL_TOOLBAR_ICONS_AND_TEXT
36 } glToolbarSetting;
37
38 typedef enum {
39         GL_UNITS_PTS,
40         GL_UNITS_INCHES,
41         GL_UNITS_MM,
42 } glPrefsUnits;
43
44 #define GL_TYPE_PREFS_MODEL              (gl_prefs_model_get_type ())
45 #define GL_PREFS_MODEL(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_PREFS_MODEL, glPrefsModel))
46 #define GL_PREFS_MODEL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_PREFS_MODEL, glPrefsModelClass))
47 #define GL_IS_PREFS_MODEL(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_PREFS_MODEL))
48 #define GL_IS_PREFS_MODEL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_PREFS_MODEL))
49 #define GL_PREFS_MODEL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_PREFS_MODEL, glPrefsModelClass))
50
51
52 typedef struct _glPrefsModel          glPrefsModel;
53 typedef struct _glPrefsModelClass     glPrefsModelClass;
54
55 typedef struct _glPrefsModelPrivate   glPrefsModelPrivate;
56
57
58 struct _glPrefsModel {
59         GObject          *object;
60
61         GConfClient      *gconf_client;
62
63         /* Units */
64         glPrefsUnits      units;
65
66         /* Page size */
67         gchar            *default_page_size;
68
69         /* Text properties */
70         gchar            *default_font_family;
71         gdouble           default_font_size;
72         GnomeFontWeight   default_font_weight;
73         gboolean          default_font_italic_flag;
74         guint             default_text_color;
75         GtkJustification  default_text_alignment;
76         
77         /* Line properties */
78         gdouble           default_line_width;
79         guint             default_line_color;
80         
81         /* Fill properties */
82         guint             default_fill_color;
83
84         /* User Interface/Main Toolbar */
85         gboolean          main_toolbar_visible;
86         glToolbarSetting  main_toolbar_buttons_style; 
87         gboolean          main_toolbar_view_tooltips;
88
89         /* User Interface/Drawing Toolbar */
90         gboolean          drawing_toolbar_visible;
91         glToolbarSetting  drawing_toolbar_buttons_style; 
92         gboolean          drawing_toolbar_view_tooltips;
93
94         /* View properties */
95         gboolean          grid_visible;
96         gboolean          markup_visible;
97
98         /* Recent files */
99         gint              max_recents;
100 };
101
102 struct _glPrefsModelClass {
103         GObjectClass     parent_class;
104
105         void (*changed)          (glPrefsModel *prefs_model, gpointer user_data);
106 };
107
108
109 GType         gl_prefs_model_get_type            (void);
110
111 glPrefsModel *gl_prefs_model_new                 (void);
112
113 void          gl_prefs_model_save_settings       (glPrefsModel   *prefs_model);
114
115 void          gl_prefs_model_load_settings       (glPrefsModel   *prefs_model);
116
117 G_END_DECLS
118
119 #endif /* __PREFS_MODEL_H__ */
120