GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-tree-model-selection.h
1 /*
2  * gnc-tree-model-selection.h -- GtkTreeModel which supports a
3  * selectable column.
4  *
5  * Copyright (C) 2003 Jan Arne Petersen
6  * Author: Jan Arne Petersen <[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 
26 /*
27  * This file creates a GtkTreeModel that extends an existing
28  * GtkTreeModel by a single column. This new column holds a single
29  * boolean value per row.
30  *
31  * GtkTreeViews allow the creation of columns in any order, not just
32  * the order they appear in the underlying model. The most likely use
33  * of this code will have the first view column mapped to this extra
34  * boolean model column, and the column value diaplayed by a checkbox.
35  */
36 
37 #ifndef __GNC_TREE_MODEL_SELECTION_H
38 #define __GNC_TREE_MODEL_SELECTION_H
39 
40 #include <gtk/gtk.h>
41 
42 G_BEGIN_DECLS
43 
44 /* type macros */
45 #define GNC_TYPE_TREE_MODEL_SELECTION (gnc_tree_model_selection_get_type ())
46 #define GNC_TREE_MODEL_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelection))
47 #define GNC_TREE_MODEL_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelectionClass))
48 #define GNC_IS_TREE_MODEL_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_SELECTION))
49 #define GNC_IS_TREE_MODEL_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_SELECTION))
50 #define GNC_TREE_MODEL_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelectionClass))
51 
52 /* typedefs & structures */
53 typedef struct
54 {
55  GObject gobject;
56  int stamp;
58 
59 typedef struct
60 {
61  GObjectClass gobject;
63 
64 /* function prototypes */
65 GType gnc_tree_model_selection_get_type (void);
66 
67 GtkTreeModel *gnc_tree_model_selection_new (GtkTreeModel *child_model);
68 
69 void gnc_tree_model_selection_convert_child_iter_to_iter (GncTreeModelSelection *model,
70  GtkTreeIter *selection_iter,
71  GtkTreeIter *child_iter);
72 void gnc_tree_model_selection_convert_iter_to_child_iter (GncTreeModelSelection *model,
73  GtkTreeIter *child_iter,
74  GtkTreeIter *selection_iter);
75 
76 void gnc_tree_model_selection_set_selected (GncTreeModelSelection *model,
77  GtkTreeIter *iter,
78  gboolean selected);
79 
80 G_END_DECLS
81 
82 #endif /* __GNC_TREE_MODEL_SELECTION_H */