GnuCash  4.12-5-ga27adb78e3+
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 <jpetersen@uni-bonn.de>
6  * Copyright (C) 2003,2005 David Hampton <hampton@employees.org>
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 gnu@gnu.org
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;
60  gboolean window_quitting;
61  gboolean just_plugin_prefs;
63 
65 typedef struct
66 {
67  GtkWindowClass gtk_window;
70  /* callbacks */
71  void (*page_added) (GncMainWindow *window,
72  GncPluginPage *page);
73  void (*page_changed) (GncMainWindow *window,
74  GncPluginPage *page);
76 
77 typedef struct
78 {
79  GncMainWindow *window;
80  gpointer data;
82 
83 typedef void (*GncMainWindowFunc) (GncMainWindow *window, GncPluginPage *page);
84 typedef void (*GncMainWindowPageFunc) (GncPluginPage *page, gpointer user_data);
85 
86 /* function prototypes */
87 
92 GType gnc_main_window_get_type (void);
93 
94 
100 
101 
108 
109 
123  GncPluginPage *page);
124 
125 
134 
135 
136 /* Iterator function to walk all pages in all windows, calling the
137  * specified function for each page.
138  *
139  * @param entry A pointer to the function to be called.
140  *
141  * @param user_data A data pointer passed to each call of the function.
142  */
143 void gnc_main_window_foreach_page (GncMainWindowPageFunc fn,
144  gpointer user_data);
145 
146 
162 
163 
166 GtkUIManager *gnc_main_window_get_uimanager (GncMainWindow *window);
167 
168 
174 void
176  const gchar *name_in);
177 
178 
184 void
186  const gchar *color_in);
187 
194 void
196  gboolean read_only);
197 
217  const gchar *group_name,
218  GtkActionGroup *group,
219  guint merge_id);
220 
221 
252  const gchar *group_name,
253  GtkActionEntry *entries,
254  guint n_entries,
255  GtkToggleActionEntry *toggle_entries,
256  guint n_toggle_entries,
257  const gchar *filename,
258  gpointer user_data);
259 
260 
273  const gchar *group_name);
274 
275 
287 
288 
302 GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
303  const gchar *group_name);
304 
305 
313 
314 
332 gboolean gnc_main_window_button_press_cb (GtkWidget *whatever,
333  GdkEventButton *event,
334  GncPluginPage *page);
335 
336 
350 gboolean gnc_main_window_popup_menu_cb (GtkWidget *widget,
351  GncPluginPage *page);
352 
353 
358 void gnc_main_window_restore_all_windows(const GKeyFile *keyfile);
359 
369 
374 void gnc_main_window_save_all_windows(GKeyFile *keyfile);
375 
379 
380 
391 
392 
401 gboolean gnc_main_window_all_finish_pending (void);
402 
411 void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
412 
423 GtkAction *gnc_main_window_find_action (GncMainWindow *window, const gchar *name);
424 
429 
443 GtkWidget *gnc_book_options_dialog_cb (gboolean modal, gchar *title,
444  GtkWindow *parent);
445 
457 gboolean gnc_book_options_dialog_apply_helper(GNCOptionDB * options);
458 
459 #endif /* __GNC_MAIN_WINDOW_H */
460 
void gnc_main_window_restore_all_windows(const GKeyFile *keyfile)
Restore the persistent state of all windows.
GtkWindowClass gtk_window
The parent class for a main window.
The instance data structure for a content plugin.
gboolean gnc_main_window_button_press_cb(GtkWidget *whatever, GdkEventButton *event, GncPluginPage *page)
Callback function invoked when the user clicks in the content of any Gnucash window.
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)
Add a set of actions to the specified window.
gboolean gnc_book_options_dialog_apply_helper(GNCOptionDB *options)
Processes selected options in the Book Options dialog: checks book_currency and use_split_action_for_...
gboolean gnc_main_window_is_restoring_pages(GncMainWindow *window)
Check if the main window is restoring the plugin pages.
GtkWidget * gnc_book_options_dialog_cb(gboolean modal, gchar *title, GtkWindow *parent)
Opens the Book Options dialog.
void gnc_main_window_unmerge_actions(GncMainWindow *window, const gchar *group_name)
Remove a set of actions from the specified window.
void gnc_main_window_show_all_windows(void)
Shows all main windows.
void gnc_main_window_display_page(GncPluginPage *page)
Bring the window containing the specified page to the top of the window stack, then switch the notebo...
void gnc_main_window_save_all_windows(GKeyFile *keyfile)
Save the persistent state of all windows.
GncPluginPage * gnc_main_window_get_current_page(GncMainWindow *window)
Retrieve a pointer to the page that is currently at the front of the specified window.
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Display a data plugin page in a window.
void gnc_main_window_all_action_set_sensitive(const gchar *action_name, gboolean sensitive)
Change the sensitivity of a command in all windows.
void main_window_update_page_color(GncPluginPage *page, const gchar *color_in)
Update the color on the page tabs in the main window.
gboolean just_plugin_prefs
Just remove preferences only from plugins.
GType gnc_main_window_get_type(void)
Get the type of a gnc main window.
GtkUIManager * ui_merge
A pointer to the UI Manager data structure for the whole window.
gboolean gnc_main_window_popup_menu_cb(GtkWidget *widget, GncPluginPage *page)
Callback function invoked when the user requests that Gnucash popup the contextual menu via the keybo...
Functions for adding plugins to a GnuCash window.
gboolean window_quitting
Set to TRUE when quitting from this window.
gboolean gnc_main_window_finish_pending(GncMainWindow *window)
Tell a window to finish any outstanding activities.
GtkActionGroup * gnc_main_window_get_action_group(GncMainWindow *window, const gchar *group_name)
Retrieve a specific set of user interface actions from a window.
void main_window_update_page_set_read_only_icon(GncPluginPage *page, gboolean read_only)
Update the icon on the page tabs in the main window.
GncMainWindow * gnc_main_window_new(void)
Create a new gnc main window plugin.
void gnc_main_window_manual_merge_actions(GncMainWindow *window, const gchar *group_name, GtkActionGroup *group, guint merge_id)
Manually add a set of actions to the specified window.
void gnc_main_window_close_page(GncPluginPage *page)
Remove a data plugin page from a window and display the previous page.
GtkWindow gtk_window
The parent object for a main window.
The instance data structure for a main window object.
void gnc_main_window_restore_default_state(GncMainWindow *window)
Restore the persistent state of one window to a sane default.
The class data structure for a main window object.
gboolean gnc_main_window_all_finish_pending(void)
Tell all pages in all windows to finish any outstanding activities.
void gnc_main_window_actions_updated(GncMainWindow *window)
Force a full update of the user interface for the specified window.
void main_window_update_page_name(GncPluginPage *page, const gchar *name_in)
Update the name of the page in the main window.
GtkUIManager * gnc_main_window_get_uimanager(GncMainWindow *window)
Returns the pointer to the GtkUIManager which is used for the menu item merging.
GtkAction * gnc_main_window_find_action(GncMainWindow *window, const gchar *name)
Find action in main window.
void gnc_main_window_set_progressbar_window(GncMainWindow *window)
Set the window where all progressbar updates should occur.