1 /*
2  *
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
10  * for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public License
13  * along with this program; if not, see <http://www.gnu.org/licenses/>.
14  *
15  *
16  * Authors:
17  *		Chris Lahey <clahey@ximian.com>
18  *
19  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
20  *
21  */
22 
23 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
24 #error "Only <e-util/e-util.h> should be included directly."
25 #endif
26 
27 #ifndef _E_TABLE_GROUP_LEAF_H_
28 #define _E_TABLE_GROUP_LEAF_H_
29 
30 #include <libgnomecanvas/libgnomecanvas.h>
31 
32 #include <e-util/e-table-group.h>
33 #include <e-util/e-table-item.h>
34 #include <e-util/e-table-subset.h>
35 
36 /* Standard GObject macros */
37 #define E_TYPE_TABLE_GROUP_LEAF \
38 	(e_table_group_leaf_get_type ())
39 #define E_TABLE_GROUP_LEAF(obj) \
40 	(G_TYPE_CHECK_INSTANCE_CAST \
41 	((obj), E_TYPE_TABLE_GROUP_LEAF, ETableGroupLeaf))
42 #define E_TABLE_GROUP_LEAF_CLASS(cls) \
43 	(G_TYPE_CHECK_CLASS_CAST \
44 	((cls), E_TYPE_TABLE_GROUP_LEAF, ETableGroupLeafClass))
45 #define E_IS_TABLE_GROUP_LEAF(obj) \
46 	(G_TYPE_CHECK_INSTANCE_TYPE \
47 	((obj), E_TYPE_TABLE_GROUP_LEAF))
48 #define E_IS_TABLE_GROUP_LEAF_CLASS(cls) \
49 	(G_TYPE_CHECK_CLASS_TYPE \
50 	((cls), E_TYPE_TABLE_GROUP_LEAF))
51 #define E_TABLE_GROUP_LEAF_GET_CLASS(obj) \
52 	(G_TYPE_INSTANCE_GET_CLASS \
53 	((obj), E_TYPE_TABLE_GROUP_LEAF, ETableGroupLeafClass))
54 
55 G_BEGIN_DECLS
56 
57 typedef struct _ETableGroupLeaf ETableGroupLeaf;
58 typedef struct _ETableGroupLeafClass ETableGroupLeafClass;
59 
60 struct _ETableGroupLeaf {
61 	ETableGroup group;
62 
63 	/*
64 	 * Item.
65 	 */
66 	ETableItem *item;
67 
68 	gdouble height;
69 	gdouble width;
70 	gdouble minimum_width;
71 
72 	gint length_threshold;
73 
74 	ETableModel *ets;
75 	guint is_grouped : 1;
76 
77 	guint alternating_row_colors : 1;
78 	guint horizontal_draw_grid : 1;
79 	guint vertical_draw_grid : 1;
80 	guint draw_focus : 1;
81 	guint uniform_row_height : 1;
82 	ECursorMode cursor_mode;
83 
84 	gint etgl_cursor_change_id;
85 	gint etgl_cursor_activated_id;
86 	gint etgl_double_click_id;
87 	gint etgl_right_click_id;
88 	gint etgl_click_id;
89 	gint etgl_key_press_id;
90 	gint etgl_start_drag_id;
91 
92 	ESelectionModel *selection_model;
93 
94 	gulong notify_is_editing_id;
95 };
96 
97 struct _ETableGroupLeafClass {
98 	ETableGroupClass parent_class;
99 };
100 
101 GType		e_table_group_leaf_get_type	(void) G_GNUC_CONST;
102 ETableGroup *	e_table_group_leaf_new		(GnomeCanvasGroup *parent,
103 						 ETableHeader *full_header,
104 						 ETableHeader *header,
105 						 ETableModel *model,
106 						 ETableSortInfo *sort_info);
107 gboolean	e_table_group_leaf_is_editing	(ETableGroupLeaf *etgl);
108 
109 G_END_DECLS
110 
111 #endif /* _E_TABLE_GROUP_LEAF_H_ */
112 
113