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_TABLE_CLICK_TO_ADD_H_
27 #define _E_TABLE_CLICK_TO_ADD_H_
28 
29 #include <libxml/tree.h>
30 #include <libgnomecanvas/libgnomecanvas.h>
31 
32 #include <e-util/e-table-header.h>
33 #include <e-util/e-table-item.h>
34 #include <e-util/e-table-selection-model.h>
35 #include <e-util/e-table-sort-info.h>
36 
37 /* Standard GObject macros */
38 #define E_TYPE_TABLE_CLICK_TO_ADD \
39 	(e_table_click_to_add_get_type ())
40 #define E_TABLE_CLICK_TO_ADD(obj) \
41 	(G_TYPE_CHECK_INSTANCE_CAST \
42 	((obj), E_TYPE_TABLE_CLICK_TO_ADD, ETableClickToAdd))
43 #define E_TABLE_CLICK_TO_ADD_CLASS(cls) \
44 	(G_TYPE_CHECK_CLASS_CAST \
45 	((cls), E_TYPE_TABLE_CLICK_TO_ADD, ETableClickToAddClass))
46 #define E_IS_TABLE_CLICK_TO_ADD(obj) \
47 	(G_TYPE_CHECK_INSTANCE_TYPE \
48 	((obj), E_TYPE_TABLE_CLICK_TO_ADD))
49 #define E_IS_TABLE_CLICK_TO_ADD_CLASS(cls) \
50 	(G_TYPE_CHECK_CLASS_TYPE \
51 	((cls), E_TYPE_TABLE_CLICK_TO_ADD))
52 #define E_TABLE_CLICK_TO_ADD_GET_CLASS(obj) \
53 	(G_TYPE_INSTANCE_GET_CLASS \
54 	((obj), E_TYPE_TABLE_CLICK_TO_ADD, ETableClickToAddClass))
55 
56 G_BEGIN_DECLS
57 
58 typedef struct _ETableClickToAdd ETableClickToAdd;
59 typedef struct _ETableClickToAddClass ETableClickToAddClass;
60 
61 struct _ETableClickToAdd {
62 	GnomeCanvasGroup  parent;
63 
64 	ETableModel      *one;    /* The ETableOne. */
65 
66 	ETableModel      *model;  /* The backend model. */
67 	ETableHeader     *eth;    /* This is just to give to the ETableItem. */
68 
69 	gchar             *message;
70 
71 	GnomeCanvasItem  *row;    /* If row is NULL, we're sitting with
72 				   * no data and a "Click here" message. */
73 	GnomeCanvasItem  *text;   /* If text is NULL, row shouldn't be. */
74 	GnomeCanvasItem  *rect;   /* What the heck.  Why not. */
75 
76 	gdouble           width;
77 	gdouble           height;
78 
79 	ETableSelectionModel *selection;
80 };
81 
82 struct _ETableClickToAddClass {
83 	GnomeCanvasGroupClass parent_class;
84 
85 	/* Signals */
86 	void		(*cursor_change)	(ETableClickToAdd *etcta,
87 						 gint row,
88 						 gint col);
89 	void		(*style_updated)	(ETableClickToAdd *etcta);
90 };
91 
92 GType		e_table_click_to_add_get_type	(void) G_GNUC_CONST;
93 void		e_table_click_to_add_commit	(ETableClickToAdd *etcta);
94 gboolean	e_table_click_to_add_is_editing	(ETableClickToAdd *etcta);
95 
96 G_END_DECLS
97 
98 #endif /* _E_TABLE_CLICK_TO_ADD_H_ */
99