1 /*
2  * This program is free software; you can redistribute it and/or modify it
3  * under the terms of the GNU Lesser General Public License as published by
4  * the Free Software Foundation.
5  *
6  * This program is distributed in the hope that it will be useful, but
7  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
8  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9  * for more details.
10  *
11  * You should have received a copy of the GNU Lesser General Public License
12  * along with this program; if not, see <http://www.gnu.org/licenses/>.
13  *
14  *
15  * Authors:
16  *		Chris Lahey <clahey@ximian.com>
17  *
18  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
19  *
20  */
21 
22 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
23 #error "Only <e-util/e-util.h> should be included directly."
24 #endif
25 
26 #ifndef _E_TREE_SELECTION_MODEL_H_
27 #define _E_TREE_SELECTION_MODEL_H_
28 
29 #include <e-util/e-selection-model.h>
30 #include <e-util/e-sorter.h>
31 #include <e-util/e-tree-model.h>
32 
33 /* Standard GObject macros */
34 #define E_TYPE_TREE_SELECTION_MODEL \
35 	(e_tree_selection_model_get_type ())
36 #define E_TREE_SELECTION_MODEL(obj) \
37 	(G_TYPE_CHECK_INSTANCE_CAST \
38 	((obj), E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModel))
39 #define E_TREE_SELECTION_MODEL_CLASS(cls) \
40 	(G_TYPE_CHECK_CLASS_CAST \
41 	((cls), E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModelClass))
42 #define E_IS_TREE_SELECTION_MODEL(obj) \
43 	(G_TYPE_CHECK_INSTANCE_TYPE \
44 	((obj), E_TYPE_TREE_SELECTION_MODEL))
45 #define E_IS_TREE_SELECTION_MODEL_CLASS(cls) \
46 	(G_TYPE_CHECK_CLASS_TYPE \
47 	((cls), E_TYPE_TREE_SELECTION_MODEL))
48 #define E_TREE_SELECTION_MODEL_GET_CLASS(obj) \
49 	(G_TYPE_INSTANCE_GET_CLASS \
50 	((obj), E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModelClass))
51 
52 G_BEGIN_DECLS
53 
54 typedef void	(*ETreeForeachFunc)		(ETreePath path,
55 						 gpointer closure);
56 
57 typedef struct _ETreeSelectionModel ETreeSelectionModel;
58 typedef struct _ETreeSelectionModelClass ETreeSelectionModelClass;
59 typedef struct _ETreeSelectionModelPrivate ETreeSelectionModelPrivate;
60 
61 struct _ETreeSelectionModel {
62 	ESelectionModel parent;
63 	ETreeSelectionModelPrivate *priv;
64 };
65 
66 struct _ETreeSelectionModelClass {
67 	ESelectionModelClass parent_class;
68 };
69 
70 GType		e_tree_selection_model_get_type	(void) G_GNUC_CONST;
71 ESelectionModel *
72 		e_tree_selection_model_new	(void);
73 void		e_tree_selection_model_foreach	(ETreeSelectionModel *etsm,
74 						 ETreeForeachFunc callback,
75 						 gpointer closure);
76 void		e_tree_selection_model_select_single_path
77 						(ETreeSelectionModel *etsm,
78 						 ETreePath path);
79 void		e_tree_selection_model_select_paths
80 						(ETreeSelectionModel *etsm,
81 						 GPtrArray *paths);
82 
83 void		e_tree_selection_model_add_to_selection
84 						(ETreeSelectionModel *etsm,
85 						 ETreePath path);
86 void		e_tree_selection_model_change_cursor
87 						(ETreeSelectionModel *etsm,
88 						 ETreePath path);
89 ETreePath	e_tree_selection_model_get_cursor
90 						(ETreeSelectionModel *etsm);
91 gint		e_tree_selection_model_get_selection_start_row
92 						(ETreeSelectionModel *etsm);
93 void		e_tree_selection_model_set_selection_start_row
94 						(ETreeSelectionModel *etsm,
95 						 gint row);
96 G_END_DECLS
97 
98 #endif /* _E_TREE_SELECTION_MODEL_H_ */
99