GnuCash  4.11-148-gc20d717b33+
gnc-tree-model-account.h
Go to the documentation of this file.
1 /*
2  * gnc-tree-model-account.h -- GtkTreeModel implementation to
3  * display accounts in a GtkTreeView.
4  *
5  * Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de>
6  * Copyright (C) 2003 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_TREE_MODEL_ACCOUNT_H
37 #define __GNC_TREE_MODEL_ACCOUNT_H
38 
39 #include <gtk/gtk.h>
40 #include "gnc-tree-model.h"
41 
42 #include "Account.h"
43 
44 G_BEGIN_DECLS
45 
46 /* type macros */
47 #define GNC_TYPE_TREE_MODEL_ACCOUNT (gnc_tree_model_account_get_type ())
48 #define GNC_TREE_MODEL_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccount))
49 #define GNC_TREE_MODEL_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccountClass))
50 #define GNC_IS_TREE_MODEL_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_ACCOUNT))
51 #define GNC_IS_TREE_MODEL_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_ACCOUNT))
52 #define GNC_TREE_MODEL_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccountClass))
53 #define GNC_TREE_MODEL_ACCOUNT_NAME "GncTreeModelAccount"
54 
55 
56 typedef enum
57 {
58  GNC_TREE_MODEL_ACCOUNT_COL_NAME,
59  GNC_TREE_MODEL_ACCOUNT_COL_TYPE,
60  GNC_TREE_MODEL_ACCOUNT_COL_COMMODITY,
61  GNC_TREE_MODEL_ACCOUNT_COL_CODE,
62  GNC_TREE_MODEL_ACCOUNT_COL_DESCRIPTION,
63  GNC_TREE_MODEL_ACCOUNT_COL_LASTNUM,
64  GNC_TREE_MODEL_ACCOUNT_COL_PRESENT,
65  GNC_TREE_MODEL_ACCOUNT_COL_PRESENT_REPORT,
66  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE,
67  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_REPORT,
68  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_PERIOD,
69  GNC_TREE_MODEL_ACCOUNT_COL_CLEARED,
70  GNC_TREE_MODEL_ACCOUNT_COL_CLEARED_REPORT,
71  GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED,
72  GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_REPORT,
73  GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_DATE,
74  GNC_TREE_MODEL_ACCOUNT_COL_FUTURE_MIN,
75  GNC_TREE_MODEL_ACCOUNT_COL_FUTURE_MIN_REPORT,
76  GNC_TREE_MODEL_ACCOUNT_COL_TOTAL,
77  GNC_TREE_MODEL_ACCOUNT_COL_TOTAL_REPORT,
78  GNC_TREE_MODEL_ACCOUNT_COL_TOTAL_PERIOD,
79  GNC_TREE_MODEL_ACCOUNT_COL_NOTES,
80  GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO,
81  GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO_SUB_ACCT,
82  GNC_TREE_MODEL_ACCOUNT_COL_HIDDEN,
83  GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
84  GNC_TREE_MODEL_ACCOUNT_COL_OPENING_BALANCE,
85 
86  GNC_TREE_MODEL_ACCOUNT_COL_LAST_VISIBLE = GNC_TREE_MODEL_ACCOUNT_COL_OPENING_BALANCE,
87 
88  /* internal hidden columns */
89  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_PRESENT,
90  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_ACCOUNT,
91  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE,
92  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE_PERIOD,
93  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_CLEARED,
94  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_RECONCILED,
95  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_FUTURE_MIN,
96  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL,
97  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL_PERIOD,
98 
99  GNC_TREE_MODEL_ACCOUNT_NUM_COLUMNS
100 } GncTreeModelAccountColumn;
101 
102 /* typedefs & structures */
103 
105 typedef struct
106 {
108  int stamp;
111 
112 
114 typedef struct
115 {
118 
119 
120 
126 
132 
140 GtkTreeModel *gnc_tree_model_account_new (Account *root);
160  GtkTreeIter *iter);
161 
162 
180  Account *account,
181  GtkTreeIter *iter);
182 
183 
198  Account *account);
201 G_END_DECLS
202 
203 #endif /* __GNC_TREE_MODEL_ACCOUNT_H */
204 
The class data structure for an account tree model.
Account * gnc_tree_model_account_get_account(GncTreeModelAccount *model, GtkTreeIter *iter)
Convert a model/iter pair to a gnucash account.
The instance data structure for a generic tree model.
The class data structure for a generic tree model.
GtkTreeModel implementation for a generic gnucash tree.
GncTreeModelClass gnc_tree_model
The parent object data.
gboolean gnc_tree_model_account_get_iter_from_account(GncTreeModelAccount *model, Account *account, GtkTreeIter *iter)
Convert a model/account pair into a gtk_tree_model_iter.
void gnc_tree_model_account_clear_cache(GncTreeModelAccount *model)
Clear the tree model account cached values.
Account handling public routines.
GtkTreeModel * gnc_tree_model_account_new(Account *root)
Create a new GtkTreeModel for manipulating gnucash accounts.
GncTreeModel gnc_tree_model
The parent object data.
GtkTreePath * gnc_tree_model_account_get_path_from_account(GncTreeModelAccount *model, Account *account)
Convert a model/account pair into a gtk_tree_model_path.
The instance data structure for an account tree model.
int stamp
The state of the model.
GType gnc_tree_model_account_get_type(void)
Get the type of an account tree plugin.