Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-junk-plugin.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Author:
4  *  Radek Doulik <rodo@ximian.com>
5  *
6  * Copyright 2003 Ximian, Inc. (www.ximian.com)
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22
23 #ifndef _CAMEL_JUNK_PLUGIN_H
24 #define _CAMEL_JUNK_PLUGIN_H
25
26 #define CAMEL_JUNK_PLUGIN(x) ((CamelJunkPlugin *) x)
27
28 G_BEGIN_DECLS
29
30 typedef struct _CamelJunkPlugin CamelJunkPlugin;
31 struct _CamelMimeMessage;
32
33 struct _CamelJunkPlugin
34 {
35         /* junk filter human readable name, translated */
36         const char * (*get_name) (struct _CamelJunkPlugin *csp);
37
38         /* should be set to 1 */
39         int api_version;
40
41         /* when called, it should return TRUE if message is identified as junk,
42            FALSE otherwise */
43         int (*check_junk) (struct _CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
44
45         /* called when user identified a message to be junk */
46         void (*report_junk) (struct _CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
47
48         /* called when user identified a message not to be junk */
49         void (*report_notjunk) (struct _CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
50
51         /* called after one or more junk/ham(s) reported */
52         void (*commit_reports) (struct _CamelJunkPlugin *csp);
53
54         /* called before all other calls to junk plugin for initialization */
55         void (*init) (struct _CamelJunkPlugin *csp);
56 };
57
58 const char * camel_junk_plugin_get_name (CamelJunkPlugin *csp);
59 int camel_junk_plugin_check_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
60 void camel_junk_plugin_report_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
61 void camel_junk_plugin_report_notjunk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
62 void camel_junk_plugin_commit_reports (CamelJunkPlugin *csp);
63 void camel_junk_plugin_init (CamelJunkPlugin *csp);
64
65 G_END_DECLS
66
67 #endif