GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-account-sel.h
1 
13 /* GnuCash is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Library General Public License as
15  * published by the Free Software Foundation; either version 2 of
16  * the License, or (at your option) any later version.
17  *
18  * Gnucash is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, contact:
25  *
26  * Free Software Foundation Voice: +1-617-542-5942
27  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
28  * Boston, MA 02110-1301, USA [email protected]
29  */
30 
31 #ifndef GNC_ACCOUNT_SEL_H
32 #define GNC_ACCOUNT_SEL_H
33 
34 #include "Account.h"
35 
36 #define GNC_TYPE_ACCOUNT_SEL (gnc_account_sel_get_type())
37 #define GNC_ACCOUNT_SEL(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, GNC_TYPE_ACCOUNT_SEL, GNCAccountSel)
38 #define GNC_ACCOUNT_SEL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, GNC_TYPE_ACCOUNT_SEL, GNCAccountSelClass)
39 #define GNC_IS_ACCOUNT_SEL(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, GNC_TYPE_ACCOUNT_SEL)
40 
41 typedef struct
42 {
43  GtkHBox hbox;
44  gboolean initDone;
45  gboolean isModal;
46  GtkListStore *store;
47  GtkComboBox *combo;
48  GList *acctTypeFilters;
49  GList *acctCommodityFilters;
50  gint eventHandlerId;
51  /* The state of this pointer also serves as a flag about what state
52  * the widget is in WRT the new-account-button ability. */
53  GtkWidget *newAccountButton;
54 
55 #if 0 /* completion not implemented. */
56  GCompletion *completion;
57 #endif /* 0 - completion not implemented */
59 
60 typedef struct
61 {
62  GtkHBoxClass parent_class;
63 
64  /* Signals for notification/filtering of changes */
65  void (*account_sel_changed) (GNCAccountSel *gas);
67 
68 GType gnc_account_sel_get_type (void);
69 GtkWidget* gnc_account_sel_new (void);
70 
76 void gnc_account_sel_set_account( GNCAccountSel *gas, Account *acct, gboolean set_default_acct );
81 Account* gnc_account_sel_get_account( GNCAccountSel *gas );
82 
89 void gnc_account_sel_set_acct_filters( GNCAccountSel *gas, GList *typeFilters, GList *commodityFilters );
90 
96 void gnc_account_sel_set_new_account_ability( GNCAccountSel *gas,
97  gboolean state );
98 
103 void gnc_account_sel_set_new_account_modal( GNCAccountSel *gas,
104  gboolean state );
105 
106 gint gnc_account_sel_get_num_account( GNCAccountSel *gas );
107 void gnc_account_sel_purge_account( GNCAccountSel *gas, Account *acc, gboolean recursive);
108 
109 #endif /* !ndef GNC_ACCOUNT_SEL_H */
Account handling public routines.