d4ef0c06258c8b26b889bfec0077294117a0b2d6
[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 * prefs_filtering;
25
26
27 FilteringAction * filteringaction_new(int type, int account_id,
28                                       gchar * destination);
29 void filteringaction_free(FilteringAction * action);
30 FilteringAction * filteringaction_parse(gchar ** str);
31
32 FilteringProp * filteringprop_new(MatcherList * matchers,
33                                   FilteringAction * action);
34 void filteringprop_free(FilteringProp * prop);
35
36 FilteringProp * filteringprop_parse(gchar ** str);
37
38
39 void filter_msginfo(GSList * filtering_list, MsgInfo * info,
40                     GHashTable *folder_table);
41 void filter_msginfo_move_or_delete(GSList * filtering_list, MsgInfo * info,
42                                    GHashTable *folder_table);
43 void filter_message(GSList * filtering_list, FolderItem * item,
44                     gint msgnum, GHashTable *folder_table);
45
46 gchar * filteringaction_to_string(FilteringAction * action);
47 void prefs_filtering_write_config(void);
48 void prefs_filtering_read_config(void);
49 gchar * filteringprop_to_string(FilteringProp * prop);
50
51 #endif