All Classes Namespaces Files Functions Variables Groups
Folders.idl
Go to the documentation of this file.
1 /**
2  * @file Folders.idl
3  * @brief Message Folders
4  *
5  * @author Martin Hosna
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 
11 /**
12  * @defgroup FOLDERS Accessing message folders
13  * @{
14  */
15 
16 #import <Structures.idl>
17 #import <Principals.idl>
18 
19 module kerio {
20 module jsonapi {
21 module webmail {
22 module folders {
23 
24 /**
25  * Folder sub-type enumeration.
26  */
27 enum FolderSubType {
28  FSubNone, ///< Ordinary folder.
29  FSubInbox, ///< Special sub-type of FMail. This folder cannot be removed.
30  FSubDrafts, ///< Special sub-type of FMail. This folder cannot be removed.
31  FSubSentItems, ///< Special sub-type of FMail. This folder cannot be removed.
32  FSubDeletedItems, ///< Special sub-type of FMail. This folder cannot be removed.
33  FSubJunkEmail, ///< Special sub-type of FMail. This folder cannot be removed.
34  FSubDefault, ///< These folders cannot be removed.
35  FSubGalResources, ///< This folder is created via GAL for storage contacts of resources.
36  FSubGalContacts ///< This folder is created via GAL for storage contacts of people.
37 };
38 
39 /**
40  * Folder type enumeration
41  */
42 enum FolderType {
43  FRoot,
44  FMail,
45  FContact,
46  FCalendar,
47  FTask,
48  FNote
49 };
50 
51 /**
52  * Type of place where is folder placed
53  */
54 enum FolderPlaceType {
55  FPlaceMailbox, ///< the mailbox of currently loged user
56  FPlaceResources, ///< the resource type of Equipment
57  FPlaceLocations, ///< the resource type of Room
58  FPlacePeople, ///< the shared folder of another user
59  FPlacePublic, ///< the public folder
60  FPlaceArchive ///< the archive folder
61 };
62 
63 /**
64  * Access to folder
65  */
66 enum FolderAccess {
67  FAccessListingOnly,
68  FAccessReadOnly,
69  FAccessReadWrite,
70  FAccessAdmin ///< full access; E.g user can add folder
71 };
72 
74  FolderAccess access;
76  boolean inherited; ///< [READ-ONLY] permission are placed in a public root folder and there are read-only here
77  boolean isDelegatee; ///< [READ-ONLY] principal is delegatee (this flag is filled only for default calendar and INBOX otherwise is false)
78 };
79 
80 typedef sequence<FolderPermission> FolderPermissionList;
81 
82 
83 struct Folder {
84  kerio::web::KId id; ///< [READ-ONLY] global identification
85  kerio::web::KId parentId; ///< global identification
86  string name; ///< folder name displayed in folder tree
87  string ownerName; ///< [READ-ONLY] name of owner of folder (available only for 'FPlacePeople', 'FPlaceResources' and 'FPlaceLocations')
88  string emailAddress; ///< [READ-ONLY] email of owner of folder (available only for 'FPlacePeople', 'FPlaceResources' and 'FPlaceLocations')
89  FolderType type; ///< type of the folder
90  FolderSubType subType; ///< [READ-ONLY] type of the folder
91  FolderPlaceType placeType; ///< [READ-ONLY] type of place where is folder placed
92  FolderAccess access; ///< [READ-ONLY] type of access of currently loged user
93  boolean isShared; ///< [READ-ONLY] true if a folder is shared to another user (permissions are not empty)
94  boolean isDelegated; ///< [READ-ONLY] true if a folder access is R/W and user is a delegate
95  long nestingLevel; ///< [READ-ONLY] number 0 = root folder, 1 = subfolders of root folder, 2 = subfolder of subfolder, ...
96  long messageCount; ///< [READ-ONLY] count of items in the folder (not set for root folder)
97  long messageUnread; ///< [READ-ONLY] count of unread items (mails or deleted items) in folder, not set for non-mail folder types
98  longlong messageSize; ///< [READ-ONLY] size of all messages in the folder (without subdirectories)
99  boolean checked; ///< true if a folder is chosen to view
100  string color; ///< a color of folder, if string is empty no color is set
101  boolean published; ///< [READ-ONLY] true, if folder was published to server
102 };
103 
104 typedef sequence<Folder> FolderList;
105 
106 
109  kerio::web::KId mailboxId; ///< root folder ID
110  boolean isLoaded; ///< folders are loaded (are present on the same home server)
111  FolderList folders; ///< folders with at least listing-only righs
112  kerio::web::KIdList subscribedFolderIds;
113 };
114 
115 typedef sequence<SharedMailbox> SharedMailboxList;
116 
117 
118 /**
119  * Folder store manager class
120  */
121 interface Folders {
122 
123  /**
124  * Remove all items in folder older then given item ID including. If folder is type of 'FMail' the items are moved to Delete Items or throw away if folder is Delete Items.
125  *
126  * @param itemId - the last item ID
127  */
128  void clearToItemId(in kerio::web::KId itemId);
129 
130  /**
131  * Create new folders
132  *
133  * @param errors - error message list
134  * @param result - list of ID of crated folders.
135  * @param folders - list of folders to create
136  */
137  void create(out kerio::web::ErrorList errors, out kerio::web::CreateResultList result, in FolderList folders);
138 
139  /**
140  * Obtain list of folders of currently logged user
141  *
142  * @param list - list of folders
143  */
144  void get(out FolderList list);
145 
146  /**
147  * Obtain list of folders which currently logged user can access
148  *
149  * @param list - list of folders
150  */
151  void getShared(out FolderList list, in kerio::web::KId mailboxId);
152 
153  /**
154  * Obtain list of public folders which currently logged user can access
155  *
156  * @param list - list of public folders
157  */
158  void getPublic(out FolderList list);
159 
160  /**
161  * Obtain list of folders acording SubscriptionList.
162  *
163  * @param list - list of folders
164  */
165  void getSubscribed(out SharedMailboxList list);
166 
167  /**
168  * Obtain ID of special folder for auto-complete contacts
169  *
170  * @param folderId - ID of special folder
171  */
172  void getAutoCompleteContactsFolderId(out kerio::web::KId folderId);
173 
174  /**
175  * Obtain list of mailboxes with their folders which currently logged user can access
176  *
177  * @param mailboxes - list of mailboxes with their folders
178  */
179  void getSharedMailboxList(out SharedMailboxList mailboxes);
180 
181  /**
182  * Move folder. Sub-folders of different types are moved to a parent folder, therefore it's safe to call this method even
183  * if it isn't known if some sub-folders are there.
184  * Take a note that mail folders are moved recursively (the whole subtree)! Folders of other types (e.g. calendars) are not moved recursively.
185  *
186  * @param errors - error message list
187  * @param targetId - target folder ID
188  * @param ids - folder IDs
189  */
190  void moveByType(out kerio::web::ErrorList errors, in kerio::web::KId targetId, in kerio::web::KIdList ids);
191 
192  /**
193  * Set folder properties
194  *
195  * @param errors - error message list
196  * @param folders - properties to save
197  */
198  void set(out kerio::web::ErrorList errors, in FolderList folders);
199 
200  /**
201  * Remove folder. Sub-folders are removed if recursive is true.
202  *
203  * @param errors - error message list
204  * @param ids - folder IDs
205  * @param recursive - remove sub-folders
206  */
207  void remove(out kerio::web::ErrorList errors, in kerio::web::KIdList ids, in boolean recursive);
208 
209  /**
210  * Remove folder. Sub-folders of different types are moved to a parent folder, therefore it's safe to call this method even
211  * if it isn't known if some sub-folders are there.
212  * Take a note that mail folders are removed recursively! Folders of other types (e.g. calendars) are not removed recursively.
213  *
214  * @param errors - error message list
215  * @param ids - folder IDs
216  */
217  void removeByType(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
218 
219  /**
220  * Get sharing permissions
221  *
222  * @param permissions - sharing settings
223  * @param folderId - ID of folder
224  */
225  void getPermissions(out FolderPermissionList permissions, in kerio::web::KId folderId);
226 
227  /**
228  * Set sharing permissions
229  *
230  * @param permissions - sharing settings
231  * @param folderId - ID of folder
232  * @param recursively - if true all permissions in subfolders are replaced by these permissions
233  */
234  void setPermissions(in FolderPermissionList permissions, in kerio::web::KId folderId, in boolean recursive);
235 
236  /**
237  * Get list of subscribed folders
238  *
239  * @param folder IDs
240  */
241  void getSubscriptionList(out kerio::web::KIdList folderIds);
242 
243  /**
244  * Set list of subscribed folders
245  *
246  * @param folder IDs
247  */
248  void setSubscriptionList(in kerio::web::KIdList folderIds);
249 
250  /**
251  * Copies (or moves) all messages from the source folder to the destination
252  *
253  * @param sourceId - ID of the source folder
254  * @param destId - ID of the destionation folder
255  * @param doMove - if true move the messages instead of copy the
256  */
257  void copyAllMessages(in kerio::web::KId sourceId, in kerio::web::KId destId, in boolean doMove);
258 
259 };
260 
261 }; }; }; }; // end of namespace
262 
263 /**
264  * @}
265  */