gnc-main-window.h

Go to the documentation of this file.
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         GtkWindow gtk_window;   
00057         GtkUIManager *ui_merge; 
00059 } GncMainWindow;
00060 
00062 typedef struct {
00063         GtkWindowClass gtk_window;      
00066         /* callbacks */
00067         void (*page_added)   (GncMainWindow *window,
00068                               GncPluginPage *page);
00069         void (*page_changed) (GncMainWindow *window,
00070                               GncPluginPage *page);
00071 } GncMainWindowClass;
00072 
00073 typedef struct {
00074         GncMainWindow *window;
00075         gpointer data;
00076 } GncMainWindowActionData;
00077 
00078 typedef void (*GncMainWindowFunc) (GncMainWindow *window, GncPluginPage *page);
00079 typedef void (*GncMainWindowPageFunc) (GncPluginPage *page, gpointer user_data);
00080 
00081 /* function prototypes */
00082 
00087 GType gnc_main_window_get_type (void);
00088 
00089 
00094 GncMainWindow *gnc_main_window_new (void);
00095 
00096 
00102 void gnc_main_window_display_page (GncPluginPage *page);
00103 
00104 
00117 void gnc_main_window_open_page (GncMainWindow *window,
00118                                 GncPluginPage *page);
00119 
00120 
00128 void gnc_main_window_close_page (GncPluginPage *page);
00129 
00130 
00131 /*  Iterator function to walk all pages in all windows, calling the
00132  *  specified function for each page.
00133  *
00134  *  @param entry A pointer to the function to be called.
00135  *
00136  *  @param user_data A data pointer passed to each call of the function.
00137  */
00138 void gnc_main_window_foreach_page (GncMainWindowPageFunc fn,
00139                                    gpointer user_data);
00140 
00141 
00156 GncPluginPage *gnc_main_window_get_current_page (GncMainWindow *window);
00157 
00158 
00159 void
00160 main_window_update_page_name (GncPluginPage *page,
00161                               const gchar *name_in);
00162 
00181 void gnc_main_window_manual_merge_actions (GncMainWindow *window,
00182                                            const gchar *group_name,
00183                                            GtkActionGroup *group,
00184                                            guint merge_id);
00185 
00186 
00211 void gnc_main_window_merge_actions (GncMainWindow *window,
00212                                     const gchar *group_name,
00213                                     GtkActionEntry *entries,
00214                                     guint n_entries,
00215                                     const gchar *filename,
00216                                     gpointer user_data);
00217 
00218 
00230 void gnc_main_window_unmerge_actions (GncMainWindow *window,
00231                                       const gchar *group_name);
00232 
00233 
00244 void gnc_main_window_actions_updated (GncMainWindow *window);
00245 
00246 
00260 GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
00261                                                   const gchar *group_name);
00262 
00263 
00270 void gnc_main_window_set_progressbar_window( GncMainWindow *window );
00271 
00272 
00290 gboolean gnc_main_window_button_press_cb (GtkWidget *whatever,
00291                                           GdkEventButton *event,
00292                                           GncPluginPage *page);
00293 
00298 void gnc_main_window_restore_all_windows(const GKeyFile *keyfile);
00299 
00304 void gnc_main_window_save_all_windows(GKeyFile *keyfile);
00305 
00308 void gnc_main_window_restore_default_state(void);
00309 
00328 void 
00329 gnc_gtk_action_group_set_translation_domain (GtkActionGroup *action_group,
00330                                              const gchar    *domain);
00331 
00332 
00342 gboolean gnc_main_window_finish_pending (GncMainWindow *window);
00343 
00344 
00355 gboolean gnc_main_window_all_finish_pending (void);
00356 
00365 void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
00366 
00370 void gnc_main_window_show_all_windows(void);
00371 
00372 #endif /* __GNC_MAIN_WINDOW_H */
00373 

Generated on Sun Oct 12 05:07:17 2008 for GnuCash by  doxygen 1.5.2