Updated Traditional Chinese translation(Hong Kong and Taiwan)
[evolution.git] / filter / e-filter-part.h
blobdcf1e8b4ca0dca0d7ed67d364b53171d9c4649b4
1 /*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2 of the License, or (at your option) version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with the program; if not, see <http://www.gnu.org/licenses/>
16 * Authors:
17 * Not Zed <notzed@lostzed.mmc.com.au>
18 * Jeffrey Stedfast <fejj@ximian.com>
20 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
24 #ifndef E_FILTER_PART_H
25 #define E_FILTER_PART_H
27 #include <gtk/gtk.h>
28 #include <libxml/parser.h>
29 #include <libxml/xmlmemory.h>
30 #include "e-util/e-alert.h"
31 #include "e-filter-element.h"
33 /* Standard GObject macros */
34 #define E_TYPE_FILTER_PART \
35 (e_filter_part_get_type ())
36 #define E_FILTER_PART(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST \
38 ((obj), E_TYPE_FILTER_PART, EFilterPart))
39 #define E_FILTER_PART_CLASS(cls) \
40 (G_TYPE_CHECK_CLASS_CAST \
41 ((cls), E_TYPE_FILTER_PART, EFilterPartClass))
42 #define E_IS_FILTER_PART(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE \
44 ((obj), E_TYPE_FILTER_PART))
45 #define E_IS_FILTER_PART_CLASS(cls) \
46 (G_TYPE_CHECK_CLASS_TYPE \
47 ((cls), E_TYPE_FILTER_PART))
48 #define E_FILTER_PART_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS \
50 ((obj), E_TYPE_FILTER_PART, EFilterPartClass))
52 G_BEGIN_DECLS
54 struct _ERuleContext;
56 typedef struct _EFilterPart EFilterPart;
57 typedef struct _EFilterPartClass EFilterPartClass;
58 typedef struct _EFilterPartPrivate EFilterPartPrivate;
60 struct _EFilterPart {
61 GObject parent;
62 EFilterPartPrivate *priv;
64 gchar *name;
65 gchar *title;
66 gchar *code;
67 GList *elements;
70 struct _EFilterPartClass {
71 GObjectClass parent_class;
74 GType e_filter_part_get_type (void);
75 EFilterPart * e_filter_part_new (void);
76 gboolean e_filter_part_validate (EFilterPart *part,
77 EAlert **alert);
78 gint e_filter_part_eq (EFilterPart *part_a,
79 EFilterPart *part_b);
80 gint e_filter_part_xml_create (EFilterPart *part,
81 xmlNodePtr node,
82 struct _ERuleContext *rc);
83 xmlNodePtr e_filter_part_xml_encode (EFilterPart *fe);
84 gint e_filter_part_xml_decode (EFilterPart *fe,
85 xmlNodePtr node);
86 EFilterPart * e_filter_part_clone (EFilterPart *part);
87 void e_filter_part_copy_values (EFilterPart *dst_part,
88 EFilterPart *src_part);
89 EFilterElement *e_filter_part_find_element (EFilterPart *part,
90 const gchar *name);
91 GtkWidget * e_filter_part_get_widget (EFilterPart *part);
92 void e_filter_part_build_code (EFilterPart *part,
93 GString *out);
94 void e_filter_part_expand_code (EFilterPart *part,
95 const gchar *str,
96 GString *out);
98 void e_filter_part_build_code_list (GList *list,
99 GString *out);
100 EFilterPart * e_filter_part_find_list (GList *list,
101 const gchar *name);
102 EFilterPart * e_filter_part_next_list (GList *list,
103 EFilterPart *last);
105 G_END_DECLS
107 #endif /* E_FILTER_PART_H */