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