GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-main-window.h
Go to the documentation of this file.
1 /*
2  * gnc-main-window.h -- GtkWindow which represents the
3  * GnuCash main window.
4  *
5  * Copyright (C) 2003 Jan Arne Petersen <[email protected]>
6  * Copyright (C) 2003,2005 David Hampton <[email protected]>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (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, contact:
20  *
21  * Free Software Foundation Voice: +1-617-542-5942
22  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
23  * Boston, MA 02110-1301, USA [email protected]
24  */
25 
36 #ifndef __GNC_MAIN_WINDOW_H
37 #define __GNC_MAIN_WINDOW_H
38 
39 #include <gtk/gtk.h>
40 #include "gnc-plugin-page.h"
41 
42 /* type macros */
43 #define GNC_TYPE_MAIN_WINDOW (gnc_main_window_get_type ())
44 #define GNC_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow))
45 #define GNC_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
46 #define GNC_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_MAIN_WINDOW))
47 #define GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW))
48 #define GNC_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
49 
50 #define PLUGIN_PAGE_IMMUTABLE "page-immutable"
51 
52 /* typedefs & structures */
53 
55 typedef struct GncMainWindow
56 {
57  GtkWindow gtk_window;
58  GtkUIManager *ui_merge;
61 
63 typedef struct
64 {
65  GtkWindowClass gtk_window;
68  /* callbacks */
69  void (*page_added) (GncMainWindow *window,
70  GncPluginPage *page);
71  void (*page_changed) (GncMainWindow *window,
72  GncPluginPage *page);
74 
75 typedef struct
76 {
77  GncMainWindow *window;
78  gpointer data;
80 
81 typedef void (*GncMainWindowFunc) (GncMainWindow *window, GncPluginPage *page);
82 typedef void (*GncMainWindowPageFunc) (GncPluginPage *page, gpointer user_data);
83 
84 /* function prototypes */
85 
90 GType gnc_main_window_get_type (void);
91 
92 
98 
99 
106 
107 
121  GncPluginPage *page);
122 
123 
132 
133 
134 /* Iterator function to walk all pages in all windows, calling the
135  * specified function for each page.
136  *
137  * @param entry A pointer to the function to be called.
138  *
139  * @param user_data A data pointer passed to each call of the function.
140  */
141 void gnc_main_window_foreach_page (GncMainWindowPageFunc fn,
142  gpointer user_data);
143 
144 
160 
161 
164 GtkUIManager *gnc_main_window_get_uimanager (GncMainWindow *window);
165 
166 
172 void
174  const gchar *name_in);
175 
176 
182 void
184  const gchar *color_in);
185 
186 
206  const gchar *group_name,
207  GtkActionGroup *group,
208  guint merge_id);
209 
210 
241  const gchar *group_name,
242  GtkActionEntry *entries,
243  guint n_entries,
244  GtkToggleActionEntry *toggle_entries,
245  guint n_toggle_entries,
246  const gchar *filename,
247  gpointer user_data);
248 
249 
262  const gchar *group_name);
263 
264 
276 
277 
291 GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
292  const gchar *group_name);
293 
294 
302 
303 
321 gboolean gnc_main_window_button_press_cb (GtkWidget *whatever,
322  GdkEventButton *event,
323  GncPluginPage *page);
324 
329 void gnc_main_window_restore_all_windows(const GKeyFile *keyfile);
330 
335 void gnc_main_window_save_all_windows(GKeyFile *keyfile);
336 
340 
359 void
360 gnc_gtk_action_group_set_translation_domain (GtkActionGroup *action_group,
361  const gchar *domain);
362 
363 
374 
375 
384 gboolean gnc_main_window_all_finish_pending (void);
385 
394 void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
395 
406 GtkAction *gnc_main_window_find_action (GncMainWindow *window, const gchar *name);
407 
412 
423 GtkWidget *gnc_book_options_dialog_cb (gboolean modal, gchar *title);
424 
425 #endif /* __GNC_MAIN_WINDOW_H */
426 
void gnc_main_window_restore_all_windows(const GKeyFile *keyfile)
GtkWidget * gnc_book_options_dialog_cb(gboolean modal, gchar *title)
GtkWindowClass gtk_window
gboolean gnc_main_window_button_press_cb(GtkWidget *whatever, GdkEventButton *event, GncPluginPage *page)
void gnc_main_window_unmerge_actions(GncMainWindow *window, const gchar *group_name)
void gnc_main_window_show_all_windows(void)
void gnc_main_window_merge_actions(GncMainWindow *window, const gchar *group_name, GtkActionEntry *actions, guint n_actions, GtkToggleActionEntry *toggle_actions, guint n_toggle_actions, const gchar *filename, gpointer user_data)
void gnc_main_window_display_page(GncPluginPage *page)
void gnc_main_window_save_all_windows(GKeyFile *keyfile)
GncPluginPage * gnc_main_window_get_current_page(GncMainWindow *window)
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
void gnc_main_window_all_action_set_sensitive(const gchar *action_name, gboolean sensitive)
void main_window_update_page_color(GncPluginPage *page, const gchar *color_in)
GType gnc_main_window_get_type(void)
GtkUIManager * ui_merge
Functions for adding plugins to a GnuCash window.
struct GncMainWindow GncMainWindow
gboolean gnc_main_window_finish_pending(GncMainWindow *window)
GtkActionGroup * gnc_main_window_get_action_group(GncMainWindow *window, const gchar *group_name)
GncMainWindow * gnc_main_window_new(void)
void gnc_main_window_manual_merge_actions(GncMainWindow *window, const gchar *group_name, GtkActionGroup *group, guint merge_id)
void gnc_main_window_close_page(GncPluginPage *page)
GtkWindow gtk_window
void gnc_main_window_restore_default_state(GncMainWindow *window)
gboolean gnc_main_window_all_finish_pending(void)
void gnc_gtk_action_group_set_translation_domain(GtkActionGroup *action_group, const gchar *domain)
void gnc_main_window_actions_updated(GncMainWindow *window)
void main_window_update_page_name(GncPluginPage *page, const gchar *name_in)
GtkUIManager * gnc_main_window_get_uimanager(GncMainWindow *window)
GtkAction * gnc_main_window_find_action(GncMainWindow *window, const gchar *name)
void gnc_main_window_set_progressbar_window(GncMainWindow *window)