|
GnuCash 2.4.99
|
00001 /* 00002 * gnc-main-window.h -- GtkWindow which represents the 00003 * GnuCash main window. 00004 * 00005 * Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de> 00006 * Copyright (C) 2003,2005 David Hampton <hampton@employees.org> 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, contact: 00020 * 00021 * Free Software Foundation Voice: +1-617-542-5942 00022 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 00023 * Boston, MA 02110-1301, USA gnu@gnu.org 00024 */ 00025 00036 #ifndef __GNC_MAIN_WINDOW_H 00037 #define __GNC_MAIN_WINDOW_H 00038 00039 #include <gtk/gtk.h> 00040 #include "gnc-plugin-page.h" 00041 00042 /* type macros */ 00043 #define GNC_TYPE_MAIN_WINDOW (gnc_main_window_get_type ()) 00044 #define GNC_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow)) 00045 #define GNC_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass)) 00046 #define GNC_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_MAIN_WINDOW)) 00047 #define GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW)) 00048 #define GNC_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass)) 00049 00050 #define PLUGIN_PAGE_IMMUTABLE "page-immutable" 00051 00052 /* typedefs & structures */ 00053 00055 typedef struct GncMainWindow 00056 { 00057 GtkWindow gtk_window; 00058 GtkUIManager *ui_merge; 00060 } GncMainWindow; 00061 00063 typedef struct 00064 { 00065 GtkWindowClass gtk_window; 00068 /* callbacks */ 00069 void (*page_added) (GncMainWindow *window, 00070 GncPluginPage *page); 00071 void (*page_changed) (GncMainWindow *window, 00072 GncPluginPage *page); 00073 } GncMainWindowClass; 00074 00075 typedef struct 00076 { 00077 GncMainWindow *window; 00078 gpointer data; 00079 } GncMainWindowActionData; 00080 00081 typedef void (*GncMainWindowFunc) (GncMainWindow *window, GncPluginPage *page); 00082 typedef void (*GncMainWindowPageFunc) (GncPluginPage *page, gpointer user_data); 00083 00084 /* function prototypes */ 00085 00090 GType gnc_main_window_get_type (void); 00091 00092 00097 GncMainWindow *gnc_main_window_new (void); 00098 00099 00105 void gnc_main_window_display_page (GncPluginPage *page); 00106 00107 00120 void gnc_main_window_open_page (GncMainWindow *window, 00121 GncPluginPage *page); 00122 00123 00131 void gnc_main_window_close_page (GncPluginPage *page); 00132 00133 00134 /* Iterator function to walk all pages in all windows, calling the 00135 * specified function for each page. 00136 * 00137 * @param entry A pointer to the function to be called. 00138 * 00139 * @param user_data A data pointer passed to each call of the function. 00140 */ 00141 void gnc_main_window_foreach_page (GncMainWindowPageFunc fn, 00142 gpointer user_data); 00143 00144 00159 GncPluginPage *gnc_main_window_get_current_page (GncMainWindow *window); 00160 00161 00164 GtkUIManager *gnc_main_window_get_uimanager (GncMainWindow *window); 00165 00166 00172 void 00173 main_window_update_page_name (GncPluginPage *page, 00174 const gchar *name_in); 00175 00176 00182 void 00183 main_window_update_page_color (GncPluginPage *page, 00184 const gchar *color_in); 00185 00186 00205 void gnc_main_window_manual_merge_actions (GncMainWindow *window, 00206 const gchar *group_name, 00207 GtkActionGroup *group, 00208 guint merge_id); 00209 00210 00240 void gnc_main_window_merge_actions (GncMainWindow *window, 00241 const gchar *group_name, 00242 GtkActionEntry *entries, 00243 guint n_entries, 00244 GtkToggleActionEntry *toggle_entries, 00245 guint n_toggle_entries, 00246 const gchar *filename, 00247 gpointer user_data); 00248 00249 00261 void gnc_main_window_unmerge_actions (GncMainWindow *window, 00262 const gchar *group_name); 00263 00264 00275 void gnc_main_window_actions_updated (GncMainWindow *window); 00276 00277 00291 GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window, 00292 const gchar *group_name); 00293 00294 00301 void gnc_main_window_set_progressbar_window( GncMainWindow *window ); 00302 00303 00321 gboolean gnc_main_window_button_press_cb (GtkWidget *whatever, 00322 GdkEventButton *event, 00323 GncPluginPage *page); 00324 00329 void gnc_main_window_restore_all_windows(const GKeyFile *keyfile); 00330 00335 void gnc_main_window_save_all_windows(GKeyFile *keyfile); 00336 00339 void gnc_main_window_restore_default_state(void); 00340 00359 void 00360 gnc_gtk_action_group_set_translation_domain (GtkActionGroup *action_group, 00361 const gchar *domain); 00362 00363 00373 gboolean gnc_main_window_finish_pending (GncMainWindow *window); 00374 00375 00384 gboolean gnc_main_window_all_finish_pending (void); 00385 00394 void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive); 00395 00406 GtkAction *gnc_main_window_find_action (GncMainWindow *window, const gchar *name); 00407 00411 void gnc_main_window_show_all_windows(void); 00412 00413 #endif /* __GNC_MAIN_WINDOW_H */ 00414
1.7.4