All Classes Files Functions Variables Enumerations Enumerator Groups Pages
TimeRanges.idl
Go to the documentation of this file.
1 /**
2  * @file TimeRanges.idl
3  * @brief %Time Range settings
4  *
5  * @author Dusan Juhas, Roman Jokl
6  *
7  * Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 
12 module kerio {
13 module web {
14 
15 /**
16  * @defgroup SUBGROUP4 Definitions
17  * @{
18  */
19 
21  TimeRangeDaily,
22  TimeRangeWeekly,
23  TimeRangeAbsolute,
24  TimeRangeChildGroup ///< not supported in QT
25 };
26 
27 enum Day {
28  Monday,
29  Tuesday,
30  Wednesday,
31  Thursday,
32  Friday,
33  Saturday,
34  Sunday
35 };
36 
37 typedef sequence<Day> DayList;
38 
40  KId id;
41  string name;
42 };
43 
44 /**
45  *
46  * Note: If type is changed, all fields representing the associated value must be also assigned, if used in set method.
47  * And conversely, type must be assigned if value was changed.
48  * type + (fromDay, toDay) + (fromDate, toDate) + childGroupId
49  */
51  KId id;
52  KId groupId;
53  KId sharedId; ///< read-only; filled when the item is shared in MyKerio
54  string groupName;
55  string description;
56 
57  TimeRangeType type;
58  boolean enabled;
59  StoreStatus status;
60 
61  Time fromTime; ///< This doesn't contain seconds, so we round data created by QT admin
62  Time toTime; ///< This doesn't contain seconds, so we round data created by QT admin
63 
64  /*@{ daily */
65  DayList days;
66  /*@}*/
67 
68  /*@{ weekly */
69  Day fromDay;
70  Day toDay;
71  /*@}*/
72 
73  /*@{ absolute */
74  Date fromDate; ///< hour and min used from Time
75  Date toDate; ///< hour and min used from Time
76  /*@}*/
77 
78  /*@{ child group */
79  KId childGroupId;
80  string childGroupName;
81  /*@}*/
82 };
83 
84 typedef sequence<TimeRangeEntry> TimeRangeEntryList;
85 typedef sequence<TimeRangeGroup> TimeRangeGroupList;
86 
87 interface TimeRanges {
88 
89  /**
90  * Create new ranges.
91  *
92  * @param errors - possible errors:
93  * - "This time range already exists!" duplicate name-value
94  * @param result - list of IDs of created TimeRanges
95  * @param ranges - details for new ranges. Field KiD is assigned by the manager to temporary value until apply() or reset().
96  */
97  void create(out ErrorList errors, out CreateResultList result, in TimeRangeEntryList ranges);
98 
99  /**
100  * Get the list of ranges.
101  *
102  * @param ranges - list of ranges and its details
103  * @param totalItems - count of all ranges on the server (before the start/limit applied)
104  * @param query - conditions and limits. Included from weblib. KWF engine implementation notes:
105  * - LIKE matches substring (second argument) in a string (first argument). There are no wildcards.
106  * - sort and match are case insensitive.
107  * - column alias (first operand):
108  */
109  void get(out TimeRangeEntryList list, out long totalItems, in SearchQuery query);
110 
111  /**
112  * Get the list of groups, sorted in ascending order.
113  *
114  * @param groups - list of all groups
115  */
116  void getGroupList(out TimeRangeGroupList groups);
117 
118  /**
119  * Remove ranges.
120  *
121  * @param rangeIds - IDs of ranges that should be removed
122  * @param errors - Errors by removing ranges
123  */
124  void remove(out ErrorList errors, in KIdList rangeIds);
125 
126  /**
127  * Set existing ranges.
128  *
129  * @param errors - possible errors:
130  * - "This time range already exists!" duplicate name-value
131  * @param rangeIds - IDs of ranges to be updated.
132  * @param details - details for update. Field "KId" is ignored. All other fields must be filled in and they are written to all ranges specified by rangeIds.
133  */
134  void set(out ErrorList errors, in KIdList rangeIds, in TimeRangeEntry details);
135 };
136 
137 }; // module web
138 }; // module kerio