]> www.fi.muni.cz Git - evince.git/blob - cut-n-paste/toolbar-editor/egg-toolbars-model.h
Fix gcc 4.0 warnings. Second part
[evince.git] / cut-n-paste / toolbar-editor / egg-toolbars-model.h
1 /*
2  *  Copyright (C) 2003-2004 Marco Pesenti Gritti
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 2, or (at your option)
7  *  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, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  * 
18  *  $Id$
19  */
20
21 #ifndef EGG_TOOLBARS_MODEL_H
22 #define EGG_TOOLBARS_MODEL_H
23
24 #include <glib.h>
25 #include <glib-object.h>
26 #include <gdk/gdktypes.h>
27
28 G_BEGIN_DECLS
29
30 #define EGG_TYPE_TOOLBARS_MODEL             (egg_toolbars_model_get_type ())
31 #define EGG_TOOLBARS_MODEL(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModel))
32 #define EGG_TOOLBARS_MODEL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModelClass))
33 #define EGG_IS_TOOLBARS_MODEL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TOOLBARS_MODEL))
34 #define EGG_IS_TOOLBARS_MODEL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TOOLBARS_MODEL))
35 #define EGG_TOOLBARS_MODEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TOOLBARS_MODEL, EggToolbarsModelClass))
36
37 typedef struct EggToolbarsModel         EggToolbarsModel;
38 typedef struct EggToolbarsModelPrivate  EggToolbarsModelPrivate;
39 typedef struct EggToolbarsModelClass    EggToolbarsModelClass;
40
41 #define EGG_TOOLBAR_ITEM_TYPE "application/x-toolbar-item"
42
43 typedef enum
44 {
45   EGG_TB_MODEL_NOT_REMOVABLE     = 1 << 0,
46   EGG_TB_MODEL_BOTH              = 1 << 1,
47   EGG_TB_MODEL_BOTH_HORIZ        = 1 << 2,
48   EGG_TB_MODEL_ICONS             = 1 << 3,
49   EGG_TB_MODEL_TEXT              = 1 << 4,
50   EGG_TB_MODEL_STYLES_MASK       = 0x1F,
51   EGG_TB_MODEL_ACCEPT_ITEMS_ONLY = 1 << 5
52 } EggTbModelFlags;
53
54 struct EggToolbarsModel
55 {
56   GObject parent_object;
57
58   /*< private >*/
59   EggToolbarsModelPrivate *priv;
60 };
61
62 struct EggToolbarsModelClass
63 {
64   GObjectClass parent_class;
65
66   /* Signals */
67   void (* item_added)      (EggToolbarsModel *model,
68                             int toolbar_position,
69                             int position);
70   void (* item_removed)    (EggToolbarsModel *model,
71                             int toolbar_position,
72                             int position);
73   void (* toolbar_added)   (EggToolbarsModel *model,
74                             int position);
75   void (* toolbar_changed) (EggToolbarsModel *model,
76                             int position);
77   void (* toolbar_removed) (EggToolbarsModel *model,
78                             int position);
79   char * (* get_item_type) (EggToolbarsModel *model,
80                             GdkAtom           dnd_type);
81   char * (* get_item_id)   (EggToolbarsModel *model,
82                             const char       *type,
83                             const char       *data);
84   char * (* get_item_data) (EggToolbarsModel *model,
85                             const char       *type,
86                             const char       *id);
87
88   /* Virtual Table */
89   gboolean (* add_item)    (EggToolbarsModel *t,
90                             int               toolbar_position,
91                             int               position,
92                             const char       *id,
93                             const char       *type);
94 };
95
96 GType             egg_toolbars_model_flags_get_type (void);
97 GType             egg_toolbars_model_get_type       (void);
98 EggToolbarsModel *egg_toolbars_model_new            (void);
99 gboolean          egg_toolbars_model_load           (EggToolbarsModel *model,
100                                                      const char *xml_file);
101 void              egg_toolbars_model_save           (EggToolbarsModel *model,
102                                                      const char *xml_file,
103                                                      const char *version);
104 int               egg_toolbars_model_add_toolbar    (EggToolbarsModel *model,
105                                                      int               position,
106                                                      const char       *name);
107 EggTbModelFlags   egg_toolbars_model_get_flags      (EggToolbarsModel *model,
108                                                      int               toolbar_position);
109 void              egg_toolbars_model_set_flags      (EggToolbarsModel *model,
110                                                      int               toolbar_position,
111                                                      EggTbModelFlags   flags);
112 void              egg_toolbars_model_add_separator  (EggToolbarsModel *model,
113                                                      int               toolbar_position,
114                                                      int               position);
115 char             *egg_toolbars_model_get_item_type  (EggToolbarsModel *model,
116                                                      GdkAtom           dnd_type);
117 char             *egg_toolbars_model_get_item_id    (EggToolbarsModel *model,
118                                                      const char       *type,
119                                                      const char       *name);
120 char             *egg_toolbars_model_get_item_data  (EggToolbarsModel *model,
121                                                      const char       *type,
122                                                      const char       *id);
123 gboolean          egg_toolbars_model_add_item       (EggToolbarsModel *model,
124                                                      int               toolbar_position,
125                                                      int               position,
126                                                      const char       *id,
127                                                      const char       *type);
128 void              egg_toolbars_model_remove_toolbar (EggToolbarsModel *model,
129                                                      int               position);
130 void              egg_toolbars_model_remove_item    (EggToolbarsModel *model,
131                                                      int               toolbar_position,
132                                                      int               position);
133 void              egg_toolbars_model_move_item      (EggToolbarsModel *model,
134                                                      int               toolbar_position,
135                                                      int               position,
136                                                      int               new_toolbar_position,
137                                                      int               new_position);
138 int               egg_toolbars_model_n_items        (EggToolbarsModel *model,
139                                                      int               toolbar_position);
140 void              egg_toolbars_model_item_nth       (EggToolbarsModel *model,
141                                                      int               toolbar_position,
142                                                      int               position,
143                                                      gboolean         *is_separator,
144                                                      const char      **id,
145                                                      const char      **type);
146 int               egg_toolbars_model_n_toolbars     (EggToolbarsModel *model);
147 const char       *egg_toolbars_model_toolbar_nth    (EggToolbarsModel *model,
148                                                      int               position);
149
150 G_END_DECLS
151
152 #endif