Update API documentation.
[platform/upstream/evolution-data-server.git] / camel / camel-enums.h
1 /*
2  * camel-enums.h
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) version 3.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with the program; if not, see <http://www.gnu.org/licenses/>
16  *
17  */
18
19 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
20 #error "Only <camel/camel.h> can be included directly."
21 #endif
22
23 #ifndef CAMEL_ENUMS_H
24 #define CAMEL_ENUMS_H
25
26 /**
27  * CamelAuthenticationResult:
28  * @CAMEL_AUTHENTICATION_ERROR:
29  *    An error occurred while authenticating.
30  * @CAMEL_AUTHENTICATION_ACCEPTED:
31  *    Server accepted our authentication attempt.
32  * @CAMEL_AUTHENTICATION_REJECTED:
33  *    Server rejected our authentication attempt.
34  *
35  * Authentication result codes used by #CamelService.
36  *
37  * Since: 3.4
38  **/
39 typedef enum {
40         CAMEL_AUTHENTICATION_ERROR,
41         CAMEL_AUTHENTICATION_ACCEPTED,
42         CAMEL_AUTHENTICATION_REJECTED
43 } CamelAuthenticationResult;
44
45 typedef enum { /*< flags >*/
46         CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY = 1 << 0,
47         CAMEL_FOLDER_FILTER_RECENT          = 1 << 2,
48         CAMEL_FOLDER_HAS_BEEN_DELETED       = 1 << 3,
49         CAMEL_FOLDER_IS_TRASH               = 1 << 4,
50         CAMEL_FOLDER_IS_JUNK                = 1 << 5,
51         CAMEL_FOLDER_FILTER_JUNK            = 1 << 6
52 } CamelFolderFlags;
53
54 #define CAMEL_FOLDER_TYPE_BIT (10)
55
56 /**
57  * CamelFolderInfoFlags:
58  * @CAMEL_FOLDER_NOSELECT:
59  *    The folder cannot contain messages.
60  * @CAMEL_FOLDER_NOINFERIORS:
61  *    The folder cannot have child folders.
62  * @CAMEL_FOLDER_CHILDREN:
63  *    The folder has children (not yet fully implemented).
64  * @CAMEL_FOLDER_NOCHILDREN:
65  *    The folder does not have children (not yet fully implemented).
66  * @CAMEL_FOLDER_SUBSCRIBED:
67  *    The folder is subscribed.
68  * @CAMEL_FOLDER_VIRTUAL:
69  *    The folder is virtual.  Messages cannot be copied or moved to
70  *    virtual folders since they are only queries of other folders.
71  * @CAMEL_FOLDER_SYSTEM:
72  *    The folder is a built-in "system" folder.  System folders
73  *    cannot be renamed or deleted.
74  * @CAMEL_FOLDER_VTRASH:
75  *    The folder is a virtual trash folder.  It cannot be copied to,
76  *    and can only be moved to if in an existing folder.
77  * @CAMEL_FOLDER_SHARED_TO_ME:
78  *    A folder being shared by someone else.
79  * @CAMEL_FOLDER_SHARED_BY_ME:
80  *    A folder being shared by the user.
81  * @CAMEL_FOLDER_TYPE_NORMAL:
82  *    The folder is a normal folder.
83  * @CAMEL_FOLDER_TYPE_INBOX:
84  *    The folder is an inbox folder.
85  * @CAMEL_FOLDER_TYPE_OUTBOX:
86  *    The folder is an outbox folder.
87  * @CAMEL_FOLDER_TYPE_TRASH:
88  *    The folder shows deleted messages.
89  * @CAMEL_FOLDER_TYPE_JUNK:
90  *    The folder shows junk messages.
91  * @CAMEL_FOLDER_TYPE_SENT:
92  *    The folder shows sent messages.
93  * @CAMEL_FOLDER_TYPE_CONTACTS:
94  *    The folder contains contacts, instead of mail messages.
95  * @CAMEL_FOLDER_TYPE_EVENTS:
96  *    The folder contains calendar events, instead of mail messages.
97  * @CAMEL_FOLDER_TYPE_MEMOS:
98  *    The folder contains memos, instead of mail messages.
99  * @CAMEL_FOLDER_TYPE_TASKS:
100  *    The folder contains tasks, instead of mail messages.
101  *
102  * These flags are abstractions.  It's up to the CamelProvider to give
103  * them suitable interpretations.  Use #CAMEL_FOLDER_TYPE_MASK to isolate
104  * the folder's type.
105  **/
106 /* WARNING: This enum and CamelStoreInfoFlags must stay in sync.
107  * FIXME: Eliminate the need for two separate types. */
108 typedef enum { /*< flags >*/
109         CAMEL_FOLDER_NOSELECT      = 1 << 0,
110         CAMEL_FOLDER_NOINFERIORS   = 1 << 1,
111         CAMEL_FOLDER_CHILDREN      = 1 << 2,
112         CAMEL_FOLDER_NOCHILDREN    = 1 << 3,
113         CAMEL_FOLDER_SUBSCRIBED    = 1 << 4,
114         CAMEL_FOLDER_VIRTUAL       = 1 << 5,
115         CAMEL_FOLDER_SYSTEM        = 1 << 6,
116         CAMEL_FOLDER_VTRASH        = 1 << 7,
117         CAMEL_FOLDER_SHARED_TO_ME  = 1 << 8,
118         CAMEL_FOLDER_SHARED_BY_ME  = 1 << 9,
119         CAMEL_FOLDER_TYPE_NORMAL   = 0 << CAMEL_FOLDER_TYPE_BIT,
120         CAMEL_FOLDER_TYPE_INBOX    = 1 << CAMEL_FOLDER_TYPE_BIT,
121         CAMEL_FOLDER_TYPE_OUTBOX   = 2 << CAMEL_FOLDER_TYPE_BIT,
122         CAMEL_FOLDER_TYPE_TRASH    = 3 << CAMEL_FOLDER_TYPE_BIT,
123         CAMEL_FOLDER_TYPE_JUNK     = 4 << CAMEL_FOLDER_TYPE_BIT,
124         CAMEL_FOLDER_TYPE_SENT     = 5 << CAMEL_FOLDER_TYPE_BIT,
125         CAMEL_FOLDER_TYPE_CONTACTS = 6 << CAMEL_FOLDER_TYPE_BIT,
126         CAMEL_FOLDER_TYPE_EVENTS   = 7 << CAMEL_FOLDER_TYPE_BIT,
127         CAMEL_FOLDER_TYPE_MEMOS    = 8 << CAMEL_FOLDER_TYPE_BIT,
128         CAMEL_FOLDER_TYPE_TASKS    = 9 << CAMEL_FOLDER_TYPE_BIT,
129         CAMEL_FOLDER_READONLY      = 1 << 16,
130         CAMEL_FOLDER_CHECK_FOR_NEW = 1 << 17,
131         CAMEL_FOLDER_FLAGGED       = 1 << 18,
132
133         CAMEL_FOLDER_FLAGS_LAST    = 1 << 24  /*< skip >*/
134 } CamelFolderInfoFlags;
135
136 #define CAMEL_FOLDER_TYPE_MASK (63 << CAMEL_FOLDER_TYPE_BIT)
137
138 /* WARNING: This enum and CamelFolderInfoFlags must stay in sync.
139  * FIXME: Eliminate the need for two separate types. */
140 typedef enum { /*< flags >*/
141         CAMEL_STORE_INFO_FOLDER_NOSELECT      = 1 << 0,
142         CAMEL_STORE_INFO_FOLDER_NOINFERIORS   = 1 << 1,
143         CAMEL_STORE_INFO_FOLDER_CHILDREN      = 1 << 2,
144         CAMEL_STORE_INFO_FOLDER_NOCHILDREN    = 1 << 3,
145         CAMEL_STORE_INFO_FOLDER_SUBSCRIBED    = 1 << 4,
146         CAMEL_STORE_INFO_FOLDER_VIRTUAL       = 1 << 5,
147         CAMEL_STORE_INFO_FOLDER_SYSTEM        = 1 << 6,
148         CAMEL_STORE_INFO_FOLDER_VTRASH        = 1 << 7,
149         CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME  = 1 << 8,
150         CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME  = 1 << 9,
151         CAMEL_STORE_INFO_FOLDER_READONLY      = 1 << 16,
152         CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW = 1 << 17,
153         CAMEL_STORE_INFO_FOLDER_FLAGGED       = 1 << 18,
154
155         CAMEL_STORE_INFO_FOLDER_LAST          = 1 << 24  /*< skip >*/
156 } CamelStoreInfoFlags;
157
158 /**
159  * CamelFetchHeadersType:
160  * @CAMEL_FETCH_HEADERS_BASIC:
161  *     Fetch only basic headers (Date, From, To, Subject, etc.).
162  * @CAMEL_FETCH_HEADERS_BASIC_AND_MAILING_LIST:
163  *     Fetch all basic headers and mailing list headers.
164  * @CAMEL_FETCH_HEADERS_ALL:
165  *     Fetch all available message headers.
166  *
167  * Describes what headers to fetch when downloading message summaries.
168  *
169  * Since: 3.2
170  **/
171 typedef enum {
172         CAMEL_FETCH_HEADERS_BASIC,
173         CAMEL_FETCH_HEADERS_BASIC_AND_MAILING_LIST,
174         CAMEL_FETCH_HEADERS_ALL
175 } CamelFetchHeadersType;
176
177 /**
178  * CamelJunkStatus:
179  * @CAMEL_JUNK_STATUS_INCONCLUSIVE:
180  *     The junk filter could not determine whether the message is junk.
181  * @CAMEL_JUNK_STATUS_MESSAGE_IS_JUNK:
182  *     The junk filter believes the message is junk.
183  * @CAMEL_JUNK_STATUS_MESSAGE_IS_NOT_JUNK:
184  *     The junk filter believes the message is not junk.
185  *
186  * These are result codes used when passing messages through a junk filter.
187  **/
188 typedef enum {
189         CAMEL_JUNK_STATUS_INCONCLUSIVE,
190         CAMEL_JUNK_STATUS_MESSAGE_IS_JUNK,
191         CAMEL_JUNK_STATUS_MESSAGE_IS_NOT_JUNK
192 } CamelJunkStatus;
193
194 typedef enum {
195         CAMEL_MIME_FILTER_BASIC_INVALID,
196         CAMEL_MIME_FILTER_BASIC_BASE64_ENC,
197         CAMEL_MIME_FILTER_BASIC_BASE64_DEC,
198         CAMEL_MIME_FILTER_BASIC_QP_ENC,
199         CAMEL_MIME_FILTER_BASIC_QP_DEC,
200         CAMEL_MIME_FILTER_BASIC_UU_ENC,
201         CAMEL_MIME_FILTER_BASIC_UU_DEC
202 } CamelMimeFilterBasicType;
203
204 typedef enum {
205         CAMEL_MIME_FILTER_CRLF_ENCODE,
206         CAMEL_MIME_FILTER_CRLF_DECODE
207 } CamelMimeFilterCRLFDirection;
208
209 typedef enum {
210         CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS,
211         CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY
212 } CamelMimeFilterCRLFMode;
213
214 typedef enum {
215         CAMEL_MIME_FILTER_GZIP_MODE_ZIP,
216         CAMEL_MIME_FILTER_GZIP_MODE_UNZIP
217 } CamelMimeFilterGZipMode;
218
219 typedef enum {
220         CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE,
221         CAMEL_MIME_FILTER_YENC_DIRECTION_DECODE
222 } CamelMimeFilterYencDirection;
223
224 /**
225  * CamelNetworkSecurityMethod:
226  * @CAMEL_NETWORK_SECURITY_METHOD_NONE:
227  *   Use an unencrypted network connection.
228  * @CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT:
229  *   Use SSL by connecting to an alternate port number.
230  * @CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT:
231  *   Use SSL or TLS by connecting to the standard port and invoking
232  *   STARTTLS before authenticating.  This is the recommended method.
233  *
234  * Methods for establishing an encrypted (or unencrypted) network connection.
235  *
236  * Since: 3.2
237  **/
238 typedef enum {
239         CAMEL_NETWORK_SECURITY_METHOD_NONE,
240         CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT,
241         CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT
242 } CamelNetworkSecurityMethod;
243
244 typedef enum {
245         CAMEL_PROVIDER_CONF_END,
246         CAMEL_PROVIDER_CONF_SECTION_START,
247         CAMEL_PROVIDER_CONF_SECTION_END,
248         CAMEL_PROVIDER_CONF_CHECKBOX,
249         CAMEL_PROVIDER_CONF_CHECKSPIN,
250         CAMEL_PROVIDER_CONF_ENTRY,
251         CAMEL_PROVIDER_CONF_LABEL,
252         CAMEL_PROVIDER_CONF_HIDDEN,
253         CAMEL_PROVIDER_CONF_OPTIONS
254 } CamelProviderConfType;
255
256 /**
257  * CamelProviderFlags;
258  * @CAMEL_PROVIDER_IS_REMOTE:
259  *   Provider works with remote data.
260  * @CAMEL_PROVIDER_IS_LOCAL:
261  *   Provider can be used as a backend for local folder tree folders.
262  *   (Not just the opposite of #CAMEL_PROVIDER_IS_REMOTE.)
263  * @CAMEL_PROVIDER_IS_SOURCE:
264  *   Mail arrives there, so it should be offered as an option in the
265  *   mail config dialog.
266  * @CAMEL_PROVIDER_IS_STORAGE:
267  *   Mail is stored there.  It will appear in the folder tree.
268  * @CAMEL_PROVIDER_IS_EXTERNAL:
269  *   Provider appears in the folder tree but is not created by the
270  *   mail component.
271  * @CAMEL_PROVIDER_HAS_LICENSE:
272  *   Provider configuration first needs the license to be accepted.
273  *   (No longer used.)
274  * @CAMEL_PROVIDER_ALLOW_REAL_TRASH_FOLDER:
275  *   Provider may use a real trash folder instead of a virtual folder.
276  * @CAMEL_PROVIDER_ALLOW_REAL_JUNK_FOLDER:
277  *   Provider may use a real junk folder instead of a virtual folder.
278  * @CAMEL_PROVIDER_SUPPORTS_MOBILE_DEVICES:
279  *  Download limited set of emails instead of operating on full cache.
280  * @CAMEL_PROVIDER_SUPPORTS_BATCH_FETCH:
281  *  Support to fetch messages in batch.
282  * @CAMEL_PROVIDER_SUPPORTS_PURGE_MESSAGE_CACHE:
283  *  Support to remove oldest downloaded messages to conserve space.
284  *
285  **/
286 typedef enum { /*< flags >*/
287         CAMEL_PROVIDER_IS_REMOTE               = 1 << 0,
288         CAMEL_PROVIDER_IS_LOCAL                = 1 << 1,
289         CAMEL_PROVIDER_IS_EXTERNAL             = 1 << 2,
290         CAMEL_PROVIDER_IS_SOURCE               = 1 << 3,
291         CAMEL_PROVIDER_IS_STORAGE              = 1 << 4,
292         CAMEL_PROVIDER_SUPPORTS_SSL            = 1 << 5,
293         CAMEL_PROVIDER_HAS_LICENSE             = 1 << 6,
294         CAMEL_PROVIDER_DISABLE_SENT_FOLDER     = 1 << 7,
295         CAMEL_PROVIDER_ALLOW_REAL_TRASH_FOLDER = 1 << 8,
296         CAMEL_PROVIDER_ALLOW_REAL_JUNK_FOLDER  = 1 << 9,
297         CAMEL_PROVIDER_SUPPORTS_MOBILE_DEVICES = 1 << 10,
298         CAMEL_PROVIDER_SUPPORTS_BATCH_FETCH    = 1 << 11,
299         CAMEL_PROVIDER_SUPPORTS_PURGE_MESSAGE_CACHE = 1 << 12
300 } CamelProviderFlags;
301
302 typedef enum {
303         CAMEL_PROVIDER_STORE,
304         CAMEL_PROVIDER_TRANSPORT,
305         CAMEL_NUM_PROVIDER_TYPES  /*< skip >*/
306 } CamelProviderType;
307
308 typedef enum {
309         CAMEL_SASL_ANON_TRACE_EMAIL,
310         CAMEL_SASL_ANON_TRACE_OPAQUE,
311         CAMEL_SASL_ANON_TRACE_EMPTY
312 } CamelSaslAnonTraceType;
313
314 /**
315  * CamelServiceConnectionStatus:
316  * @CAMEL_SERVICE_DISCONNECTED:
317  *   #CamelService is disconnected from a remote server.
318  * @CAMEL_SERVICE_CONNECTING:
319  *   #CamelService is connecting to a remote server.
320  * @CAMEL_SERVICE_CONNECTED:
321  *   #CamelService is connected to a remote server.
322  * @CAMEL_SERVICE_DISCONNECTING:
323  *   #CamelService is disconnecting from a remote server.
324  *
325  * Connection status returned by camel_service_get_connection_status().
326  *
327  * Since: 3.6
328  **/
329 typedef enum {
330         CAMEL_SERVICE_DISCONNECTED,
331         CAMEL_SERVICE_CONNECTING,
332         CAMEL_SERVICE_CONNECTED,
333         CAMEL_SERVICE_DISCONNECTING
334 } CamelServiceConnectionStatus;
335
336 typedef enum {
337         CAMEL_SESSION_ALERT_INFO,
338         CAMEL_SESSION_ALERT_WARNING,
339         CAMEL_SESSION_ALERT_ERROR
340 } CamelSessionAlertType;
341
342 /**
343  * CamelSortType:
344  * @CAMEL_SORT_ASCENDING:
345  *   Sorting is in ascending order.
346  * @CAMEL_SORT_DESCENDING:
347  *   Sorting is in descending order.
348  *
349  * Determines the direction of a sort.
350  *
351  * Since: 3.2
352  **/
353 typedef enum {
354         CAMEL_SORT_ASCENDING,
355         CAMEL_SORT_DESCENDING
356 } CamelSortType;
357
358 typedef enum { /*< flags >*/
359         CAMEL_STORE_VTRASH           = 1 << 0,
360         CAMEL_STORE_VJUNK            = 1 << 1,
361         CAMEL_STORE_PROXY            = 1 << 2,
362         CAMEL_STORE_IS_MIGRATING     = 1 << 3,
363         CAMEL_STORE_REAL_JUNK_FOLDER = 1 << 4,
364         CAMEL_STORE_CAN_EDIT_FOLDERS = 1 << 5,
365         CAMEL_STORE_USE_CACHE_DIR    = 1 << 6
366 } CamelStoreFlags;
367
368 /**
369  * CamelStoreGetFolderInfoFlags:
370  * @CAMEL_STORE_FOLDER_INFO_FAST:
371  * @CAMEL_STORE_FOLDER_INFO_RECURSIVE:
372  * @CAMEL_STORE_FOLDER_INFO_SUBSCRIBED:
373  * @CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL:
374  *   Do not include virtual trash or junk folders.
375  * @CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST:
376  *   Fetch only the subscription list. Clients should use this
377  *   flag for requesting the list of folders available for
378  *   subscription. Used in Exchange / IMAP connectors for public
379  *   folder fetching.
380  **/
381 typedef enum { /*< flags >*/
382         CAMEL_STORE_FOLDER_INFO_FAST              = 1 << 0,
383         CAMEL_STORE_FOLDER_INFO_RECURSIVE         = 1 << 1,
384         CAMEL_STORE_FOLDER_INFO_SUBSCRIBED        = 1 << 2,
385         CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL        = 1 << 3,
386         CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST = 1 << 4
387 } CamelStoreGetFolderInfoFlags;
388
389 typedef enum { /*< flags >*/
390         CAMEL_STORE_READ  = 1 << 0,
391         CAMEL_STORE_WRITE = 1 << 1
392 } CamelStorePermissionFlags;
393
394 typedef enum { /*< flags >*/
395         CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 = 1 << 0,
396         CAMEL_TCP_STREAM_SSL_ENABLE_SSL3 = 1 << 1,
397         CAMEL_TCP_STREAM_SSL_ENABLE_TLS  = 1 << 2
398 } CamelTcpStreamSSLFlags;
399
400 /* Note: If you change this, make sure you change the
401  *       'encodings' array in camel-mime-part.c. */
402 typedef enum {
403         CAMEL_TRANSFER_ENCODING_DEFAULT,
404         CAMEL_TRANSFER_ENCODING_7BIT,
405         CAMEL_TRANSFER_ENCODING_8BIT,
406         CAMEL_TRANSFER_ENCODING_BASE64,
407         CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE,
408         CAMEL_TRANSFER_ENCODING_BINARY,
409         CAMEL_TRANSFER_ENCODING_UUENCODE,
410         CAMEL_TRANSFER_NUM_ENCODINGS
411 } CamelTransferEncoding;
412
413 /**
414  * CamelStreamVFSOpenMethod:
415  * CAMEL_STREAM_VFS_CREATE:
416  *      Writable, creates new file or replaces old file.
417  * CAMEL_STREAM_VFS_APPEND:
418  *      Writable, creates new file or appends at the end of the old file.
419  * CAMEL_STREAM_VFS_READ:
420  *      Readable, opens existing file for reading.
421  *
422  * Since: 2.24
423  **/
424 typedef enum {
425         CAMEL_STREAM_VFS_CREATE,
426         CAMEL_STREAM_VFS_APPEND,
427         CAMEL_STREAM_VFS_READ
428 } CamelStreamVFSOpenMethod;
429
430 #endif /* CAMEL_ENUMS_H */