GnuCash  5.6-150-g038405b370+
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 G_DECLARE_FINAL_TYPE (GncTreeModelAccount, gnc_tree_model_account, GNC, TREE_MODEL_ACCOUNT, GncTreeModel)
49 #define GNC_TREE_MODEL_ACCOUNT_NAME "GncTreeModelAccount"
50 
51 typedef enum
52 {
53  GNC_TREE_MODEL_ACCOUNT_COL_NAME,
54  GNC_TREE_MODEL_ACCOUNT_COL_TYPE,
55  GNC_TREE_MODEL_ACCOUNT_COL_COMMODITY,
56  GNC_TREE_MODEL_ACCOUNT_COL_CODE,
57  GNC_TREE_MODEL_ACCOUNT_COL_DESCRIPTION,
58  GNC_TREE_MODEL_ACCOUNT_COL_LASTNUM,
59  GNC_TREE_MODEL_ACCOUNT_COL_PRESENT,
60  GNC_TREE_MODEL_ACCOUNT_COL_PRESENT_REPORT,
61  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE,
62  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_REPORT,
63  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_PERIOD,
64  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_LIMIT,
65  GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_LIMIT_EXPLANATION,
66  GNC_TREE_MODEL_ACCOUNT_COL_CLEARED,
67  GNC_TREE_MODEL_ACCOUNT_COL_CLEARED_REPORT,
68  GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED,
69  GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_REPORT,
70  GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_DATE,
71  GNC_TREE_MODEL_ACCOUNT_COL_FUTURE_MIN,
72  GNC_TREE_MODEL_ACCOUNT_COL_FUTURE_MIN_REPORT,
73  GNC_TREE_MODEL_ACCOUNT_COL_TOTAL,
74  GNC_TREE_MODEL_ACCOUNT_COL_TOTAL_REPORT,
75  GNC_TREE_MODEL_ACCOUNT_COL_TOTAL_PERIOD,
76  GNC_TREE_MODEL_ACCOUNT_COL_NOTES,
77  GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO,
78  GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO_SUB_ACCT,
79  GNC_TREE_MODEL_ACCOUNT_COL_HIDDEN,
80  GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
81  GNC_TREE_MODEL_ACCOUNT_COL_OPENING_BALANCE,
82 
83  GNC_TREE_MODEL_ACCOUNT_COL_LAST_VISIBLE = GNC_TREE_MODEL_ACCOUNT_COL_OPENING_BALANCE,
84 
85  /* internal hidden columns */
86  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_PRESENT,
87  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_ACCOUNT,
88  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE,
89  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE_PERIOD,
90  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_CLEARED,
91  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_RECONCILED,
92  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_FUTURE_MIN,
93  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL,
94  GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL_PERIOD,
95 
96  GNC_TREE_MODEL_ACCOUNT_NUM_COLUMNS
97 } GncTreeModelAccountColumn;
98 
103 void gnc_tree_model_account_clear_cache (GncTreeModelAccount *model);
104 
112 GtkTreeModel *gnc_tree_model_account_new (Account *root);
131 Account *gnc_tree_model_account_get_account (GncTreeModelAccount *model,
132  GtkTreeIter *iter);
133 
134 
151 gboolean gnc_tree_model_account_get_iter_from_account (GncTreeModelAccount *model,
152  Account *account,
153  GtkTreeIter *iter);
154 
155 
169 GtkTreePath *gnc_tree_model_account_get_path_from_account (GncTreeModelAccount *model,
170  Account *account);
173 G_END_DECLS
174 
175 #endif /* __GNC_TREE_MODEL_ACCOUNT_H */
176 
STRUCTS.
Account * gnc_tree_model_account_get_account(GncTreeModelAccount *model, GtkTreeIter *iter)
Convert a model/iter pair to a gnucash account.
GtkTreeModel implementation for a generic gnucash tree.
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.
GtkTreePath * gnc_tree_model_account_get_path_from_account(GncTreeModelAccount *model, Account *account)
Convert a model/account pair into a gtk_tree_model_path.