1 /*
2  * camel-junk-filter.h
3  *
4  * This library is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
19 #error "Only <camel/camel.h> can be included directly."
20 #endif
21 
22 #ifndef CAMEL_JUNK_FILTER_H
23 #define CAMEL_JUNK_FILTER_H
24 
25 #include <camel/camel-enums.h>
26 #include <camel/camel-mime-message.h>
27 
28 /* Standard GObject macros */
29 #define CAMEL_TYPE_JUNK_FILTER \
30 	(camel_junk_filter_get_type ())
31 #define CAMEL_JUNK_FILTER(obj) \
32 	(G_TYPE_CHECK_INSTANCE_CAST \
33 	((obj), CAMEL_TYPE_JUNK_FILTER, CamelJunkFilter))
34 #define CAMEL_JUNK_FILTER_INTERFACE(cls) \
35 	(G_TYPE_CHECK_CLASS_CAST \
36 	((cls), CAMEL_TYPE_JUNK_FILTER, CamelJunkFilterInterface))
37 #define CAMEL_IS_JUNK_FILTER(obj) \
38 	(G_TYPE_CHECK_INSTANCE_TYPE \
39 	((obj), CAMEL_TYPE_JUNK_FILTER))
40 #define CAMEL_IS_JUNK_FILTER_INTERFACE(cls) \
41 	(G_TYPE_CHECK_CLASS_TYPE \
42 	((cls), CAMEL_TYPE_JUNK_FILTER))
43 #define CAMEL_JUNK_FILTER_GET_INTERFACE(obj) \
44 	(G_TYPE_INSTANCE_GET_INTERFACE \
45 	((obj), CAMEL_TYPE_JUNK_FILTER, CamelJunkFilterInterface))
46 
47 G_BEGIN_DECLS
48 
49 /**
50  * CamelJunkFilter:
51  *
52  * Since: 3.2
53  **/
54 typedef struct _CamelJunkFilter CamelJunkFilter;
55 typedef struct _CamelJunkFilterInterface CamelJunkFilterInterface;
56 
57 struct _CamelJunkFilterInterface {
58 	GTypeInterface parent_interface;
59 
60 	/* Required Methods */
61 	CamelJunkStatus	(*classify)		(CamelJunkFilter *junk_filter,
62 						 CamelMimeMessage *message,
63 						 GCancellable *cancellable,
64 						 GError **error);
65 	gboolean	(*learn_junk)		(CamelJunkFilter *junk_filter,
66 						 CamelMimeMessage *message,
67 						 GCancellable *cancellable,
68 						 GError **error);
69 	gboolean	(*learn_not_junk)	(CamelJunkFilter *junk_filter,
70 						 CamelMimeMessage *message,
71 						 GCancellable *cancellable,
72 						 GError **error);
73 
74 	/* Optional Methods */
75 	gboolean	(*synchronize)		(CamelJunkFilter *junk_filter,
76 						 GCancellable *cancellable,
77 						 GError **error);
78 
79 	/* Padding for future expansion */
80 	gpointer reserved[20];
81 };
82 
83 GType		camel_junk_filter_get_type	(void) G_GNUC_CONST;
84 CamelJunkStatus	camel_junk_filter_classify	(CamelJunkFilter *junk_filter,
85 						 CamelMimeMessage *message,
86 						 GCancellable *cancellable,
87 						 GError **error);
88 gboolean	camel_junk_filter_learn_junk	(CamelJunkFilter *junk_filter,
89 						 CamelMimeMessage *message,
90 						 GCancellable *cancellable,
91 						 GError **error);
92 gboolean	camel_junk_filter_learn_not_junk
93 						(CamelJunkFilter *junk_filter,
94 						 CamelMimeMessage *message,
95 						 GCancellable *cancellable,
96 						 GError **error);
97 gboolean	camel_junk_filter_synchronize	(CamelJunkFilter *junk_filter,
98 						 GCancellable *cancellable,
99 						 GError **error);
100 
101 G_END_DECLS
102 
103 #endif /* CAMEL_JUNK_FILTER_H */
104