GnuCash 2.4.99
gnc-plugin-page.h
Go to the documentation of this file.
00001 /*
00002  * gnc-plugin-page.h -- A page, which can be added to 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_PLUGIN_PAGE_H
00037 #define __GNC_PLUGIN_PAGE_H
00038 
00039 #include <glib.h>
00040 #include "qof.h"
00041 
00042 G_BEGIN_DECLS
00043 
00044 #define KEY_SUMMARYBAR_POSITION "summarybar_position"
00045 
00046 /* type macros */
00047 #define GNC_TYPE_PLUGIN_PAGE            (gnc_plugin_page_get_type ())
00048 #define GNC_PLUGIN_PAGE(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPage))
00049 #define GNC_PLUGIN_PAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE, GncPluginPageClass))
00050 #define GNC_IS_PLUGIN_PAGE(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN_PAGE))
00051 #define GNC_IS_PLUGIN_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE))
00052 #define GNC_PLUGIN_PAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN_PAGE, GncPluginPageClass))
00053 
00054 /* typedefs & structures */
00055 
00057 typedef struct GncPluginPage
00058 {
00059     GObject gobject;            
00061     GtkWidget *window;          
00066     GtkWidget *notebook_page;   
00070     GtkWidget *summarybar;              
00075 } GncPluginPage;
00076 
00077 
00079 typedef struct
00080 {
00081     GObjectClass gobject;
00082 
00085     const gchar *tab_icon;
00087     const gchar *plugin_name;
00088 
00089     /* Signals */
00090     void (* inserted) (GncPluginPage *plugin_page);
00091     void (* removed) (GncPluginPage *plugin_page);
00092     void (* selected) (GncPluginPage *plugin_page);
00093     void (* unselected) (GncPluginPage *plugin_page);
00094 
00095     /* Virtual Table */
00096 
00106     GtkWidget *(* create_widget) (GncPluginPage *plugin_page);
00112     void (* destroy_widget) (GncPluginPage *plugin_page);
00113 
00124     void (* save_page) (GncPluginPage *page, GKeyFile *file,
00125                         const gchar *group);
00126 
00144     GncPluginPage * (* recreate_page) (GtkWidget *window, GKeyFile *file,
00145                                        const gchar *group);
00146 
00156     void (* window_changed) (GncPluginPage *plugin_page, GtkWidget *window);
00157 
00164     void (* page_name_changed) (GncPluginPage *plugin_page,
00165                                 const gchar *name);
00166 
00175     void (* update_edit_menu_actions) (GncPluginPage *plugin_page, gboolean hide);
00176 
00186     gboolean (* finish_pending) (GncPluginPage *plugin_page);
00187 } GncPluginPageClass;
00188 
00189 
00194 GType gnc_plugin_page_get_type (void);
00195 
00196 
00207 GtkWidget *gnc_plugin_page_create_widget (GncPluginPage *plugin_page);
00208 
00209 
00216 void gnc_plugin_page_destroy_widget (GncPluginPage *plugin_page);
00217 
00218 
00225 void gnc_plugin_page_show_summarybar (GncPluginPage *page, gboolean visible);
00226 
00227 
00239 void gnc_plugin_page_save_page (GncPluginPage *page,
00240                                 GKeyFile *key_file,
00241                                 const gchar *group_name);
00242 
00243 
00256 GncPluginPage *gnc_plugin_page_recreate_page (GtkWidget *window,
00257         const gchar *page_type,
00258         GKeyFile *key_file,
00259         const gchar *group_name);
00260 
00261 
00269 void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page,
00270                                     GtkUIManager *merge);
00271 
00272 
00280 void gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page,
00281                                       GtkUIManager *merge);
00282 
00283 
00291 const gchar *gnc_plugin_page_get_plugin_name (GncPluginPage *plugin_page);
00292 
00293 
00300 void gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book);
00301 
00302 
00314 gboolean gnc_plugin_page_has_book (GncPluginPage *page, QofBook *book);
00315 
00316 
00323 gboolean gnc_plugin_page_has_books (GncPluginPage *page);
00324 
00325 
00333 GtkWidget *gnc_plugin_page_get_window (GncPluginPage *page);
00334 
00335 
00344 const gchar *gnc_plugin_page_get_page_name (GncPluginPage *page);
00345 
00346 
00354 void gnc_plugin_page_set_page_name (GncPluginPage *page, const char *name);
00355 
00356 
00366 const gchar *gnc_plugin_page_get_page_long_name (GncPluginPage *page);
00367 
00368 
00376 void gnc_plugin_page_set_page_long_name (GncPluginPage *page, const char *name);
00377 
00378 
00387 const gchar *gnc_plugin_page_get_page_color (GncPluginPage *page);
00388 
00389 
00398 void gnc_plugin_page_set_page_color (GncPluginPage *page, const char *color);
00399 
00400 
00408 const gchar *gnc_plugin_page_get_uri (GncPluginPage *page);
00409 
00410 
00417 void gnc_plugin_page_set_uri (GncPluginPage *page, const char *name);
00418 
00419 
00427 const gchar *gnc_plugin_page_get_statusbar_text (GncPluginPage *page);
00428 
00429 
00436 void gnc_plugin_page_set_statusbar_text (GncPluginPage *page,
00437         const char *name);
00438 
00439 
00446 gboolean gnc_plugin_page_get_use_new_window (GncPluginPage *page);
00447 
00448 
00458 void gnc_plugin_page_set_use_new_window (GncPluginPage *page,
00459         gboolean use_new);
00460 
00461 
00469 const char *gnc_plugin_page_get_ui_description (GncPluginPage *page);
00470 
00471 
00482 void gnc_plugin_page_set_ui_description (GncPluginPage *page,
00483         const char *ui_filename);
00484 
00485 
00491 GtkUIManager *gnc_plugin_page_get_ui_merge (GncPluginPage *page);
00492 
00493 
00500 GtkActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page);
00501 
00502 
00514 GtkActionGroup * gnc_plugin_page_create_action_group (GncPluginPage *page,
00515         const gchar *group_name);
00516 
00525 GtkAction *gnc_plugin_page_get_action (GncPluginPage *page, const gchar *name);
00526 
00527 /* Signals */
00528 void gnc_plugin_page_inserted (GncPluginPage *plugin_page);
00529 void gnc_plugin_page_removed (GncPluginPage *plugin_page);
00530 void gnc_plugin_page_selected (GncPluginPage *plugin_page);
00531 void gnc_plugin_page_unselected (GncPluginPage *plugin_page);
00532 
00539 gboolean gnc_plugin_page_finish_pending (GncPluginPage *plugin_page);
00540 
00541 G_END_DECLS
00542 
00543 #endif /* __GNC_PLUGIN_PAGE_H */
00544 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines