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_SEARCH_H_
28 #define _E_TABLE_SEARCH_H_
29 
30 #include <glib-object.h>
31 
32 /* Standard GObject macros */
33 #define E_TYPE_TABLE_SEARCH \
34 	(e_table_search_get_type ())
35 #define E_TABLE_SEARCH(obj) \
36 	(G_TYPE_CHECK_INSTANCE_CAST \
37 	((obj), E_TYPE_TABLE_SEARCH, ETableSearch))
38 #define E_TABLE_SEARCH_CLASS(cls) \
39 	(G_TYPE_CHECK_CLASS_CAST \
40 	((cls), E_TYPE_TABLE_SEARCH, ETableSearchClass))
41 #define E_IS_TABLE_SEARCH(obj) \
42 	(G_TYPE_CHECK_INSTANCE_TYPE \
43 	((obj), E_TYPE_TABLE_SEARCH))
44 #define E_IS_TABLE_SEARCH_CLASS(cls) \
45 	(G_TYPE_CHECK_CLASS_TYPE \
46 	((cls), E_TYPE_TABLE_SEARCH))
47 #define E_TABLE_SEARCH_GET_CLASS(obj) \
48 	(G_TYPE_INSTANCE_GET_CLASS \
49 	((obj), E_TYPE_TABLE_SEARCH, ETableSearchClass))
50 
51 G_BEGIN_DECLS
52 
53 typedef struct _ETableSearch ETableSearch;
54 typedef struct _ETableSearchClass ETableSearchClass;
55 typedef struct _ETableSearchPrivate ETableSearchPrivate;
56 
57 typedef enum {
58 	E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST = 1 << 0
59 } ETableSearchFlags;
60 
61 struct _ETableSearch {
62 	GObject parent;
63 	ETableSearchPrivate *priv;
64 };
65 
66 struct _ETableSearchClass {
67 	GObjectClass parent_class;
68 
69 	/* Signals */
70 	gboolean	(*search)		(ETableSearch *ets,
71 						 gchar *string /* utf8 */,
72 						 ETableSearchFlags flags);
73 	void		(*accept)		(ETableSearch *ets);
74 };
75 
76 GType		e_table_search_get_type		(void) G_GNUC_CONST;
77 ETableSearch *	e_table_search_new		(void);
78 void		e_table_search_input_character	(ETableSearch *e_table_search,
79 						 gunichar character);
80 gboolean	e_table_search_backspace	(ETableSearch *e_table_search);
81 void		e_table_search_cancel		(ETableSearch *e_table_search);
82 
83 G_END_DECLS
84 
85 #endif /* _E_TABLE_SEARCH_H_ */
86