]> git.sur5r.net Git - glabels/blob - glabels2/src/prefs-model.h
2007-01-19 Jim Evins <evins@snaught.com>
[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 <gconf/gconf-client.h>
27 #include <pango/pango.h>
28 #include <libglabels/enums.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 #define GL_TYPE_PREFS_MODEL              (gl_prefs_model_get_type ())
39 #define GL_PREFS_MODEL(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_PREFS_MODEL, glPrefsModel))
40 #define GL_PREFS_MODEL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_PREFS_MODEL, glPrefsModelClass))
41 #define GL_IS_PREFS_MODEL(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_PREFS_MODEL))
42 #define GL_IS_PREFS_MODEL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_PREFS_MODEL))
43 #define GL_PREFS_MODEL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_PREFS_MODEL, glPrefsModelClass))
44
45
46 typedef struct _glPrefsModel          glPrefsModel;
47 typedef struct _glPrefsModelClass     glPrefsModelClass;
48
49 typedef struct _glPrefsModelPrivate   glPrefsModelPrivate;
50
51
52 struct _glPrefsModel {
53         GObject          *object;
54
55         GConfClient      *gconf_client;
56
57         /* Units */
58         glUnitsType       units;
59
60         /* Page size */
61         gchar            *default_page_size;
62
63         /* Text properties */
64         gchar            *default_font_family;
65         gdouble           default_font_size;
66         PangoWeight       default_font_weight;
67         gboolean          default_font_italic_flag;
68         guint             default_text_color;
69         PangoAlignment    default_text_alignment;
70         gdouble           default_text_line_spacing;
71         
72         /* Line properties */
73         gdouble           default_line_width;
74         guint             default_line_color;
75         
76         /* Fill properties */
77         guint             default_fill_color;
78
79         /* User Interface/Main Toolbar */
80         gboolean          main_toolbar_visible;
81         glToolbarSetting  main_toolbar_buttons_style; 
82         gboolean          main_toolbar_view_tooltips;
83
84         /* User Interface/Drawing Toolbar */
85         gboolean          drawing_toolbar_visible;
86         gboolean          drawing_toolbar_view_tooltips;
87
88         /* User Interface/Property Toolbar */
89         gboolean          property_toolbar_visible;
90         gboolean          property_toolbar_view_tooltips;
91
92         /* View properties */
93         gboolean          grid_visible;
94         gboolean          markup_visible;
95
96         /* Recent files */
97         gint              max_recents;
98 };
99
100 struct _glPrefsModelClass {
101         GObjectClass     parent_class;
102
103         void (*changed)          (glPrefsModel *prefs_model, gpointer user_data);
104 };
105
106
107 GType         gl_prefs_model_get_type            (void) G_GNUC_CONST;
108
109 glPrefsModel *gl_prefs_model_new                 (void);
110
111 void          gl_prefs_model_save_settings       (glPrefsModel   *prefs_model);
112
113 void          gl_prefs_model_load_settings       (glPrefsModel   *prefs_model);
114
115 G_END_DECLS
116
117 #endif /* __PREFS_MODEL_H__ */
118