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  *		Not Zed <notzed@lostzed.mmc.com.au>
17  *      Jeffrey Stedfast <fejj@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_FILTER_INPUT_H
28 #define E_FILTER_INPUT_H
29 
30 #include <e-util/e-filter-element.h>
31 
32 /* Standard GObject macros */
33 #define E_TYPE_FILTER_INPUT \
34 	(e_filter_input_get_type ())
35 #define E_FILTER_INPUT(obj) \
36 	(G_TYPE_CHECK_INSTANCE_CAST \
37 	((obj), E_TYPE_FILTER_INPUT, EFilterInput))
38 #define E_FILTER_INPUT_CLASS(cls) \
39 	(G_TYPE_CHECK_CLASS_CAST \
40 	((cls), E_TYPE_FILTER_INPUT, EFilterInputClass))
41 #define E_IS_FILTER_INPUT(obj) \
42 	(G_TYPE_CHECK_INSTANCE_TYPE \
43 	((obj), E_TYPE_FILTER_INPUT))
44 #define E_IS_FILTER_INPUT_CLASS(cls) \
45 	(G_TYPE_CHECK_CLASS_TYPE \
46 	((cls), E_TYPE_FILTER_INPUT))
47 #define E_FILTER_INPUT_GET_CLASS(obj) \
48 	(G_TYPE_INSTANCE_GET_CLASS \
49 	((obj), E_TYPE_FILTER_INPUT, EFilterInputClass))
50 
51 G_BEGIN_DECLS
52 
53 typedef struct _EFilterInput EFilterInput;
54 typedef struct _EFilterInputClass EFilterInputClass;
55 typedef struct _EFilterInputPrivate EFilterInputPrivate;
56 
57 struct _EFilterInput {
58 	EFilterElement parent;
59 	EFilterInputPrivate *priv;
60 
61 	gchar *type;		/* name of type */
62 	GList *values;		/* strings */
63 	gboolean allow_empty;	/* whether can have empty value */
64 	gchar *code_gen_func;   /* function name to build the 'code' */
65 };
66 
67 struct _EFilterInputClass {
68 	EFilterElementClass parent_class;
69 };
70 
71 GType		e_filter_input_get_type		(void) G_GNUC_CONST;
72 EFilterInput *	e_filter_input_new		(void);
73 EFilterInput *	e_filter_input_new_type_name	(const gchar *type);
74 void		e_filter_input_set_value	(EFilterInput *input,
75 						 const gchar *value);
76 
77 G_END_DECLS
78 
79 #endif /* E_FILTER_INPUT_H */
80