GnuCash 2.4.99
gnc-tree-model-account.h
Go to the documentation of this file.
00001 /*
00002  * gnc-tree-model-account.h -- GtkTreeModel implementation to
00003  *      display accounts in a GtkTreeView.
00004  *
00005  * Copyright (C) 2003 Jan Arne Petersen <jpetersen@uni-bonn.de>
00006  * Copyright (C) 2003 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_TREE_MODEL_ACCOUNT_H
00037 #define __GNC_TREE_MODEL_ACCOUNT_H
00038 
00039 #include <gtk/gtk.h>
00040 #include "gnc-tree-model.h"
00041 
00042 #include "Account.h"
00043 
00044 G_BEGIN_DECLS
00045 
00046 /* type macros */
00047 #define GNC_TYPE_TREE_MODEL_ACCOUNT            (gnc_tree_model_account_get_type ())
00048 #define GNC_TREE_MODEL_ACCOUNT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccount))
00049 #define GNC_TREE_MODEL_ACCOUNT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccountClass))
00050 #define GNC_IS_TREE_MODEL_ACCOUNT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_ACCOUNT))
00051 #define GNC_IS_TREE_MODEL_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_ACCOUNT))
00052 #define GNC_TREE_MODEL_ACCOUNT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccountClass))
00053 #define GNC_TREE_MODEL_ACCOUNT_NAME            "GncTreeModelAccount"
00054 
00055 
00056 typedef enum
00057 {
00058     GNC_TREE_MODEL_ACCOUNT_COL_NAME,
00059     GNC_TREE_MODEL_ACCOUNT_COL_TYPE,
00060     GNC_TREE_MODEL_ACCOUNT_COL_COMMODITY,
00061     GNC_TREE_MODEL_ACCOUNT_COL_CODE,
00062     GNC_TREE_MODEL_ACCOUNT_COL_DESCRIPTION,
00063     GNC_TREE_MODEL_ACCOUNT_COL_LASTNUM,
00064     GNC_TREE_MODEL_ACCOUNT_COL_PRESENT,
00065     GNC_TREE_MODEL_ACCOUNT_COL_PRESENT_REPORT,
00066     GNC_TREE_MODEL_ACCOUNT_COL_BALANCE,
00067     GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_REPORT,
00068     GNC_TREE_MODEL_ACCOUNT_COL_BALANCE_PERIOD,
00069     GNC_TREE_MODEL_ACCOUNT_COL_CLEARED,
00070     GNC_TREE_MODEL_ACCOUNT_COL_CLEARED_REPORT,
00071     GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED,
00072     GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_REPORT,
00073     GNC_TREE_MODEL_ACCOUNT_COL_RECONCILED_DATE,
00074     GNC_TREE_MODEL_ACCOUNT_COL_FUTURE_MIN,
00075     GNC_TREE_MODEL_ACCOUNT_COL_FUTURE_MIN_REPORT,
00076     GNC_TREE_MODEL_ACCOUNT_COL_TOTAL,
00077     GNC_TREE_MODEL_ACCOUNT_COL_TOTAL_REPORT,
00078     GNC_TREE_MODEL_ACCOUNT_COL_TOTAL_PERIOD,
00079     GNC_TREE_MODEL_ACCOUNT_COL_NOTES,
00080     GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO,
00081     GNC_TREE_MODEL_ACCOUNT_COL_TAX_INFO_SUB_ACCT,
00082     GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
00083 
00084     GNC_TREE_MODEL_ACCOUNT_COL_LAST_VISIBLE = GNC_TREE_MODEL_ACCOUNT_COL_PLACEHOLDER,
00085 
00086     /* internal hidden columns */
00087     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_PRESENT,
00088     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE,
00089     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_BALANCE_PERIOD,
00090     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_CLEARED,
00091     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_RECONCILED,
00092     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_FUTURE_MIN,
00093     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL,
00094     GNC_TREE_MODEL_ACCOUNT_COL_COLOR_TOTAL_PERIOD,
00095 
00096     GNC_TREE_MODEL_ACCOUNT_NUM_COLUMNS
00097 } GncTreeModelAccountColumn;
00098 
00099 /* typedefs & structures */
00100 
00102 typedef struct
00103 {
00104     GncTreeModel gnc_tree_model;    
00105     int stamp;                      
00107 } GncTreeModelAccount;
00108 
00109 
00111 typedef struct
00112 {
00113     GncTreeModelClass gnc_tree_model;
00114 } GncTreeModelAccountClass;
00115 
00116 
00117 
00122 GType gnc_tree_model_account_get_type (void);
00123 
00124 
00132 GtkTreeModel *gnc_tree_model_account_new (Account *root);
00151 Account *gnc_tree_model_account_get_account (GncTreeModelAccount *model,
00152         GtkTreeIter *iter);
00153 
00154 
00171 gboolean gnc_tree_model_account_get_iter_from_account (GncTreeModelAccount *model,
00172         Account *account,
00173         GtkTreeIter *iter);
00174 
00175 
00189 GtkTreePath *gnc_tree_model_account_get_path_from_account (GncTreeModelAccount *model,
00190         Account *account);
00193 G_END_DECLS
00194 
00195 #endif /* __GNC_TREE_MODEL_ACCOUNT_H */
00196 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines