GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 <[email protected]>
6  * Copyright (C) 2003 David Hampton <[email protected]>
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 [email protected]
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_PLACEHOLDER,
83 
84  GNC_TREE_MODEL_ACCOUNT_COL_LAST_VISIBLE = GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
85 
86  /* internal hidden columns */
87  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_PRESENT,
88  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_ACCOUNT,
89  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE,
90  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE_PERIOD,
91  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_CLEARED,
92  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_RECONCILED,
93  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_FUTURE_MIN,
94  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL,
95  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL_PERIOD,
96 
97  GNC_TREE_MODEL_ACCOUNT_NUM_COLUMNS
98 } GncTreeModelAccountColumn;
99 
100 /* typedefs & structures */
101 
103 typedef struct
104 {
106  int stamp;
109 
110 
112 typedef struct
113 {
116 
117 
118 
124 
125 
133 GtkTreeModel *gnc_tree_model_account_new (Account *root);
153  GtkTreeIter *iter);
154 
155 
173  Account *account,
174  GtkTreeIter *iter);
175 
176 
191  Account *account);
194 G_END_DECLS
195 
196 #endif /* __GNC_TREE_MODEL_ACCOUNT_H */
197 
Account * gnc_tree_model_account_get_account(GncTreeModelAccount *model, GtkTreeIter *iter)
GtkTreeModel implementation for a generic gnucash tree.
gboolean gnc_tree_model_account_get_iter_from_account(GncTreeModelAccount *model, Account *account, GtkTreeIter *iter)
Account handling public routines.
GtkTreeModel * gnc_tree_model_account_new(Account *root)
GtkTreePath * gnc_tree_model_account_get_path_from_account(GncTreeModelAccount *model, Account *account)
GType gnc_tree_model_account_get_type(void)