GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-plugin.h
Go to the documentation of this file.
1 /*
2  * gnc-plugin.h -- A module or plugin which can add more
3  * functionality to GnuCash.
4  * Copyright (C) 2003 Jan Arne Petersen <[email protected]>
5  * Copyright (C) 2003,2005 David Hampton <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, contact:
19  *
20  * Free Software Foundation Voice: +1-617-542-5942
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22  * Boston, MA 02110-1301, USA [email protected]
23  */
24 
79 #ifndef __GNC_PLUGIN_H
80 #define __GNC_PLUGIN_H
81 
82 #include "gnc-main-window.h"
83 #include "gnc-plugin-page.h"
84 
85 G_BEGIN_DECLS
86 
87 /* type macros */
88 #define GNC_TYPE_PLUGIN (gnc_plugin_get_type ())
89 #define GNC_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN, GncPlugin))
90 #define GNC_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN, GncPluginClass))
91 #define GNC_IS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN))
92 #define GNC_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN))
93 #define GNC_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN, GncPluginClass))
94 
95 #define GNC_PLUGIN_NAME "GncPlugin"
96 
97 /* typedefs & structures */
98 
100 typedef struct
101 {
103  GObject gobject;
104 } GncPlugin;
105 
107 typedef struct
108 {
110  GObjectClass gobject;
112  const gchar *plugin_name;
113 
114  /* Actions section */
115 
119  const gchar *actions_name;
122  GtkActionEntry *actions;
124  guint n_actions;
127  GtkToggleActionEntry *toggle_actions;
134  const gchar **important_actions;
137  const gchar *ui_filename;
138 
139  /* Virtual Table */
140 
154  void (* add_to_window)
155  (GncPlugin *plugin, GncMainWindow *window, GQuark type);
156 
170  void (* remove_from_window)
171  (GncPlugin *plugin, GncMainWindow *window, GQuark type);
173 
174 /* function prototypes */
175 
180 GType gnc_plugin_get_type (void);
181 
182 
193 void gnc_plugin_add_to_window (GncPlugin *plugin,
194  GncMainWindow *window,
195  GQuark type);
196 
197 
209  GncMainWindow *window,
210  GQuark type);
211 
212 
219 const gchar *gnc_plugin_get_name (GncPlugin *plugin);
220 
221 
228 typedef struct
229 {
231  const char *action_name;
233  const char *label;
235 
236 
252 void gnc_plugin_init_short_names (GtkActionGroup *action_group,
253  action_toolbar_labels *toolbar_labels);
254 
255 
267 void gnc_plugin_set_important_actions (GtkActionGroup *action_group,
268  const gchar **names);
269 
270 
289 void gnc_plugin_update_actions (GtkActionGroup *action_group,
290  const gchar **action_names,
291  const gchar *property_name,
292  gboolean value);
293 
294 
310 gint gnc_plugin_add_actions (GtkUIManager *ui_merge,
311  GtkActionGroup *action_group,
312  const gchar *filename);
313 G_END_DECLS
314 
315 #endif /* __GNC_PLUGIN_H */
316 
GObject gobject
Definition: gnc-plugin.h:103
void gnc_plugin_add_to_window(GncPlugin *plugin, GncMainWindow *window, GQuark type)
Definition: gnc-plugin.c:157
const char * label
Definition: gnc-plugin.h:233
guint n_toggle_actions
Definition: gnc-plugin.h:129
const gchar * ui_filename
Definition: gnc-plugin.h:137
Functions for adding content to a window.
GType gnc_plugin_get_type(void)
Definition: gnc-plugin.c:71
GtkActionEntry * actions
Definition: gnc-plugin.h:122
gint gnc_plugin_add_actions(GtkUIManager *ui_merge, GtkActionGroup *action_group, const gchar *filename)
Definition: gnc-plugin.c:346
void gnc_plugin_init_short_names(GtkActionGroup *action_group, action_toolbar_labels *toolbar_labels)
Definition: gnc-plugin.c:263
Functions for adding plugins to a GnuCash window.
const gchar ** important_actions
Definition: gnc-plugin.h:134
void gnc_plugin_remove_from_window(GncPlugin *plugin, GncMainWindow *window, GQuark type)
Definition: gnc-plugin.c:209
GObjectClass gobject
Definition: gnc-plugin.h:110
const gchar * gnc_plugin_get_name(GncPlugin *plugin)
Definition: gnc-plugin.c:246
GtkToggleActionEntry * toggle_actions
Definition: gnc-plugin.h:127
const gchar * actions_name
Definition: gnc-plugin.h:119
const gchar * plugin_name
Definition: gnc-plugin.h:112
void gnc_plugin_update_actions(GtkActionGroup *action_group, const gchar **action_names, const gchar *property_name, gboolean value)
Definition: gnc-plugin.c:313
void gnc_plugin_set_important_actions(GtkActionGroup *action_group, const gchar **name)
Definition: gnc-plugin.c:289
const char * action_name
Definition: gnc-plugin.h:231