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 © 2011-2012 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  string groupName;
54  string description;
55 
56  TimeRangeType type;
57  boolean enabled;
58  StoreStatus status;
59 
60  Time fromTime; ///< This doesn't contain seconds, so we round data created by QT admin
61  Time toTime; ///< This doesn't contain seconds, so we round data created by QT admin
62 
63  /*@{ daily */
64  DayList days;
65  /*@}*/
66 
67  /*@{ weekly */
68  Day fromDay;
69  Day toDay;
70  /*@}*/
71 
72  /*@{ absolute */
73  Date fromDate; ///< hour and min used from Time
74  Date toDate; ///< hour and min used from Time
75  /*@}*/
76 
77  /*@{ child group */
78  KId childGroupId;
79  string childGroupName;
80  /*@}*/
81 };
82 
83 typedef sequence<TimeRangeEntry> TimeRangeEntryList;
84 typedef sequence<TimeRangeGroup> TimeRangeGroupList;
85 
86 interface TimeRanges {
87 
88  /**
89  * Create new ranges.
90  *
91  * @param errors - possible errors:
92  * - "This time range already exists!" duplicate name-value
93  * @param result - list of IDs of created TimeRanges
94  * @param ranges - details for new ranges. Field KiD is assigned by the manager to temporary value until apply() or reset().
95  */
96  void create(out ErrorList errors, out CreateResultList result, in TimeRangeEntryList ranges);
97 
98  /**
99  * Get the list of ranges.
100  *
101  * @param ranges - list of ranges and its details
102  * @param totalItems - count of all ranges on the server (before the start/limit applied)
103  * @param query - conditions and limits. Included from weblib. KWF engine implementation notes:
104  * - LIKE matches substring (second argument) in a string (first argument). There are no wildcards.
105  * - sort and match are case insensitive.
106  * - column alias (first operand):
107  */
108  void get(out TimeRangeEntryList list, out long totalItems, in SearchQuery query);
109 
110  /**
111  * Get the list of groups, sorted in ascending order.
112  *
113  * @param groups - list of all groups
114  */
115  void getGroupList(out TimeRangeGroupList groups);
116 
117  /**
118  * Remove ranges.
119  *
120  * @param rangeIds - IDs of ranges that should be removed
121  * @param errors - Errors by removing ranges
122  */
123  void remove(out ErrorList errors, in KIdList rangeIds);
124 
125  /**
126  * Set existing ranges.
127  *
128  * @param errors - possible errors:
129  * - "This time range already exists!" duplicate name-value
130  * @param rangeIds - IDs of ranges to be updated.
131  * @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.
132  */
133  void set(out ErrorList errors, in KIdList rangeIds, in TimeRangeEntry details);
134 };
135 
136 }; // module web
137 }; // module kerio