All Classes Namespaces Files Functions Variables Groups
Changes.idl
Go to the documentation of this file.
1 /**
2  * @file Changes.idl
3  * @brief Work with WebMail changes like new e-mail, reminders, events.
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 #import <Structures.idl>
16 
17 module kerio {
18 module jsonapi {
19 module webmail {
20 module changes {
21 
22 enum ChangeType {
23  chtCreated,
24  chtCopied,
25  chtDeleted,
26  chtModified,
27  chtMoved,
28  chtNewMail, ///< Valid only for item type 'itMail' and not for folder. Folder filter is not applied for this.
29  chtStatus,
30  chtReadFlagChanged, ///< Valid only for item type 'itMail' and not for folder.
31  chtModifiedMetadata, ///< Valid only for item type 'itMail' and not for folder. Content of messge is not changed, basicaly only flags.
32  chtModifiedContent ///< Valid only for folder. It means there was a change in messages which are placed in the folder. E.g.: number of unread messages.
33 };
34 
35 enum ItemType {
36  itMail, ///< change per mailbox for type 'chtNewMail' (folder filter is not applied)
37  itCalendar,
38  itContact,
39  itTask,
40  itNote,
41  itCalendarInbox, ///< change per mailbox (folder filter is not applied)
42  itDelegation ///< Valid ChangeType is 'chtCreated' and 'chtDeleted'
43 };
44 
46  string guid;
47  Watermark watermark;
48 };
49 
50 typedef sequence<AccountSyncKey> AccountSyncKeyList;
51 
52 struct SyncKey {
53  long id;
54  long version;
55  Watermark watermark;
56  Watermark publicFolder;
57  AccountSyncKeyList accountSyncKey;
58 };
59 
60 struct Change {
61  boolean isFolder;
62  ChangeType type;
63  ItemType itemType;
64 
65  kerio::web::KId itemId;
66  kerio::web::KId parentId;
67 
68  kerio::web::KId origId;
69  kerio::web::KId origParentId;
70 
71  Watermark watermark;
72 
73  long messageUnread; ///< when type is chtModifiedContent, it contains number of unreaded messages; when type is chtReadFlagChanged, it contains 1 if a message is unreaded
74 };
75 
76 typedef sequence<Change> ChangeList;
77 
78 /**
79  * Changes manager class
80  */
81 interface Changes {
82  /**
83  * Get changes for all folders on this server.
84  * Is permitted only one long-poll request with the same 'lastSyncKey'.
85  *
86  * @param list - all found changes
87  * @param syncKey - new watermark
88  * @param lastSyncKey - last watermark
89  * @param timeout - max time to wait for new changes. If value is zero response is returned imediately.
90  */
91  void get(out ChangeList list, out SyncKey syncKey, in SyncKey lastSyncKey, in long timeout);
92 
93  /**
94  * Get changes for all accessible folders of particular user or resource.
95  *
96  * @param list - all found changes
97  * @param asyncKey - new watermark
98  * @param lastAsyncKey - last watermark
99  * @param folderIds - IDs of subcribed folders
100  */
101  void getAccount(out ChangeList list, out AccountSyncKey asyncKey, in AccountSyncKey lastAsyncKey, in kerio::web::KIdList folderIds);
102 
103  /**
104  * Kill current running Changes.get's request. It supposed that timeout was specified > 0.
105  *
106  * @param lastSyncKey - last watermark
107  */
108  void killRequest(in SyncKey lastSyncKey);
109 
110  /**
111  * Get changes in a folder.
112  *
113  * @param list - all found changes
114  * @param syncKey - new last synckey (watermark)
115  * @param folderId - folder from which we want get item changes
116  * @param lastSyncKey - last synckey (watermark)
117  */
118  void getFolder(out ChangeList list, out Watermark syncKey, in kerio::web::KId folderId, in Watermark lastSyncKey);
119 
120 
121  /**
122  * Get actual watermark.
123  *
124  * @param watermark - actual watermark
125  */
126  void getSyncKey(out SyncKey syncKey);
127 
128  /**
129  * Get actual watermark.
130  *
131  * @param watermark - actual watermark
132  * @param pricipalId - ID of a user or a resurce
133  */
134  void getAccountSyncKey(out AccountSyncKey asyncKey, in kerio::web::KId mailboxId);
135 
136  /**
137  * Get actual sync key for a folder.
138  *
139  * @param syncKey - actual synckey (watermark) for folder
140  * @param folderId - wanted folder
141  */
142  void getFolderSyncKey(out Watermark syncKey, in kerio::web::KId folderId);
143 };
144 
145 
146 }; }; }; }; // end of namespace
147 
148 /**
149  * @}
150  */