new matcher config file parser
[claws.git] / src / filtering.h
1 #ifndef FILTER_NEW_H
2
3 #define FILTER_NEW_H
4
5 #include <glib.h>
6 #include "matcher.h"
7 #include "procmsg.h"
8
9 struct _FilteringAction {
10         gint type;
11         gint account_id;
12         gchar * destination;
13 };
14
15 typedef struct _FilteringAction FilteringAction;
16
17 struct _FilteringProp {
18         MatcherList * matchers;
19         FilteringAction * action;
20 };
21
22 typedef struct _FilteringProp FilteringProp;
23
24 extern GSList * global_filtering;
25
26
27 FilteringAction * filteringaction_new(int type, int account_id,
28                                       gchar * destination);
29 void filteringaction_free(FilteringAction * action);
30 /*
31 FilteringAction * filteringaction_parse(gchar ** str);
32 */
33
34 FilteringProp * filteringprop_new(MatcherList * matchers,
35                                   FilteringAction * action);
36 void filteringprop_free(FilteringProp * prop);
37
38 /*
39 FilteringProp * filteringprop_parse(gchar ** str);
40 */
41
42 void filter_msginfo(GSList * filtering_list, MsgInfo * info,
43                     GHashTable *folder_table);
44 void filter_msginfo_move_or_delete(GSList * filtering_list, MsgInfo * info,
45                                    GHashTable *folder_table);
46 void filter_message(GSList * filtering_list, FolderItem * item,
47                     gint msgnum, GHashTable *folder_table);
48
49 gchar * filteringaction_to_string(FilteringAction * action);
50 void prefs_filtering_write_config(void);
51 void prefs_filtering_read_config(void);
52 gchar * filteringprop_to_string(FilteringProp * prop);
53
54 void prefs_filtering_clear();
55
56 #endif