All Classes Namespaces Files Functions Variables Groups
Filters.idl
Go to the documentation of this file.
1 /**
2  * @file Filters.idl
3  * @brief Users' Rules for Filtering Messages
4  *
5  * @author Matej Prokop, Lukas Nemec
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 #import <FiltersCommon.idl>
12 
13 module kerio {
14 module jsonapi {
15 module webmail {
16 module filters {
17 
18 /**
19  * Filtering rule that has one or more initial conditions and
20  * one or more actions that are performed only if the
21  * filter's initial conditions are meet.
22  */
23 struct FilterRule {
24  kerio::web::KId id; ///< [READ-ONLY] global identification
25  boolean isEnabled; ///< says whether rule is enabled
26  string description; ///< contains rules description
27  boolean isIncomplete; ///< if rule is not completed (it does not contain any definition of conditions and actions)
28  kerio::jsonapi::filters::FilterConditionList conditions; ///< list of rule's initial conditions
29  kerio::jsonapi::filters::FilterActionList actions; ///< list of rule's actions (performed if initial conditions are meet)
30  kerio::jsonapi::filters::EvaluationModeType evaluationMode; ///< determines evaluation mod of initial conditions
31 };
32 typedef sequence<FilterRule> FilterRuleList;
33 
34 struct FilterRawRule {
35  kerio::web::KId id; ///< [READ-ONLY] global identification
36  boolean isEnabled; ///< says whether rule is enabled
37  string description; ///< contains rules description
38  string script;
39 };
40 
41 interface Filters {
42 
43  /**
44  * Gets all user's messages filtering rules.
45  *
46  * @param dataStamp - server as concurrent modification protection
47  * and it is an stamp which must be stored by client since it
48  * is required for future modification of received list of filter
49  * rules (using set method).
50  * @param filters - list of all messages filtering rules defined
51  * by user
52  */
53  void get(out unsignedlong dataStamp, out FilterRuleList filters);
54 
55  /**
56  * Obtain particular rule in a script form.
57  *
58  * @param rule - the script
59  * @param currentDataStamp - the stamp obtained via function get
60  * @param id - ID of rule
61  */
62  void getById(out FilterRawRule rule, in unsignedlong currentDataStamp, in kerio::web::KId id);
63 
64  /**
65  * Obtain rule in a script form generated from pattern.
66  *
67  * @param rule - the script
68  * @param pattern - structured rule
69  */
70  void generateRule(out FilterRawRule rule, in FilterRule pattern);
71 
72  /**
73  * Sets all users’ messages filtering rules. All old users’ rules
74  * will be replaced by list of those new rules.
75  *
76  * @param newDataStamp - a new stamp that replaces your current
77  * stamp and it is bound to new filters configuration you
78  * save by calling this method
79  * @param currentDataStamp - the stamp which was assigned to you by
80  * the server when you called method get or set last time. After a successful
81  * call of this method (setting filters list), you will get a new stamp as
82  * output parameter. This new stamp will be bound to new filters configuration.
83  * @param filters - list of all messages filtering rules defined
84  * by user
85  */
86  void set(out unsignedlong newDataStamp, in unsignedlong currentDataStamp, in FilterRuleList filters);
87 
88  /**
89  * Set particular rule.
90  *
91  * @param newDataStamp - a new stamp
92  * @param currentDataStamp - the stamp obtained via function get
93  * @param rule - the new script
94  */
95  void setById(out unsignedlong newDataStamp, in unsignedlong currentDataStamp, in FilterRawRule rule);
96 };
97 
98 }; }; }; }; // end of namespace