GnuCash  4.11-148-gc20d717b33+
gnc-tree-model-owner.h
Go to the documentation of this file.
1 /*
2  * gnc-tree-model-owner.h -- GtkTreeModel implementation to
3  * display owners in a GtkTreeView.
4  *
5  * Copyright (C) 2011 Geert Janssens <geert@kobaltwit.be>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, contact:
19  *
20  * Free Software Foundation Voice: +1-617-542-5942
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22  * Boston, MA 02110-1301, USA gnu@gnu.org
23  */
24 
34 #ifndef __GNC_TREE_MODEL_OWNER_H
35 #define __GNC_TREE_MODEL_OWNER_H
36 
37 #include <gtk/gtk.h>
38 #include "gnc-tree-model.h"
39 
40 #include "gncOwner.h"
41 
42 G_BEGIN_DECLS
43 
44 /* type macros */
45 #define GNC_TYPE_TREE_MODEL_OWNER (gnc_tree_model_owner_get_type ())
46 #define GNC_TREE_MODEL_OWNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_OWNER, GncTreeModelOwner))
47 #define GNC_TREE_MODEL_OWNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_OWNER, GncTreeModelOwnerClass))
48 #define GNC_IS_TREE_MODEL_OWNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_OWNER))
49 #define GNC_IS_TREE_MODEL_OWNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_OWNER))
50 #define GNC_TREE_MODEL_OWNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_OWNER, GncTreeModelOwnerClass))
51 #define GNC_TREE_MODEL_OWNER_NAME "GncTreeModelOwner"
52 
53 
54 typedef enum
55 {
56  GNC_TREE_MODEL_OWNER_COL_NAME,
57  GNC_TREE_MODEL_OWNER_COL_TYPE,
58  GNC_TREE_MODEL_OWNER_COL_ID,
59  GNC_TREE_MODEL_OWNER_COL_CURRENCY,
60  GNC_TREE_MODEL_OWNER_COL_ADDRESS_NAME,
61  GNC_TREE_MODEL_OWNER_COL_ADDRESS_1,
62  GNC_TREE_MODEL_OWNER_COL_ADDRESS_2,
63  GNC_TREE_MODEL_OWNER_COL_ADDRESS_3,
64  GNC_TREE_MODEL_OWNER_COL_ADDRESS_4,
65  GNC_TREE_MODEL_OWNER_COL_PHONE,
66  GNC_TREE_MODEL_OWNER_COL_FAX,
67  GNC_TREE_MODEL_OWNER_COL_EMAIL,
68  GNC_TREE_MODEL_OWNER_COL_BALANCE,
69  GNC_TREE_MODEL_OWNER_COL_BALANCE_REPORT,
70  GNC_TREE_MODEL_OWNER_COL_NOTES,
71  GNC_TREE_MODEL_OWNER_COL_ACTIVE,
72 
73  GNC_TREE_MODEL_OWNER_COL_LAST_VISIBLE = GNC_TREE_MODEL_OWNER_COL_ACTIVE,
74 
75  /* internal hidden columns */
76  GNC_TREE_MODEL_OWNER_COL_COLOR_BALANCE,
77 
78  GNC_TREE_MODEL_OWNER_NUM_COLUMNS
79 } GncTreeModelOwnerColumn;
80 
81 /* typedefs & structures */
82 
84 typedef struct
85 {
87  int stamp;
90 
91 
93 typedef struct
94 {
97 
98 
99 
104 GType gnc_tree_model_owner_get_type (void);
105 
106 
114 GtkTreeModel *gnc_tree_model_owner_new (GncOwnerType owner_type);
134  GtkTreeIter *iter);
135 
136 
154  GncOwner *owner,
155  GtkTreeIter *iter);
156 
157 
172  GncOwner *owner);
175 G_END_DECLS
176 
177 #endif /* __GNC_TREE_MODEL_OWNER_H */
178 
The instance data structure for an owner tree model.
Business Interface: Object OWNERs.
GncTreeModel gnc_tree_model
The parent object data.
GncTreeModelClass gnc_tree_model
The parent object data.
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.
The class data structure for an owner tree model.
GType gnc_tree_model_owner_get_type(void)
Get the type of an owner tree plugin.
GtkTreeModel * gnc_tree_model_owner_new(GncOwnerType owner_type)
Create a new GtkTreeModel for manipulating gnucash owners.
GtkTreePath * gnc_tree_model_owner_get_path_from_owner(GncTreeModelOwner *model, GncOwner *owner)
Convert a model/owner pair into a gtk_tree_model_path.
GncOwner * gnc_tree_model_owner_get_owner(GncTreeModelOwner *model, GtkTreeIter *iter)
Convert a model/iter pair to a gnucash owner.
int stamp
The state of the model.
gboolean gnc_tree_model_owner_get_iter_from_owner(GncTreeModelOwner *model, GncOwner *owner, GtkTreeIter *iter)
Convert a model/owner pair into a gtk_tree_model_iter.