fd2c11ac1cdbd6c2de2caae4087395890aa2b1c0
[platform/core/messaging/email-service.git] / email-common-use / include / email-types.h
1 /*
2 *  email-service
3 *
4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5 *
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21
22
23 #ifndef __EMAIL_TYPES_H__
24 #define __EMAIL_TYPES_H__
25
26 /**
27 * @defgroup EMAIL_SERVICE Email Service
28 * @{
29 */
30
31 /**
32 * @ingroup EMAIL_SERVICE
33 * @defgroup EMAIL_TYPES Email Types
34 * @{
35 */
36 /**
37  * This file defines structures and enums of Email Framework.
38  * @file        email-types.h
39  * @author      Kyu-ho Jo(kyuho.jo@samsung.com)
40  * @author      Choongho Lee(ch715.lee@samsung.com)
41  * @version     0.1
42  * @brief       This file is the header file of Email Framework library.
43  */
44
45
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif /* __cplusplus */
50
51 #include <glib.h>
52 #include <stdbool.h>
53 #include "email-errors.h"
54
55
56 /*****************************************************************************/
57 /*  Macros                                                                   */
58 /*****************************************************************************/
59
60 #define MAILBOX_NAME_LENGTH               256
61 #define MAX_EMAIL_ADDRESS_LENGTH          254                                    /* RFC5322, RFC3696 */
62 #define MAX_USER_NAME_LENGTH              64
63 #define MAX_DATETIME_STRING_LENGTH        20
64 #define MAX_PREVIEW_TEXT_LENGTH           512
65 #define STRING_LENGTH_FOR_DISPLAY         100
66 #define MEETING_REQ_OBJECT_ID_LENGTH      256
67
68 #define ALL_ACCOUNT                       0
69 #define NEW_ACCOUNT_ID                    0xFFFFFFFE
70 #define ALL_MAIL                          -1
71
72 #define EMAIL_SEARCH_FILTER_NONE          0x00
73 #define EMAIL_SEARCH_FILTER_SUBJECT       0x01
74 #define EMAIL_SEARCH_FILTER_SENDER        0x02
75 #define EMAIL_SEARCH_FILTER_RECIPIENT     0x04
76 #define EMAIL_SEARCH_FILTER_ALL           0x07                                   /*  EMAIL_SEARCH_FILTER_SUBJECT + EMAIL_SEARCH_FILTER_SENDER + EMAIL_SEARCH_FILTER_RECIPIEN */
77
78 #define EMAIL_SUCCESS                     0                                      /*  we need to modify the success return value */
79
80 #define EMAIL_ACC_GET_OPT_DEFAULT         0x01                                   /**< Default values without account name */
81 #define EMAIL_ACC_GET_OPT_ACCOUNT_NAME    0x02                                   /**< Account name */
82 #define EMAIL_ACC_GET_OPT_PASSWORD        0x04                                   /**< With password */
83 #define EMAIL_ACC_GET_OPT_OPTIONS         0x08                                   /**< Account options : email_option_t */
84 #define EMAIL_ACC_GET_OPT_FULL_DATA       0xFF                                   /**< With all data of account */
85
86 #define GET_FULL_DATA                     (EMAIL_ACC_GET_OPT_FULL_DATA)
87 #define GET_FULL_DATA_WITHOUT_PASSWORD    (EMAIL_ACC_GET_OPT_DEFAULT | EMAIL_ACC_GET_OPT_ACCOUNT_NAME | EMAIL_ACC_GET_OPT_OPTIONS )
88 #define WITHOUT_OPTION                    (EMAIL_ACC_GET_OPT_DEFAULT | EMAIL_ACC_GET_OPT_ACCOUNT_NAME )
89 #define ONLY_OPTION                       (EMAIL_ACC_GET_OPT_OPTIONS)
90
91 #define THREAD_TYPE_RECEIVING             0                                      /**< for function 'email_activate_pdp' */
92 #define THREAD_TYPE_SENDING               1                                      /**< for function 'email_activate_pdp' */
93
94 #define EMAIL_IMAP_PORT                   143                                    /**< Specifies the default IMAP port.*/
95 #define EMAIL_POP3_PORT                   110                                    /**< Specifies the default POP3 port.*/
96 #define EMAIL_SMTP_PORT                   25                                     /**< Specifies the default SMTP port.*/
97 #define EMAIL_IMAPS_PORT                  993                                    /**< Specifies the default IMAP SSL port.*/
98 #define EMAIL_POP3S_PORT                  995                                    /**< Specifies the default POP3 SSL port.*/
99 #define EMAIL_SMTPS_PORT                  465                                    /**< Specifies the default SMTP SSL port.*/
100 #define EMAIL_ACCOUNT_MAX                 10                                     /**< Specifies the MAX account.*/
101
102 #define EMAIL_INBOX_NAME                  "INBOX"                                /**< Specifies the name of inbox.*/
103 #define EMAIL_DRAFTBOX_NAME               "DRAFTBOX"                             /**< Specifies the name of draftbox.*/
104 #define EMAIL_OUTBOX_NAME                 "OUTBOX"                               /**< Specifies the name of outbox.*/
105 #define EMAIL_SENTBOX_NAME                "SENTBOX"                              /**< Specifies the name of sentbox.*/
106 #define EMAIL_TRASH_NAME                  "TRASH"                                /**< Specifies the name of trash.*/
107 #define EMAIL_SPAMBOX_NAME                "SPAMBOX"                              /**< Specifies the name of spambox.*/
108
109 #define EMAIL_INBOX_DISPLAY_NAME          "Inbox"                                /**< Specifies the display name of inbox.*/
110 #define EMAIL_DRAFTBOX_DISPLAY_NAME       "Draftbox"                             /**< Specifies the display name of draftbox.*/
111 #define EMAIL_OUTBOX_DISPLAY_NAME         "Outbox"                               /**< Specifies the display name of outbox.*/
112 #define EMAIL_SENTBOX_DISPLAY_NAME        "Sentbox"                              /**< Specifies the display name of sentbox.*/
113 #define EMAIL_TRASH_DISPLAY_NAME          "Trash"                                /**< Specifies the display name of sentbox.*/
114 #define EMAIL_SPAMBOX_DISPLAY_NAME        "Spambox"                              /**< Specifies the display name of spambox.*/
115
116 #define EMAIL_SEARCH_RESULT_MAILBOX_NAME  "_`S1!E2@A3#R4$C5^H6&R7*E8(S9)U0-L=T_" /**< Specifies the name of search result mailbox.*/
117
118 #define SYNC_STATUS_FINISHED              0                                      /* BIN 00000000 */
119 #define SYNC_STATUS_SYNCING               1                                      /* BIN 00000001 */
120 #define SYNC_STATUS_HAVE_NEW_MAILS        2                                      /* BIN 00000010 */
121
122 #define UNKNOWN_CHARSET_PLAIN_TEXT_FILE   "unknown"
123 #define UNKNOWN_CHARSET_HTML_TEXT_FILE    "unknown.htm"
124
125 #define FAILURE                           -1
126 #define SUCCESS                           0
127
128 #define DAEMON_EXECUTABLE_PATH            "/usr/bin/email-service"
129
130 #ifndef EXPORT_API
131 #define EXPORT_API                        __attribute__((visibility("default")))
132 #endif
133
134 #ifndef DEPRECATED
135 #define DEPRECATED                        __attribute__((deprecated))
136 #endif
137
138 #define VCONF_VIP_NOTI_RINGTONE_PATH          "db/private/email-service/noti_ringtone_path"            
139 #define VCONF_VIP_NOTI_REP_TYPE               "db/private/email-service/noti_rep_type"                 
140 #define VCONF_VIP_NOTI_NOTIFICATION_TICKER    "db/private/email-service/noti_notification_ticker"      
141 #define VCONF_VIP_NOTI_DISPLAY_CONTENT_TICKER "db/private/email-service/noti_display_content_ticker"   
142 #define VCONF_VIP_NOTI_BADGE_TICKER           "db/private/email-service/noti_badge_ticker"             
143
144 /*****************************************************************************/
145 /*  Enumerations                                                             */
146 /*****************************************************************************/
147
148 enum {
149         /* Account */
150         _EMAIL_API_ADD_ACCOUNT                               = 0x01000000,
151         _EMAIL_API_DELETE_ACCOUNT                            = 0x01000001,
152         _EMAIL_API_UPDATE_ACCOUNT                            = 0x01000002,
153         _EMAIL_API_GET_ACCOUNT                               = 0x01000003,
154         _EMAIL_API_GET_ACCOUNT_LIST                          = 0x01000005,
155         _EMAIL_API_GET_MAILBOX_COUNT                         = 0x01000007,
156         _EMAIL_API_VALIDATE_ACCOUNT                          = 0x01000008,
157         _EMAIL_API_ADD_ACCOUNT_WITH_VALIDATION               = 0x01000009,
158         _EMAIL_API_BACKUP_ACCOUNTS                           = 0x0100000A,
159         _EMAIL_API_RESTORE_ACCOUNTS                          = 0x0100000B,
160         _EMAIL_API_GET_PASSWORD_LENGTH_OF_ACCOUNT            = 0x0100000C,
161         _EMAIL_API_VALIDATE_ACCOUNT_EX                       = 0x0100000D,
162
163         /* Mail */
164         _EMAIL_API_DELETE_MAIL                               = 0x01100002,
165         _EMAIL_API_DELETE_ALL_MAIL                           = 0x01100004,
166         _EMAIL_API_GET_MAILBOX_LIST                          = 0x01100006,
167         _EMAIL_API_GET_SUBMAILBOX_LIST                       = 0x01100007,
168         _EMAIL_API_CLEAR_DATA                                = 0x01100009,
169         _EMAIL_API_MOVE_MAIL                                 = 0x0110000A,
170         _EMAIL_API_MOVE_ALL_MAIL                             = 0x0110000B,
171         _EMAIL_API_ADD_ATTACHMENT                            = 0x0110000C,
172         _EMAIL_API_GET_ATTACHMENT                            = 0x0110000D,
173         _EMAIL_API_DELETE_ATTACHMENT                         = 0x0110000E,
174         _EMAIL_API_MODIFY_MAIL_FLAG                          = 0x0110000F,
175         _EMAIL_API_MODIFY_MAIL_EXTRA_FLAG                    = 0x01100011,
176         _EMAIL_API_SET_FLAGS_FIELD                           = 0x01100016,
177         _EMAIL_API_ADD_MAIL                                  = 0x01100017,
178         _EMAIL_API_UPDATE_MAIL                               = 0x01100018,
179         _EMAIL_API_ADD_READ_RECEIPT                          = 0x01100019,
180         _EMAIL_API_EXPUNGE_MAILS_DELETED_FLAGGED             = 0x0110001A,
181
182         /* Thread */
183         _EMAIL_API_MOVE_THREAD_TO_MAILBOX                    = 0x01110000,
184         _EMAIL_API_DELETE_THREAD                             = 0x01110001,
185         _EMAIL_API_MODIFY_SEEN_FLAG_OF_THREAD                = 0x01110002,
186
187         /* Mailbox */
188         _EMAIL_API_ADD_MAILBOX                               = 0x01200000,
189         _EMAIL_API_DELETE_MAILBOX                            = 0x01200001,
190         _EMAIL_API_SET_MAIL_SLOT_SIZE                        = 0x01200007,
191         _EMAIL_API_RENAME_MAILBOX                            = 0x01200008,
192         _EMAIL_API_SET_MAILBOX_TYPE                          = 0x01200009,
193         _EMAIL_API_SET_LOCAL_MAILBOX                         = 0x0120000A,
194
195         /* Network */
196         _EMAIL_API_SEND_MAIL                                 = 0x01300000,
197         _EMAIL_API_SYNC_HEADER                               = 0x01300001,
198         _EMAIL_API_DOWNLOAD_BODY                             = 0x01300002,
199         _EMAIL_API_DOWNLOAD_ATTACHMENT                       = 0x01300003,
200         _EMAIL_API_NETWORK_GET_STATUS                        = 0x01300004,
201         _EMAIL_API_SEND_SAVED                                = 0x01300005,
202         _EMAIL_API_DELETE_EMAIL                              = 0x01300007,
203         _EMAIL_API_DELETE_EMAIL_ALL                          = 0x01300008,
204         _EMAIL_API_GET_IMAP_MAILBOX_LIST                     = 0x01300015,
205         _EMAIL_API_SEND_MAIL_CANCEL_JOB                      = 0x01300017,
206         _EMAIL_API_SEARCH_MAIL_ON_SERVER                     = 0x01300019,
207         _EMAIL_API_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER     = 0x0130001A,
208
209         /* Rule */
210         _EMAIL_API_ADD_RULE                                  = 0x01400000,
211         _EMAIL_API_GET_RULE                                  = 0x01400001,
212         _EMAIL_API_GET_RULE_LIST                             = 0x01400002,
213         _EMAIL_API_FIND_RULE                                 = 0x01400003,
214         _EMAIL_API_DELETE_RULE                               = 0x01400004,
215         _EMAIL_API_UPDATE_RULE                               = 0x01400005,
216         _EMAIL_API_APPLY_RULE                                = 0x01400006,
217         _EMAIL_API_CANCEL_JOB                                = 0x01400007,
218         _EMAIL_API_GET_PENDING_JOB                           = 0x01400008,
219         _EMAIL_API_SEND_RETRY                                = 0x01400009,
220         _EMAIL_API_UPDATE_ACTIVITY                           = 0x0140000A,
221         _EMAIL_API_SYNC_LOCAL_ACTIVITY                       = 0x0140000B,
222         _EMAIL_API_PRINT_RECEIVING_EVENT_QUEUE               = 0x0140000C,
223
224         /* Etc */
225         _EMAIL_API_PING_SERVICE                              = 0x01500000,
226         _EMAIL_API_UPDATE_NOTIFICATION_BAR_FOR_UNREAD_MAIL   = 0x01500001,
227         _EMAIL_API_SHOW_USER_MESSAGE                         = 0x01500002,
228         _EMAIL_API_WRITE_MIME_FILE                           = 0x01500003,
229
230         /* Smime */
231         _EMAIL_API_ADD_CERTIFICATE                           = 0x01600000,
232         _EMAIL_API_DELETE_CERTIFICATE                        = 0x01600001,
233         _EMAIL_API_VERIFY_SIGNATURE                          = 0x01600002,
234         _EMAIL_API_VERIFY_CERTIFICATE                        = 0x01600003,
235 };
236
237 typedef enum
238 {
239         EMAIL_DELETE_LOCALLY                     = 0,  /**< Specifies Mail Delete local only */
240         EMAIL_DELETE_LOCAL_AND_SERVER,                 /**< Specifies Mail Delete local & server */
241         EMAIL_DELETE_FOR_SEND_THREAD,                  /**< Created to check which activity to delete in send thread */
242         EMAIL_DELETE_FROM_SERVER,
243         EMAIL_DELETE_MAIL_AND_MEETING_FOR_EAS,         /**< Delete mails and meetings on an EAS account. */
244 } email_delete_option_t;
245
246 typedef enum
247 {
248         NOTI_MAIL_ADD                            = 10000,
249         NOTI_MAIL_DELETE                         = 10001,
250         NOTI_MAIL_DELETE_ALL                     = 10002,
251         NOTI_MAIL_DELETE_WITH_ACCOUNT            = 10003,
252         NOTI_MAIL_DELETE_FAIL                    = 10007,
253         NOTI_MAIL_DELETE_FINISH                  = 10008,
254
255         NOTI_MAIL_UPDATE                         = 10004,
256         NOTI_MAIL_FIELD_UPDATE                   = 10020,
257
258         NOTI_MAIL_MOVE                           = 10005,
259         NOTI_MAIL_MOVE_FAIL                      = 10010,
260         NOTI_MAIL_MOVE_FINISH                    = 10006,
261
262         NOTI_THREAD_MOVE                         = 11000,
263         NOTI_THREAD_DELETE                       = 11001,
264         NOTI_THREAD_MODIFY_SEEN_FLAG             = 11002,
265
266         NOTI_ACCOUNT_ADD                         = 20000,
267         NOTI_ACCOUNT_DELETE                      = 20001,
268         NOTI_ACCOUNT_DELETE_FAIL                 = 20003,
269         NOTI_ACCOUNT_UPDATE                      = 20002,
270         NOTI_ACCOUNT_UPDATE_SYNC_STATUS          = 20010,
271
272         NOTI_MAILBOX_ADD                         = 40000,
273         NOTI_MAILBOX_DELETE                      = 40001,
274         NOTI_MAILBOX_UPDATE                      = 40002,
275         NOTI_MAILBOX_FIELD_UPDATE                = 40003,
276
277         NOTI_MAILBOX_RENAME                      = 40010,
278         NOTI_MAILBOX_RENAME_FAIL                 = 40011,
279
280         NOTI_CERTIFICATE_ADD                     = 50000,
281         NOTI_CERTIFICATE_DELETE                  = 50001,
282         NOTI_CERTIFICATE_UPDATE                  = 50002,
283         /* To be added more */
284 } email_noti_on_storage_event;
285
286 typedef enum
287 {
288         NOTI_SEND_START                          = 1002,
289         NOTI_SEND_FINISH                         = 1004,
290         NOTI_SEND_FAIL                           = 1005,
291         NOTI_SEND_CANCEL                         = 1003,
292
293         NOTI_DOWNLOAD_START                      = 2000,
294         NOTI_DOWNLOAD_FINISH,
295         NOTI_DOWNLOAD_FAIL,
296         NOTI_DOWNLOAD_CANCEL                     = 2004,
297         NOTI_DOWNLOAD_NEW_MAIL                   = 2003,
298
299         NOTI_DOWNLOAD_BODY_START                 = 3000,
300         NOTI_DOWNLOAD_BODY_FINISH                = 3002,
301         NOTI_DOWNLOAD_BODY_FAIL                  = 3004,
302         NOTI_DOWNLOAD_BODY_CANCEL                = 3003,
303         NOTI_DOWNLOAD_MULTIPART_BODY             = 3001,
304
305         NOTI_DOWNLOAD_ATTACH_START               = 4000,
306         NOTI_DOWNLOAD_ATTACH_FINISH,
307         NOTI_DOWNLOAD_ATTACH_FAIL,
308         NOTI_DOWNLOAD_ATTACH_CANCEL,
309
310         NOTI_MAIL_DELETE_ON_SERVER_FAIL          = 5000,
311         NOTI_MAIL_MOVE_ON_SERVER_FAIL,
312
313         NOTI_SEARCH_ON_SERVER_START              = 6000,
314         NOTI_SEARCH_ON_SERVER_FINISH             = 6001,
315         NOTI_SEARCH_ON_SERVER_FAIL               = 6002,
316         NOTI_SEARCH_ON_SERVER_CANCEL             = 6003,
317
318         NOTI_VALIDATE_ACCOUNT_FINISH             = 7000,
319         NOTI_VALIDATE_ACCOUNT_FAIL,
320         NOTI_VALIDATE_ACCOUNT_CANCEL,
321
322         NOTI_VALIDATE_AND_CREATE_ACCOUNT_FINISH  = 8000,
323         NOTI_VALIDATE_AND_CREATE_ACCOUNT_FAIL,
324         NOTI_VALIDATE_AND_CREATE_ACCOUNT_CANCEL,
325
326         NOTI_VALIDATE_AND_UPDATE_ACCOUNT_FINISH  = 9000,
327         NOTI_VALIDATE_AND_UPDATE_ACCOUNT_FAIL,
328         NOTI_VALIDATE_AND_UPDATE_ACCOUNT_CANCEL,
329
330         NOTI_VALIDATE_CERTIFICATE_FINISH         = 10000,
331         NOTI_VALIDATE_CERTIFICATE_FAIL           = 10001,
332         NOTI_VALIDATE_CERTIFICATE_CANCEL         = 10002,
333
334         NOTI_RESOLVE_RECIPIENT_START             = 11000,
335         NOTI_RESOLVE_RECIPIENT_FINISH,
336         NOTI_RESOLVE_RECIPIENT_FAIL,
337         NOTI_RESOLVE_RECIPIENT_CANCEL,
338
339         NOTI_RENAME_MAILBOX_START                = 12000,
340         NOTI_RENAME_MAILBOX_FINISH,
341         NOTI_RENAME_MAILBOX_FAIL,
342         NOTI_RENAME_MAILBOX_CANCEL,
343
344         NOTI_ADD_MAILBOX_START                   = 12100,
345         NOTI_ADD_MAILBOX_FINISH,
346         NOTI_ADD_MAILBOX_FAIL,
347         NOTI_ADD_MAILBOX_CANCEL,
348
349         NOTI_DELETE_MAILBOX_START                = 12200,
350         NOTI_DELETE_MAILBOX_FINISH,
351         NOTI_DELETE_MAILBOX_FAIL,
352         NOTI_DELETE_MAILBOX_CANCEL,
353
354         NOTI_SYNC_IMAP_MAILBOX_LIST_START        = 12300,
355         NOTI_SYNC_IMAP_MAILBOX_LIST_FINISH,
356         NOTI_SYNC_IMAP_MAILBOX_LIST_FAIL,
357         NOTI_SYNC_IMAP_MAILBOX_LIST_CANCEL,
358
359         NOTI_DELETE_MAIL_START        = 12300,
360         NOTI_DELETE_MAIL_FINISH,
361         NOTI_DELETE_MAIL_FAIL,
362         NOTI_DELETE_MAIL_CANCEL,
363
364         /* To be added more */
365 } email_noti_on_network_event;
366
367 typedef enum
368 {
369         RESPONSE_SUCCEEDED                       = 0,
370         RESPONSE_FAILED                          = 1,
371         RESPONSE_CANCELED                        = 2
372         /* To be added more */
373 } email_response_to_request;
374
375 /**
376  * This enumeration specifies the mail type of account.
377  */
378 typedef enum
379 {
380         EMAIL_BIND_TYPE_DISABLE          = 0,          /**< Specifies the bind type for Disabled account.*/
381         EMAIL_BIND_TYPE_EM_CORE          = 1,          /**< Specifies the bind type for email-service .*/
382 } email_account_bind_t DEPRECATED;
383
384 /**
385  * This enumeration specifies the server type of account.
386  */
387 typedef enum
388 {
389         EMAIL_SERVER_TYPE_POP3           = 1,          /**< Specifies the POP3 Server.*/
390         EMAIL_SERVER_TYPE_IMAP4,                       /**< Specifies the IMAP4 Server.*/
391         EMAIL_SERVER_TYPE_SMTP,                        /**< Specifies the SMTP Server.*/
392         EMAIL_SERVER_TYPE_NONE,                        /**< Specifies the Local.*/
393         EMAIL_SERVER_TYPE_ACTIVE_SYNC,                 /** < Specifies the Active Sync.  */
394 } email_account_server_t;
395
396 /**
397  * This enumeration specifies the mode of retrieval.
398  */
399 typedef enum
400 {
401         EMAIL_IMAP4_RETRIEVAL_MODE_NEW   = 0,          /**< Specifies the retrieval mode for new email.*/
402         EMAIL_IMAP4_RETRIEVAL_MODE_ALL,                /**< Specifies the retrieval mode for all email.*/
403 } email_imap4_retrieval_mode_t;
404
405 /**
406  * This enumeration specifies the filtering type.
407  */
408 typedef enum
409 {
410         EMAIL_FILTER_FROM                = 1,          /**< Specifies the filtering of sender.*/
411         EMAIL_FILTER_SUBJECT,                          /**< Specifies the filtering of email subject.*/
412         EMAIL_FILTER_BODY,                             /**< Specifies the filterinf of email body.*/
413         EMAIL_PRIORITY_SENDER,                         /**< Specifies the priority sender of email. */
414 } email_rule_type_t;
415
416
417 /**
418  * This enumeration specifies the rules for filtering type.
419  */
420 typedef enum
421 {
422         RULE_TYPE_INCLUDES             = 1,          /**< Specifies the filtering rule for includes.*/
423         RULE_TYPE_EXACTLY,                           /**< Specifies the filtering rule for Exactly same as.*/
424 } email_filtering_type_t;
425
426
427 /**
428  * This enumeration specifies the action for filtering type.
429  */
430 typedef enum
431 {
432         EMAIL_FILTER_MOVE                = 1,          /**< Specifies the move of email.*/
433         EMAIL_FILTER_BLOCK               = 2,          /**< Specifies the block of email.*/
434         EMAIL_FILTER_DELETE              = 3,          /**< Specifies delete email.*/
435 } email_rule_action_t;
436
437 /**
438  * This enumeration specifies the email status.
439  */
440 typedef enum
441 {
442         EMAIL_MAIL_STATUS_NONE           = 0,          /**< The Mail is in No Operation state */
443         EMAIL_MAIL_STATUS_RECEIVED,                    /**< The mail is a received mail.*/
444         EMAIL_MAIL_STATUS_SENT,                        /**< The mail is a sent mail.*/
445         EMAIL_MAIL_STATUS_SAVED,                       /**< The mail is a saved mail.*/
446         EMAIL_MAIL_STATUS_SAVED_OFFLINE,               /**< The mail is a saved mail in off-line mode.*/
447         EMAIL_MAIL_STATUS_SENDING,                     /**< The mail is being sent.*/
448         EMAIL_MAIL_STATUS_SEND_FAILURE,                /**< The mail is a mail to been failed to send.*/
449         EMAIL_MAIL_STATUS_SEND_CANCELED,               /**< The mail is a canceled mail.*/
450         EMAIL_MAIL_STATUS_SEND_WAIT,                   /**< The mail is a mail to be send .*/
451         EMAIL_MAIL_STATUS_SEND_SCHEDULED,              /**< The mail is a scheduled mail to be send later.*/
452 } email_mail_status_t;
453
454 /**
455  * This enumeration specifies the email priority.
456  */
457 typedef enum
458 {
459         EMAIL_MAIL_PRIORITY_HIGH         = 1,          /**< The priority is high.*/
460         EMAIL_MAIL_PRIORITY_NORMAL       = 3,          /**< The priority is normal.*/
461         EMAIL_MAIL_PRIORITY_LOW          = 5,          /**< The priority is low.*/
462 } email_mail_priority_t;
463
464 /**
465  * This enumeration specifies the email status.
466  */
467 typedef enum
468 {
469         EMAIL_MAIL_REPORT_NONE           = 0x00,       /**< The mail isn't report mail.*/
470         EMAIL_MAIL_REPORT_REQUEST        = 0x03,       /* Deprecated */
471         EMAIL_MAIL_REPORT_DSN            = 0x04,       /**< The mail is a Delivery Status Notifications mail.*/
472         EMAIL_MAIL_REPORT_MDN            = 0x08,       /**< The mail is a Message Disposition Notifications mail.*/
473         EMAIL_MAIL_REQUEST_DSN           = 0x10,       /**< The mail requires Delivery Status Notifications.*/
474         EMAIL_MAIL_REQUEST_MDN           = 0x20,       /**< The mail requires Message Disposition Notifications.*/
475 } email_mail_report_t;
476
477 /**
478  * This enumeration specifies the DRM type
479  */
480 typedef enum
481 {
482         EMAIL_ATTACHMENT_DRM_NONE        = 0,          /**< The mail isn't DRM file.*/
483         EMAIL_ATTACHMENT_DRM_OBJECT,                   /**< The mail is a DRM object.*/
484         EMAIL_ATTACHMENT_DRM_RIGHTS,                   /**< The mail is a DRM rights as XML format.*/
485         EMAIL_ATTACHMENT_DRM_DCF,                      /**< The mail is a DRM DCF.*/
486 } email_attachment_drm_t;
487
488 /**
489  * This enumeration specifies the mail type
490  */
491 typedef enum
492 {
493         EMAIL_MAIL_TYPE_NORMAL                     = 0, /**< NOT a meeting request mail. A Normal mail */
494         EMAIL_MAIL_TYPE_MEETING_REQUEST            = 1, /**< a meeting request mail from a serve */
495         EMAIL_MAIL_TYPE_MEETING_RESPONSE           = 2, /**< a response mail about meeting request */
496         EMAIL_MAIL_TYPE_MEETING_ORIGINATINGREQUEST = 3  /**< a originating mail about meeting request */
497 } email_mail_type_t;
498
499 /**
500  * This enumeration specifies the meeting response type
501  */
502 typedef enum
503 {
504         EMAIL_MEETING_RESPONSE_NONE                = 0, /**< NOT response */
505         EMAIL_MEETING_RESPONSE_ACCEPT              = 1, /**< The response is acceptance */
506         EMAIL_MEETING_RESPONSE_TENTATIVE           = 2, /**< The response is tentative */
507         EMAIL_MEETING_RESPONSE_DECLINE             = 3, /**< The response is decline */
508         EMAIL_MEETING_RESPONSE_REQUEST             = 4, /**< The response is request */
509         EMAIL_MEETING_RESPONSE_CANCEL              = 5, /**< The response is cancellation */
510 } email_meeting_response_t;
511
512 typedef enum
513 {
514         EMAIL_ACTION_SEND_MAIL                     =  0,
515         EMAIL_ACTION_SYNC_HEADER                   =  1,
516         EMAIL_ACTION_DOWNLOAD_BODY                 =  2,
517         EMAIL_ACTION_DOWNLOAD_ATTACHMENT           =  3,
518         EMAIL_ACTION_DELETE_MAIL                   =  4,
519         EMAIL_ACTION_SEARCH_MAIL                   =  5,
520         EMAIL_ACTION_SAVE_MAIL                     =  6,
521         EMAIL_ACTION_SYNC_MAIL_FLAG_TO_SERVER      =  7,
522         EMAIL_ACTION_SYNC_FLAGS_FIELD_TO_SERVER    =  8,
523         EMAIL_ACTION_MOVE_MAIL                     =  9,
524         EMAIL_ACTION_CREATE_MAILBOX                = 10,
525         EMAIL_ACTION_DELETE_MAILBOX                = 11,
526         EMAIL_ACTION_SYNC_HEADER_OMA               = 12,
527         EMAIL_ACTION_VALIDATE_ACCOUNT              = 13,
528         EMAIL_ACTION_VALIDATE_AND_CREATE_ACCOUNT   = 14,
529         EMAIL_ACTION_VALIDATE_AND_UPDATE_ACCOUNT   = 15,
530         EMAIL_ACTION_VALIDATE_ACCOUNT_EX           = 16,
531         EMAIL_ACTION_UPDATE_MAIL                   = 30,
532         EMAIL_ACTION_SET_MAIL_SLOT_SIZE            = 31,
533         EMAIL_ACTION_EXPUNGE_MAILS_DELETED_FLAGGED = 32,
534         EMAIL_ACTION_SEARCH_ON_SERVER              = 33,
535         EMAIL_ACTION_MOVE_MAILBOX                  = 34,
536         EMAIL_ACTION_NUM,
537 } email_action_t;
538
539 /**
540  * This enumeration specifies the status of getting envelope list.
541  */
542 typedef enum
543 {
544         EMAIL_LIST_NONE                  = 0,
545         EMAIL_LIST_WAITING,
546         EMAIL_LIST_PREPARE,                            /**< Specifies the preparation.*/
547         EMAIL_LIST_CONNECTION_START,                   /**< Specifies the connection start.*/
548         EMAIL_LIST_CONNECTION_SUCCEED,                 /**< Specifies the success of connection.*/
549         EMAIL_LIST_CONNECTION_FINISH,                  /**< Specifies the connection finish.*/
550         EMAIL_LIST_CONNECTION_FAIL,                    /**< Specifies the connection failure.*/
551         EMAIL_LIST_START,                              /**< Specifies the getting start.*/
552         EMAIL_LIST_PROGRESS,                           /**< Specifies the status of getting.*/
553         EMAIL_LIST_FINISH,                             /**< Specifies the getting complete.*/
554         EMAIL_LIST_FAIL,                               /**< Specifies the download failure.*/
555 } email_envelope_list_status_t;
556
557 /**
558  * This enumeration specifies the downloaded status of email.
559  */
560 typedef enum
561 {
562         EMAIL_DOWNLOAD_NONE              = 0,
563         EMAIL_DOWNLOAD_WAITING,
564         EMAIL_DOWNLOAD_PREPARE,                        /**< Specifies the preparation.*/
565         EMAIL_DOWNLOAD_CONNECTION_START,               /**< Specifies the connection start.*/
566         EMAIL_DOWNLOAD_CONNECTION_SUCCEED,             /**< Specifies the success of connection.*/
567         EMAIL_DOWNLOAD_CONNECTION_FINISH,              /**< Specifies the connection finish.*/
568         EMAIL_DOWNLOAD_CONNECTION_FAIL,                /**< Specifies the connection failure.*/
569         EMAIL_DOWNLOAD_START,                          /**< Specifies the download start.*/
570         EMAIL_DOWNLOAD_PROGRESS,                       /**< Specifies the status of download.*/
571         EMAIL_DOWNLOAD_FINISH,                         /**< Specifies the download complete.*/
572         EMAIL_DOWNLOAD_FAIL,                           /**< Specifies the download failure.*/
573 } email_download_status_t;
574
575 /**
576  * This enumeration specifies the status of sending email.
577  */
578 typedef enum
579 {
580         EMAIL_SEND_NONE                  = 0,
581         EMAIL_SEND_WAITING,
582         EMAIL_SEND_PREPARE,                            /**< Specifies the preparation.*/
583         EMAIL_SEND_CONNECTION_START,                   /**< Specifies the connection start.*/
584         EMAIL_SEND_CONNECTION_SUCCEED,                 /**< Specifies the success of connection.*/
585         EMAIL_SEND_CONNECTION_FINISH,                  /**< Specifies the connection finish.*/
586         EMAIL_SEND_CONNECTION_FAIL,                    /**< Specifies the connection failure.*/
587         EMAIL_SEND_START,                              /**< Specifies the sending start.*/
588         EMAIL_SEND_PROGRESS,                           /**< Specifies the status of sending.*/
589         EMAIL_SEND_FINISH,                             /**< Specifies the sending complete.*/
590         EMAIL_SEND_FAIL,                               /**< Specifies the sending failure.*/
591         EMAIL_SAVE_WAITING,                            /**< Specfies the Waiting of Sync */
592 } email_send_status_t;
593
594 typedef enum
595 {
596         EMAIL_SYNC_NONE                  = 0,
597         EMAIL_SYNC_WAITING,
598         EMAIL_SYNC_PREPARE,
599         EMAIL_SYNC_CONNECTION_START,
600         EMAIL_SYNC_CONNECTION_SUCCEED,
601         EMAIL_SYNC_CONNECTION_FINISH,
602         EMAIL_SYNC_CONNECTION_FAIL,
603         EMAIL_SYNC_START,
604         EMAIL_SYNC_PROGRESS,
605         EMAIL_SYNC_FINISH,
606         EMAIL_SYNC_FAIL,
607 } email_sync_status_t;
608
609 /**
610 * This enumeration specifies the deleting status of email.
611 */
612 typedef enum
613 {
614         EMAIL_DELETE_NONE                = 0,
615         EMAIL_DELETE_WAITING,
616         EMAIL_DELETE_PREPARE,                          /**< Specifies the preparation.*/
617         EMAIL_DELETE_CONNECTION_START,                 /**< Specifies the connection start.*/
618         EMAIL_DELETE_CONNECTION_SUCCEED,               /**< Specifies the success of connection.*/
619         EMAIL_DELETE_CONNECTION_FINISH,                /**< Specifies the connection finish.*/
620         EMAIL_DELETE_CONNECTION_FAIL,                  /**< Specifies the connection failure.*/
621         EMAIL_DELETE_START,                            /**< Specifies the deletion start.*/
622         EMAIL_DELETE_PROGRESS,                         /**< Specifies the status of deleting.*/
623         EMAIL_DELETE_SERVER_PROGRESS,                  /**< Specifies the status of server deleting.*/
624         EMAIL_DELETE_LOCAL_PROGRESS,                   /**< Specifies the status of local deleting.*/
625         EMAIL_DELETE_FINISH,                           /**< Specifies the deletion complete.*/
626         EMAIL_DELETE_FAIL,                             /**< Specifies the deletion failure.*/
627 } email_delete_status_t;
628
629 /**
630 * This enumeration specifies the status of validating account
631 */
632 typedef enum
633 {
634         EMAIL_VALIDATE_ACCOUNT_NONE = 0,
635         EMAIL_VALIDATE_ACCOUNT_WAITING,
636         EMAIL_VALIDATE_ACCOUNT_PREPARE,                /**< Specifies the preparation.*/
637         EMAIL_VALIDATE_ACCOUNT_CONNECTION_START,       /**< Specifies the connection start.*/
638         EMAIL_VALIDATE_ACCOUNT_CONNECTION_SUCCEED,     /**< Specifies the success of connection.*/
639         EMAIL_VALIDATE_ACCOUNT_CONNECTION_FINISH,      /**< Specifies the connection finish.*/
640         EMAIL_VALIDATE_ACCOUNT_CONNECTION_FAIL,        /**< Specifies the connection failure.*/
641         EMAIL_VALIDATE_ACCOUNT_START,                  /**< Specifies the getting start.*/
642         EMAIL_VALIDATE_ACCOUNT_PROGRESS,               /**< Specifies the status of getting.*/
643         EMAIL_VALIDATE_ACCOUNT_FINISH,                 /**< Specifies the getting complete.*/
644         EMAIL_VALIDATE_ACCOUNT_FAIL,                   /**< Specifies the validation failure.*/
645 } email_validate_account_status_t;
646
647 typedef enum
648 {
649         EMAIL_SET_SLOT_SIZE_NONE         = 0,
650         EMAIL_SET_SLOT_SIZE_WAITING,
651         EMAIL_SET_SLOT_SIZE_START,
652         EMAIL_SET_SLOT_SIZE_FINISH,
653         EMAIL_SET_SLOT_SIZE_FAIL,
654 }email_set_slot_size_status_e;
655
656 typedef enum
657 {
658         EMAIL_EXPUNGE_MAILS_DELETED_FLAGGED_NONE         = 0,
659         EMAIL_EXPUNGE_MAILS_DELETED_FLAGGED_WAITING,
660         EMAIL_EXPUNGE_MAILS_DELETED_FLAGGED_START,
661         EMAIL_EXPUNGE_MAILS_DELETED_FLAGGED_FINISH,
662         EMAIL_EXPUNGE_MAILS_DELETED_FLAGGED_FAIL,
663 }email_expunge_mails_deleted_flagged_status_e;
664
665 typedef enum
666 {
667         EMAIL_SEARCH_ON_SERVER_NONE         = 0,
668         EMAIL_SEARCH_ON_SERVER_WAITING,
669         EMAIL_SEARCH_ON_SERVER_START,
670         EMAIL_SEARCH_ON_SERVER_FINISH,
671         EMAIL_SEARCH_ON_SERVER_FAIL,
672 }email_search_on_server_status_e;
673
674 typedef enum
675 {
676         EMAIL_MOVE_MAILBOX_ON_IMAP_SERVER_NONE         = 0,
677         EMAIL_MOVE_MAILBOX_ON_IMAP_SERVER_WAITING,
678         EMAIL_MOVE_MAILBOX_ON_IMAP_SERVER_START,
679         EMAIL_MOVE_MAILBOX_ON_IMAP_SERVER_FINISH,
680         EMAIL_MOVE_MAILBOX_ON_IMAP_SERVER_FAIL,
681 }email_move_mailbox_status_e;
682
683 typedef enum
684 {
685         EMAIL_UPDATE_MAIL_NONE         = 0,
686         EMAIL_UPDATE_MAIL_WAITING,
687         EMAIL_UPDATE_MAIL_START,
688         EMAIL_UPDATE_MAIL_FINISH,
689         EMAIL_UPDATE_MAIL_FAIL,
690 }email_update_mail_status_e;
691
692 /**
693 * This enumeration specifies the type of mailbox
694 */
695 typedef enum
696 {
697         EMAIL_MAILBOX_TYPE_NONE          = 0,         /**< Unspecified mailbox type*/
698         EMAIL_MAILBOX_TYPE_INBOX         = 1,         /**< Specified inbox type*/
699         EMAIL_MAILBOX_TYPE_SENTBOX       = 2,         /**< Specified sent box type*/
700         EMAIL_MAILBOX_TYPE_TRASH         = 3,         /**< Specified trash type*/
701         EMAIL_MAILBOX_TYPE_DRAFT         = 4,         /**< Specified draft box type*/
702         EMAIL_MAILBOX_TYPE_SPAMBOX       = 5,         /**< Specified spam box type*/
703         EMAIL_MAILBOX_TYPE_OUTBOX        = 6,         /**< Specified outbox type*/
704         EMAIL_MAILBOX_TYPE_ALL_EMAILS    = 7,         /**< Specified all emails type of gmail*/
705         EMAIL_MAILBOX_TYPE_SEARCH_RESULT = 8,         /**< Specified mailbox type for result of search on server */
706         EMAIL_MAILBOX_TYPE_FLAGGED       = 9,         /**< Specified flagged mailbox type on gmail */
707         EMAIL_MAILBOX_TYPE_USER_DEFINED  = 0xFF,      /**< Specified mailbox type for all other mailboxes */
708 }email_mailbox_type_e;
709
710 typedef enum
711 {
712         EMAIL_SYNC_LATEST_MAILS_FIRST    = 0,
713         EMAIL_SYNC_OLDEST_MAILS_FIRST,
714         EMAIL_SYNC_ALL_MAILBOX_50_MAILS,
715 } EMAIL_RETRIEVE_MODE;
716
717 /*  event type */
718 typedef enum
719 {
720         EMAIL_EVENT_NONE                            =  0,
721         EMAIL_EVENT_SYNC_HEADER                     =  1,          /*  synchronize mail headers with server (network used) */
722         EMAIL_EVENT_DOWNLOAD_BODY                   =  2,          /*  download mail body from server (network used)*/
723         EMAIL_EVENT_DOWNLOAD_ATTACHMENT             =  3,          /*  download mail attachment from server (network used) */
724         EMAIL_EVENT_SEND_MAIL                       =  4,          /*  send a mail (network used) */
725         EMAIL_EVENT_SEND_MAIL_SAVED                 =  5,          /*  send all mails in 'outbox' box (network used) */
726         EMAIL_EVENT_SYNC_IMAP_MAILBOX               =  6,          /*  download imap mailboxes from server (network used) */
727         EMAIL_EVENT_DELETE_MAIL                     =  7,          /*  delete mails (network unused) */
728         EMAIL_EVENT_DELETE_MAIL_ALL                 =  8,          /*  delete all mails (network unused) */
729         EMAIL_EVENT_SYNC_MAIL_FLAG_TO_SERVER        =  9,          /*  sync mail flag to server */
730         EMAIL_EVENT_SYNC_FLAGS_FIELD_TO_SERVER      = 10,          /*  sync a field of flags to server */
731         EMAIL_EVENT_SAVE_MAIL                       = 11,          /*  add mail on server */
732         EMAIL_EVENT_MOVE_MAIL                       = 12,          /*  move mails to specific mailbox on server */
733         EMAIL_EVENT_CREATE_MAILBOX                  = 13,
734         EMAIL_EVENT_UPDATE_MAILBOX                  = 14,
735         EMAIL_EVENT_DELETE_MAILBOX                  = 15,
736         EMAIL_EVENT_ISSUE_IDLE                      = 16,
737         EMAIL_EVENT_SYNC_HEADER_OMA                 = 17,
738         EMAIL_EVENT_VALIDATE_ACCOUNT                = 18,
739         EMAIL_EVENT_VALIDATE_AND_CREATE_ACCOUNT     = 19,
740         EMAIL_EVENT_VALIDATE_AND_UPDATE_ACCOUNT     = 20,
741         EMAIL_EVENT_SEARCH_ON_SERVER                = 21,
742         EMAIL_EVENT_RENAME_MAILBOX_ON_IMAP_SERVER   = 22,
743         EMAIL_EVENT_VALIDATE_ACCOUNT_EX             = 23,
744
745         EMAIL_EVENT_ADD_MAIL                        = 10001,       /*  Deprecated */
746         EMAIL_EVENT_UPDATE_MAIL_OLD                 = 10002,       /*  Deprecated */
747         EMAIL_EVENT_UPDATE_MAIL                     = 10003,
748         EMAIL_EVENT_SET_MAIL_SLOT_SIZE              = 20000,
749         EMAIL_EVENT_EXPUNGE_MAILS_DELETED_FLAGGED   = 20001,
750
751 /*      EMAIL_EVENT_LOCAL_ACTIVITY,                     __LOCAL_ACTIVITY_ */
752
753         EMAIL_EVENT_BULK_PARTIAL_BODY_DOWNLOAD      = 20002,       /*  __FEATURE_PARTIAL_BODY_DOWNLOAD__ supported */
754         EMAIL_EVENT_LOCAL_ACTIVITY_SYNC_BULK_PBD    = 20003,       /*  __FEATURE_PARTIAL_BODY_DOWNLOAD__ supported */
755         EMAIL_EVENT_GET_PASSWORD_LENGTH             = 20004,       /*  get password length of an account */
756 } email_event_type_t;
757
758 /*  event status */
759 typedef enum
760 {
761         EMAIL_EVENT_STATUS_UNUSED        = 0,
762         EMAIL_EVENT_STATUS_WAIT,
763         EMAIL_EVENT_STATUS_STARTED,
764         EMAIL_EVENT_STATUS_CANCELED,
765 } email_event_status_type_t;
766
767
768 /* sorting_orde */
769 typedef enum
770 {
771         EMAIL_SORT_DATETIME_HIGH         = 0,
772         EMAIL_SORT_DATETIME_LOW,
773         EMAIL_SORT_SENDER_HIGH,
774         EMAIL_SORT_SENDER_LOW,
775         EMAIL_SORT_RCPT_HIGH,
776         EMAIL_SORT_RCPT_LOW,
777         EMAIL_SORT_SUBJECT_HIGH,
778         EMAIL_SORT_SUBJECT_LOW,
779         EMAIL_SORT_PRIORITY_HIGH,
780         EMAIL_SORT_PRIORITY_LOW,
781         EMAIL_SORT_ATTACHMENT_HIGH,
782         EMAIL_SORT_ATTACHMENT_LOW,
783         EMAIL_SORT_FAVORITE_HIGH,
784         EMAIL_SORT_FAVORITE_LOW,
785         EMAIL_SORT_MAILBOX_NAME_HIGH,
786         EMAIL_SORT_MAILBOX_NAME_LOW,
787         EMAIL_SORT_FLAGGED_FLAG_HIGH,
788         EMAIL_SORT_FLAGGED_FLAG_LOW,
789         EMAIL_SORT_SEEN_FLAG_HIGH,
790         EMAIL_SORT_SEEN_FLAG_LOW,
791         EMAIL_SORT_END,
792 }email_sort_type_t;
793
794 typedef enum
795 {
796         EMAIL_MAILBOX_SORT_BY_NAME_ASC  = 0,
797         EMAIL_MAILBOX_SORT_BY_NAME_DSC,
798         EMAIL_MAILBOX_SORT_BY_TYPE_ASC,
799         EMAIL_MAILBOX_SORT_BY_TYPE_DSC,
800 } email_mailbox_sort_type_t;
801
802
803 /**
804 * This enumeration specifies the priority.
805 */
806 enum
807 {
808         EMAIL_OPTION_PRIORITY_HIGH       = 1,          /**< Specifies the high priority.*/
809         EMAIL_OPTION_PRIORITY_NORMAL     = 3,          /**< Specifies the normal priority*/
810         EMAIL_OPTION_PRIORITY_LOW        = 5,          /**< Specifies the low priority.*/
811 };
812
813 /**
814 * This enumeration specifies the saving save a copy after sending.
815 */
816 enum
817 {
818         EMAIL_OPTION_KEEP_LOCAL_COPY_OFF = 0,          /**< Specifies off the keeping local copy.*/
819         EMAIL_OPTION_KEEP_LOCAL_COPY_ON  = 1,          /**< Specifies on the keeping local copy.*/
820 };
821
822 /**
823 * This enumeration specifies the request of delivery report.
824 */
825 enum
826 {
827         EMAIL_OPTION_REQ_DELIVERY_RECEIPT_OFF = 0,     /**< Specifies off the requesting delivery receipt.*/
828         EMAIL_OPTION_REQ_DELIVERY_RECEIPT_ON  = 1,     /**< Specifies on the requesting delivery receipt.*/
829 };
830
831 /**
832 * This enumeration specifies the request of read receipt.
833 */
834 enum
835 {
836         EMAIL_OPTION_REQ_READ_RECEIPT_OFF = 0,         /**< Specifies off the requesting read receipt.*/
837         EMAIL_OPTION_REQ_READ_RECEIPT_ON  = 1,         /**< Specifies on the requesting read receipt.*/
838 };
839
840 /**
841 * This enumeration specifies the blocking of address.
842 */
843 enum
844 {
845         EMAIL_OPTION_BLOCK_ADDRESS_OFF   = 0,          /**< Specifies off the blocking by address.*/
846         EMAIL_OPTION_BLOCK_ADDRESS_ON    = 1,          /**< Specifies on the blocking by address.*/
847 };
848
849 /**
850 * This enumeration specifies the blocking of subject.
851 */
852 enum
853 {
854         EMAIL_OPTION_BLOCK_SUBJECT_OFF   = 0,          /**< Specifies off the blocking by subject.*/
855         EMAIL_OPTION_BLOCK_SUBJECT_ON    = 1,          /**< Specifies on the blocking by subject.*/
856 };
857
858 enum
859 {
860         EMAIL_LIST_TYPE_UNREAD           = -3,
861         EMAIL_LIST_TYPE_LOCAL            = -2,
862         EMAIL_LIST_TYPE_THREAD           = -1,
863         EMAIL_LIST_TYPE_NORMAL           = 0
864 };
865
866 /**
867 * This enumeration specifies the mailbox sync type.
868 */
869 enum
870 {
871         EMAIL_MAILBOX_ALL                = -1,         /**< All mailboxes.*/
872         EMAIL_MAILBOX_FROM_SERVER        = 0,          /**< Mailboxes from server. */
873         EMAIL_MAILBOX_FROM_LOCAL         = 1,          /**< Mailboxes from local. */
874 };
875
876 typedef enum
877 {
878         APPEND_BODY                    = 1,
879         UPDATE_MAILBOX,
880         UPDATE_ATTACHMENT_INFO,
881         UPDATE_FLAG,
882         UPDATE_SAVENAME,
883         UPDATE_EXTRA_FLAG,
884         UPDATE_MAIL,
885         UPDATE_DATETIME,
886         UPDATE_FROM_CONTACT_INFO,
887         UPDATE_TO_CONTACT_INFO,
888         UPDATE_ALL_CONTACT_NAME,
889         UPDATE_ALL_CONTACT_INFO,
890         UPDATE_STICKY_EXTRA_FLAG,
891         UPDATE_PARTIAL_BODY_DOWNLOAD,
892         UPDATE_MEETING,
893         UPDATE_SEEN_FLAG_OF_THREAD,
894         UPDATE_FILE_PATH,
895 } email_mail_change_type_t; // Should be moved intenal types */
896
897
898 /**
899 * This enumeration specifies the address type.
900 */
901 typedef enum
902 {
903         EMAIL_ADDRESS_TYPE_FROM          = 1,          /**< Specifies the from address.*/
904         EMAIL_ADDRESS_TYPE_TO,                         /**< Specifies the to recipient address.*/
905         EMAIL_ADDRESS_TYPE_CC,                         /**< Specifies the cc recipient address.*/
906         EMAIL_ADDRESS_TYPE_BCC,                        /**< Specifies the bcc recipient address.*/
907         EMAIL_ADDRESS_TYPE_REPLY,                      /**< Specifies the reply recipient address.*/
908         EMAIL_ADDRESS_TYPE_RETURN,                     /**< Specifies the return recipient address.*/
909 } email_address_type_t;
910
911 /**
912  * This enumeration specifies the search type for searching mailbox.
913  */
914 typedef enum
915 {
916         EMAIL_MAILBOX_SEARCH_KEY_TYPE_SUBJECT,         /**< The search key is for searching subject.*/
917         EMAIL_MAILBOX_SEARCH_KEY_TYPE_FROM,            /**< The search key is for searching sender address.*/
918         EMAIL_MAILBOX_SEARCH_KEY_TYPE_BODY,            /**< The search key is for searching body.*/
919         EMAIL_MAILBOX_SEARCH_KEY_TYPE_TO,              /**< The search key is for searching recipient address.*/
920 } email_mailbox_search_key_t;
921
922 /**
923  * This enumeration specifies the download status of mail body.
924  */
925
926 typedef enum
927 {
928         EMAIL_BODY_DOWNLOAD_STATUS_NONE = 0,
929         EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED = 1,
930         EMAIL_BODY_DOWNLOAD_STATUS_PARTIALLY_DOWNLOADED = 2,
931 } email_body_download_status_t;
932
933 /**
934  * This enumeration specifies the moving type.
935  */
936 typedef enum
937 {
938         EMAIL_MOVED_BY_COMMAND = 0,
939         EMAIL_MOVED_BY_MOVING_THREAD,
940         EMAIL_MOVED_AFTER_SENDING,
941         EMAIL_MOVED_CANCELATION_MAIL
942 } email_move_type;
943
944 /**
945  * This enumeration specifies the deletion type.
946  */
947 typedef enum
948 {
949         EMAIL_DELETED_BY_COMMAND = 0,
950         EMAIL_DELETED_BY_OVERFLOW,
951         EMAIL_DELETED_BY_DELETING_THREAD,
952         EMAIL_DELETED_BY_MOVING_TO_OTHER_ACCOUNT,
953         EMAIL_DELETED_AFTER_SENDING,
954         EMAIL_DELETED_FROM_SERVER,
955 } email_delete_type;
956
957 /**
958  * This enumeration specifies the status field type.
959  */
960 typedef enum
961 {
962         EMAIL_FLAGS_SEEN_FIELD = 0,
963         EMAIL_FLAGS_DELETED_FIELD,
964         EMAIL_FLAGS_FLAGGED_FIELD,
965         EMAIL_FLAGS_ANSWERED_FIELD,
966         EMAIL_FLAGS_RECENT_FIELD,
967         EMAIL_FLAGS_DRAFT_FIELD,
968         EMAIL_FLAGS_FORWARDED_FIELD,
969         EMAIL_FLAGS_FIELD_COUNT,
970 } email_flags_field_type;
971
972 typedef enum {
973         EMAIL_FLAG_NONE                  = 0,
974         EMAIL_FLAG_FLAGED                = 1,
975         EMAIL_FLAG_TASK_STATUS_CLEAR     = 2,
976         EMAIL_FLAG_TASK_STATUS_COMPLETE  = 3,
977         EMAIL_FLAG_TASK_STATUS_ACTIVE    = 4,
978 } email_flagged_type;
979
980 typedef enum {
981         EMAIL_SEARCH_FILTER_TYPE_MESSAGE_NO       =  1,  /* integer type */
982         EMAIL_SEARCH_FILTER_TYPE_UID              =  2,  /* integer type */
983         EMAIL_SEARCH_FILTER_TYPE_BCC              =  7,  /* string type */
984         EMAIL_SEARCH_FILTER_TYPE_CC               =  9,  /* string type */
985         EMAIL_SEARCH_FILTER_TYPE_FROM             = 10,  /* string type */
986         EMAIL_SEARCH_FILTER_TYPE_KEYWORD          = 11,  /* string type */
987         EMAIL_SEARCH_FILTER_TYPE_SUBJECT          = 13,  /* string type */
988         EMAIL_SEARCH_FILTER_TYPE_TO               = 15,  /* string type */
989         EMAIL_SEARCH_FILTER_TYPE_SIZE_LARSER      = 16,  /* integer type */
990         EMAIL_SEARCH_FILTER_TYPE_SIZE_SMALLER     = 17,  /* integer type */
991         EMAIL_SEARCH_FILTER_TYPE_SENT_DATE_BEFORE = 20,  /* time type */
992         EMAIL_SEARCH_FILTER_TYPE_SENT_DATE_ON     = 21,  /* time type */
993         EMAIL_SEARCH_FILTER_TYPE_SENT_DATE_SINCE  = 22,  /* time type */
994         EMAIL_SEARCH_FILTER_TYPE_FLAGS_ANSWERED   = 26,  /* integer type */
995         EMAIL_SEARCH_FILTER_TYPE_FLAGS_DELETED    = 28,  /* integer type */
996         EMAIL_SEARCH_FILTER_TYPE_FLAGS_DRAFT      = 30,  /* integer type */
997         EMAIL_SEARCH_FILTER_TYPE_FLAGS_FLAGED     = 32,  /* integer type */
998         EMAIL_SEARCH_FILTER_TYPE_FLAGS_RECENT     = 34,  /* integer type */
999         EMAIL_SEARCH_FILTER_TYPE_FLAGS_SEEN       = 36,  /* integer type */
1000         EMAIL_SEARCH_FILTER_TYPE_MESSAGE_ID       = 43,  /* string type */
1001 } email_search_filter_type;
1002
1003 typedef enum {
1004         EMAIL_DRM_TYPE_NONE                       = 0,
1005         EMAIL_DRM_TYPE_OBJECT                     = 1,
1006         EMAIL_DRM_TYPE_RIGHT                      = 2,
1007         EMAIL_DRM_TYPE_DCF                        = 3
1008 } email_drm_type;
1009
1010 typedef enum {
1011         EMAIL_DRM_METHOD_NONE                     = 0,
1012         EMAIL_DRM_METHOD_FL                       = 1,
1013         EMAIL_DRM_METHOD_CD                       = 2,
1014         EMAIL_DRM_METHOD_SSD                      = 3,
1015         EMAIL_DRM_METHOD_SD                       = 4
1016 } email_drm_method;
1017
1018 typedef enum {
1019         EMAIL_CANCELED_BY_USER                    = 0,
1020         EMAIL_CANCELED_BY_MDM                     = 1,
1021 } email_cancelation_type;
1022
1023 typedef enum {
1024         EMAIL_MAIL_ATTRIBUTE_MAIL_ID                 =  0,  /* integer type */
1025         EMAIL_MAIL_ATTRIBUTE_ACCOUNT_ID              =  1,  /* integer type */
1026         EMAIL_MAIL_ATTRIBUTE_MAILBOX_ID              =  2,  /* integer type */
1027         EMAIL_MAIL_ATTRIBUTE_MAILBOX_NAME            =  3,  /* string type */
1028         EMAIL_MAIL_ATTRIBUTE_MAILBOX_TYPE            =  4,  /* integer type */
1029         EMAIL_MAIL_ATTRIBUTE_SUBJECT                 =  5,  /* string type */
1030         EMAIL_MAIL_ATTRIBUTE_DATE_TIME               =  6,  /* datetime type */
1031         EMAIL_MAIL_ATTRIBUTE_SERVER_MAIL_STATUS      =  7,  /* integer type */
1032         EMAIL_MAIL_ATTRIBUTE_SERVER_MAILBOX_NAME     =  8,  /* string type */
1033         EMAIL_MAIL_ATTRIBUTE_SERVER_MAIL_ID          =  9,  /* string type */
1034         EMAIL_MAIL_ATTRIBUTE_MESSAGE_ID              = 10,  /* string type */
1035         EMAIL_MAIL_ATTRIBUTE_REFERENCE_MAIL_ID       = 11,  /* integer type */
1036         EMAIL_MAIL_ATTRIBUTE_FROM                    = 12,  /* string type */
1037         EMAIL_MAIL_ATTRIBUTE_TO                      = 13,  /* string type */
1038         EMAIL_MAIL_ATTRIBUTE_CC                      = 14,  /* string type */
1039         EMAIL_MAIL_ATTRIBUTE_BCC                     = 15,  /* string type */
1040         EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS    = 16,  /* integer type */
1041         EMAIL_MAIL_ATTRIBUTE_FILE_PATH_PLAIN         = 17,  /* string type */
1042         EMAIL_MAIL_ATTRIBUTE_FILE_PATH_HTML          = 18,  /* string type */
1043         EMAIL_MAIL_ATTRIBUTE_FILE_SIZE               = 19,  /* integer type */
1044         EMAIL_MAIL_ATTRIBUTE_FLAGS_SEEN_FIELD        = 20,  /* integer type */
1045         EMAIL_MAIL_ATTRIBUTE_FLAGS_DELETED_FIELD     = 21,  /* integer type */
1046         EMAIL_MAIL_ATTRIBUTE_FLAGS_FLAGGED_FIELD     = 22,  /* integer type */
1047         EMAIL_MAIL_ATTRIBUTE_FLAGS_ANSWERED_FIELD    = 23,  /* integer type */
1048         EMAIL_MAIL_ATTRIBUTE_FLAGS_RECENT_FIELD      = 24,  /* integer type */
1049         EMAIL_MAIL_ATTRIBUTE_FLAGS_DRAFT_FIELD       = 25,  /* integer type */
1050         EMAIL_MAIL_ATTRIBUTE_FLAGS_FORWARDED_FIELD   = 26,  /* integer type */
1051         EMAIL_MAIL_ATTRIBUTE_DRM_STATUS              = 27,  /* integer type */
1052         EMAIL_MAIL_ATTRIBUTE_PRIORITY                = 28,  /* integer type */
1053         EMAIL_MAIL_ATTRIBUTE_SAVE_STATUS             = 29,  /* integer type */
1054         EMAIL_MAIL_ATTRIBUTE_LOCK_STATUS             = 30,  /* integer type */
1055         EMAIL_MAIL_ATTRIBUTE_REPORT_STATUS           = 31,  /* integer type */
1056         EMAIL_MAIL_ATTRIBUTE_ATTACHMENT_COUNT        = 32,  /* integer type */
1057         EMAIL_MAIL_ATTRIBUTE_INLINE_CONTENT_COUNT    = 33,  /* integer type */
1058         EMAIL_MAIL_ATTRIBUTE_THREAD_ID               = 34,  /* integer type */
1059         EMAIL_MAIL_ATTRIBUTE_THREAD_ITEM_COUNT       = 35,  /* integer type */
1060         EMAIL_MAIL_ATTRIBUTE_PREVIEW_TEXT            = 36,  /* string type */
1061         EMAIL_MAIL_ATTRIBUTE_MEETING_REQUEST_STATUS  = 37,  /* integer type */
1062         EMAIL_MAIL_ATTRIBUTE_MESSAGE_CLASS           = 38,  /* integer type */
1063         EMAIL_MAIL_ATTRIBUTE_DIGEST_TYPE             = 39,  /* integer type */
1064         EMAIL_MAIL_ATTRIBUTE_SMIME_TYPE              = 40,  /* integer type */
1065         EMAIL_MAIL_ATTRIBUTE_SCHEDULED_SENDING_TIME  = 41,  /* integer type */
1066         EMAIL_MAIL_ATTRIBUTE_EAS_DATA_LENGTH_TYPE    = 42,  /* integer type */
1067         EMAIL_MAIL_ATTRIBUTE_EAS_DATA_TYPE           = 43,  /* binary type */
1068         EMAIL_MAIL_ATTRIBUTE_END                         
1069 } email_mail_attribute_type;
1070
1071 typedef enum {
1072         EMAIL_MAIL_ATTRIBUTE_VALUE_TYPE_NONE         = 0,
1073         EMAIL_MAIL_ATTRIBUTE_VALUE_TYPE_INTEGER      = 1,
1074         EMAIL_MAIL_ATTRIBUTE_VALUE_TYPE_STRING       = 2,
1075         EMAIL_MAIL_ATTRIBUTE_VALUE_TYPE_TIME         = 3,
1076         EMAIL_MAIL_ATTRIBUTE_VALUE_TYPE_BINARY       = 4
1077 } email_mail_attribute_value_type;
1078
1079 typedef enum {
1080         EMAIL_ADD_MY_ADDRESS_OPTION_DO_NOT_ADD            = 0,
1081         EMAIL_ADD_MY_ADDRESS_OPTION_ALWAYS_ADD_TO_CC      = 1,
1082         EMAIL_ADD_MY_ADDRESS_OPTION_ALWAYS_ADD_TO_BCC     = 2,
1083 } email_add_my_address_option_type;
1084
1085 typedef enum {
1086         EMAIL_MESSAGE_CLASS_UNSPECIFIED,
1087         EMAIL_MESSAGE_CLASS_UNKNOWN,
1088         EMAIL_MESSAGE_CLASS_NOTE,
1089         EMAIL_MESSAGE_CLASS_NOTE_RULES_OF_TEMPLATE_MICROSOFT,
1090         EMAIL_MESSAGE_CLASS_NOTE_SMIME,
1091         EMAIL_MESSAGE_CLASS_NOTE_SMIME_MULTIPART_SIGNED,
1092         EMAIL_MESSAGE_CLASS_NOTIFICATION_MEETING,
1093         EMAIL_MESSAGE_CLASS_OCTEL_VOICE,
1094         EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_REQUEST,
1095         EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_CANCELED,
1096         EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_RESP_POS,
1097         EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_RESP_TENT,
1098         EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_RESP_NEG,
1099         EMAIL_MESSAGE_CLASS_POST,
1100         EMAIL_MESSAGE_CLASS_INFO_PATH_FORM,
1101         EMAIL_MESSAGE_CLASS_VOICE_NOTES,
1102         EMAIL_MESSAGE_CLASS_SHARING,
1103         EMAIL_MESSAGE_CLASS_NOTE_EXCHANGE_ACTIVE_SYNC_REMOTE_WIPE_CONFIRMATION,
1104         EMAIL_MESSAGE_CLASS_VOICE_MAIL,
1105         EMAIL_MESSAGE_CLASS_SMS,
1106         EMAIL_MESSAGE_CLASS_IRM_MESSAGE                                         = 0x00100000,
1107         EMAIL_MESSAGE_CLASS_SMART_REPLY                                         = 0x01000000,
1108         EMAIL_MESSAGE_CLASS_SMART_FORWARD                                       = 0x02000000,
1109         EMAIL_MESSAGE_CLASS_REPORT_NOT_READ_REPORT                              = 0x10000000,
1110         EMAIL_MESSAGE_CLASS_REPORT_READ_REPORT                                  = 0x20000000,
1111         EMAIL_MESSAGE_CLASS_REPORT_NON_DELIVERY_RECEIPT                         = 0x40000000,
1112         EMAIL_MESSAGE_CLASS_REPORT_DELIVERY_RECEIPT                             = 0x80000000,
1113 } email_message_class; 
1114
1115 typedef enum{
1116         EMAIL_SMIME_NONE                          = 0,   /* Not use smime */
1117         EMAIL_SMIME_SIGNED,                               
1118         EMAIL_SMIME_ENCRYPTED,
1119         EMAIL_SMIME_SIGNED_AND_ENCRYPTED,
1120 } email_smime_type;
1121
1122 typedef enum {
1123         CIPHER_TYPE_DES3                          = 0,
1124         CIPHER_TYPE_DES,
1125         CIPHER_TYPE_RC2_128,
1126         CIPHER_TYPE_RC2_64,
1127         CIPHER_TYPE_RC2_40,                       
1128 } email_cipher_type;
1129
1130 typedef enum {
1131         DIGEST_TYPE_SHA1                          = 0,
1132         DIGEST_TYPE_MD5,
1133 } email_digest_type;
1134
1135 /*****************************************************************************/
1136 /*  Data Structures                                                          */
1137 /*****************************************************************************/
1138
1139 /**
1140  * This structure is used to save mail time.
1141  */
1142 typedef struct
1143 {
1144         unsigned short year;                         /**< Specifies the Year.*/
1145         unsigned short month;                        /**< Specifies the Month.*/
1146         unsigned short day;                          /**< Specifies the Day.*/
1147         unsigned short hour;                         /**< Specifies the Hour.*/
1148         unsigned short minute;                       /**< Specifies the Minute.*/
1149         unsigned short second;                       /**< Specifies the Second.*/
1150 } email_datetime_t DEPRECATED;
1151
1152 /**
1153  * This structure is used to save the options.
1154  */
1155 typedef struct
1156 {
1157         email_mail_priority_t              priority;               /**< Specifies the prority. 1=high 3=normal 5=low.*/
1158         int                                keep_local_copy;        /**< Specifies the saving save a copy after sending.*/
1159         int                                req_delivery_receipt;   /**< Specifies the request of delivery report. 0=off 1=on*/
1160         int                                req_read_receipt;       /**< Specifies the request of read receipt. 0=off 1=on*/
1161         int                                download_limit;         /**< Specifies the limit of size for downloading.*/
1162         int                                block_address;          /**< Specifies the blocking of address. 0=off 1=on*/
1163         int                                block_subject;          /**< Specifies the blocking of subject. 0=off 1=on*/
1164         char                              *display_name_from;      /**< Specifies the display name of from.*/
1165         int                                reply_with_body;        /**< Specifies the replying with body 0=off 1=on*/
1166         int                                forward_with_files;     /**< Specifies the fowarding with files 0=off 1=on*/
1167         int                                add_myname_card;        /**< Specifies the adding name card 0=off 1=on*/
1168         int                                add_signature;          /**< Specifies the adding signature 0=off 1=on*/
1169         char                              *signature;              /**< Specifies the signature*/
1170         email_add_my_address_option_type   add_my_address_to_bcc;  /**< Specifies whether cc or bcc field should be always filled with my address. */
1171 } email_option_t;
1172
1173 /**
1174  * This structure is used to save the information of email account.
1175  */
1176 typedef struct
1177 {
1178         /* General account information */
1179         int                          account_id;                               /**< Account id  */
1180         char                        *account_name;                             /**< Account name */
1181         int                          account_svc_id;                           /**< AccountSvc priv data: Specifies id from account-svc */
1182         int                          sync_status;                              /**< Sync Status. SYNC_STATUS_FINISHED, SYNC_STATUS_SYNCING, SYNC_STATUS_HAVE_NEW_MAILS */
1183         int                          sync_disabled;                            /**< If this attriube is set as true, email-service will not synchronize this account. */
1184         int                          default_mail_slot_size;
1185         char                        *logo_icon_path;                           /**< account logo icon (used by account svc and email app) */
1186         void                        *user_data;                                /**< binary user data */
1187         int                                          user_data_length;                         /**< user data length */
1188
1189         /* User information */
1190         char                            *user_display_name;                        /**< User's display */
1191         char                            *user_email_address;                       /**< User's email address */
1192         char                        *reply_to_address;                         /**< Email address for reply */
1193         char                        *return_address;                           /**< Email address for error from server*/
1194
1195         /* Configuration for incoming server */
1196         email_account_server_t       incoming_server_type;                     /**< Incoming server type */
1197         char                        *incoming_server_address;                  /**< Incoming server address */
1198         int                          incoming_server_port_number;              /**< Incoming server port number */
1199         char                        *incoming_server_user_name;                /**< Incoming server user name */
1200         char                        *incoming_server_password;                 /**< Incoming server password */
1201         int                          incoming_server_secure_connection;        /**< Does incoming server requires secured connection? */
1202
1203         /* Options for incoming server */
1204         email_imap4_retrieval_mode_t retrieval_mode;                           /**< Retrieval mode : EMAIL_IMAP4_RETRIEVAL_MODE_NEW or EMAIL_IMAP4_RETRIEVAL_MODE_ALL */
1205         int                          keep_mails_on_pop_server_after_download;  /**< Keep mails on POP server after download */
1206         int                          check_interval;                           /**< Specifies the interval for checking new mail periodically */
1207         int                          auto_download_size;                       /**< Specifies the size for auto download in bytes. -1 means entire mails body */
1208
1209         /* Configuration for outgoing server */
1210         email_account_server_t       outgoing_server_type;                     /**< Outgoing server type */
1211         char                                    *outgoing_server_address;                  /**< Outgoing server address */
1212         int                                              outgoing_server_port_number;              /**< Outgoing server port number */
1213         char                                    *outgoing_server_user_name;                /**< Outgoing server user name */
1214         char                                    *outgoing_server_password;                 /**< Outgoing server password */
1215         int                                      outgoing_server_secure_connection;        /**< Does outgoing server requires secured connection? */
1216         int                                      outgoing_server_need_authentication;      /**< Does outgoing server requires authentication? */
1217         int                                      outgoing_server_use_same_authenticator;   /**< Use same authenticator for outgoing server */
1218
1219
1220         /* Options for outgoing server */
1221         email_option_t                   options;
1222
1223         /* Authentication Options */
1224         int                              pop_before_smtp;                          /**< POP before SMTP Authentication */
1225         int                          incoming_server_requires_apop;            /**< APOP authentication */
1226
1227         /* S/MIME Options */
1228         email_smime_type             smime_type;                               /**< Specifies the smime type 0=Normal 1=Clear signed 2=encrypted 3=Signed + encrypted */
1229         char                        *certificate_path;                         /**< Specifies the certificate path of private*/
1230         email_cipher_type            cipher_type;                              /**< Specifies the encryption algorithm*/
1231         email_digest_type            digest_type;                              /**< Specifies the digest algorithm*/
1232 } email_account_t;
1233
1234 /**
1235  * This structure is used to save the information of certificate
1236  */
1237
1238 typedef struct 
1239 {
1240         int certificate_id;
1241         int issue_year;
1242         int issue_month;
1243         int issue_day;
1244         int expiration_year;
1245         int expiration_month;
1246         int expiration_day;
1247         char *issue_organization_name;
1248         char *email_address;
1249         char *subject_str;
1250         char *filepath;
1251 } email_certificate_t;
1252
1253 /**
1254  * This structure is used to save the information of email server.
1255  */
1256
1257 typedef struct
1258 {
1259         int                         configuration_id;      /**< Specifies the id of configuration.*/
1260         email_account_server_t      protocol_type;         /**< Specifies the type of configuration.*/
1261         char                       *server_addr;           /**< Specifies the address of configuration.*/
1262         int                         port_number;           /**< Specifies the port number of configuration.*/
1263         int                         security_type;         /**< Specifies the security such as SSL.*/
1264         int                         auth_type;             /**< Specifies the authentication type of configuration.*/
1265 } email_protocol_config_t;
1266
1267 typedef struct
1268 {
1269         char                       *service_name;           /**< Specifies the name of service.*/
1270         int                         authname_format;        /**< Specifies the type of user name for authentication.*/
1271         int                         protocol_conf_count;    /**< Specifies count of protocol configurations.*/
1272         email_protocol_config_t    *protocol_config_array;  /**< Specifies array of protocol configurations.*/
1273 } email_server_info_t;
1274
1275 typedef struct
1276 {
1277         int   mailbox_type;
1278         char  mailbox_name[MAILBOX_NAME_LENGTH];
1279 } email_mailbox_type_item_t;
1280
1281 /**
1282  * This structure is contains the Mail information.
1283  */
1284
1285 typedef struct
1286 {
1287         int                   mail_id;                 /**< Specifies the Mail ID.*/
1288         int                   account_id;              /**< Specifies the Account ID.*/
1289         int                   mailbox_id;              /**< Specifies the Mailbox ID.*/
1290         email_mailbox_type_e  mailbox_type;            /**< Specifies the mailbox type of the mail. */
1291         char                 *subject;                 /**< Specifies the subject.*/
1292         time_t                date_time;               /**< Specifies the Date time.*/
1293         int                   server_mail_status;      /**< Specifies the Whether sever mail or not.*/
1294         char                 *server_mailbox_name;     /**< Specifies the server mailbox.*/
1295         char                 *server_mail_id;          /**< Specifies the Server Mail ID.*/
1296         char                 *message_id;              /**< Specifies the message id */
1297         int                   reference_mail_id;       /**< Specifies the reference mail id */
1298         char                 *full_address_from;       /**< Specifies the From address.*/
1299         char                 *full_address_reply;      /**< Specifies the Reply to address */
1300         char                 *full_address_to;         /**< Specifies the To address.*/
1301         char                 *full_address_cc;         /**< Specifies the CC address.*/
1302         char                 *full_address_bcc;        /**< Specifies the BCC address*/
1303         char                 *full_address_return;     /**< Specifies the return Path*/
1304         char                 *email_address_sender;    /**< Specifies the email address of sender.*/
1305         char                 *email_address_recipient; /**< Specifies the email address of recipients.*/
1306         char                 *alias_sender;            /**< Specifies the alias of sender. */
1307         char                 *alias_recipient;         /**< Specifies the alias of recipients. */
1308         int                   body_download_status;    /**< Specifies the Text downloaded or not.*/
1309         char                 *file_path_plain;         /**< Specifies the path of text mail body.*/
1310         char                 *file_path_html;          /**< Specifies the path of HTML mail body.*/
1311         char                 *file_path_mime_entity;   /**< Specifies the path of MIME entity. */
1312         int                   mail_size;               /**< Specifies the Mail Size.*/
1313         char                  flags_seen_field;        /**< Specifies the seen flags*/
1314         char                  flags_deleted_field;     /**< Specifies the deleted flags*/
1315         char                  flags_flagged_field;     /**< Specifies the flagged flags*/
1316         char                  flags_answered_field;    /**< Specifies the answered flags*/
1317         char                  flags_recent_field;      /**< Specifies the recent flags*/
1318         char                  flags_draft_field;       /**< Specifies the draft flags*/
1319         char                  flags_forwarded_field;   /**< Specifies the forwarded flags*/
1320         int                   DRM_status;              /**< Has the mail DRM content? (1 : true, 0 : false) */
1321         email_mail_priority_t priority;                /**< Specifies the priority of the mail.*/
1322         email_mail_status_t   save_status;             /**< Specifies the save status*/
1323         int                   lock_status;             /**< Specifies the mail is locked*/
1324         email_mail_report_t   report_status;           /**< Specifies the Mail Report.*/
1325         int                   attachment_count;        /**< Specifies the attachment count. */
1326         int                   inline_content_count;    /**< Specifies the inline content count. */
1327         int                   thread_id;               /**< Specifies the thread id for thread view. */
1328         int                   thread_item_count;       /**< Specifies the item count of specific thread. */
1329         char                 *preview_text;            /**< Specifies the preview body. */
1330         email_mail_type_t     meeting_request_status;  /**< Specifies the status of meeting request. */
1331         int                   message_class;           /**< Specifies the class of message for EAS. */ /* email_message_class */
1332         email_digest_type     digest_type;             /**< Specifies the digest algorithm*/
1333         email_smime_type      smime_type;              /**< Specifies the SMIME type. */
1334         time_t                scheduled_sending_time;  /**< Specifies the scheduled sending time.*/
1335         int                   eas_data_length;         /**< Specifies the length of eas_data. */
1336         char                 *eas_data;                /**< Specifies the data for eas engine. */
1337 } email_mail_data_t;
1338
1339 /**
1340  * This structure is contains information for displaying mail list.
1341  */
1342 typedef struct
1343 {
1344         int                   mail_id;                                            /**< Specifies the mail id.*/
1345         int                   account_id;                                         /**< Specifies the account id.*/
1346         int                   mailbox_id;                                         /**< Specifies the mailbox id.*/
1347         char                  full_address_from[STRING_LENGTH_FOR_DISPLAY];       /**< Specifies the full from email address.*/
1348         char                  email_address_sender[MAX_EMAIL_ADDRESS_LENGTH];     /**< Specifies the sender email address.*/
1349         char                  email_address_recipient[STRING_LENGTH_FOR_DISPLAY]; /**< Specifies the recipients email address.*/
1350         char                  subject[STRING_LENGTH_FOR_DISPLAY];                 /**< Specifies the subject.*/
1351         int                   body_download_status;                               /**< Specifies the text donwloaded or not.*/
1352         time_t                date_time;                                          /**< Specifies the date time.*/
1353         char                  flags_seen_field;                                   /**< Specifies the seen flags*/
1354         char                  flags_deleted_field;                                /**< Specifies the deleted flags*/
1355         char                  flags_flagged_field;                                /**< Specifies the flagged flags*/
1356         char                  flags_answered_field;                               /**< Specifies the answered flags*/
1357         char                  flags_recent_field;                                 /**< Specifies the recent flags*/
1358         char                  flags_draft_field;                                  /**< Specifies the draft flags*/
1359         char                  flags_forwarded_field;                              /**< Specifies the forwarded flags*/
1360         int                   DRM_status;                                         /**< Has the mail DRM content? (1 : true, 0 : false) */
1361         email_mail_priority_t priority;                                           /**< Specifies the priority of Mails.*/ /* email_mail_priority_t*/
1362         email_mail_status_t   save_status;                                        /**< Specifies the save status*/ /* email_mail_status_t */
1363         int                   lock_status;                                        /**< Specifies the locked*/
1364         email_mail_report_t   report_status;                                      /**< Specifies the mail report.*/ /* email_mail_report_t */
1365         int                   attachment_count;                                   /**< Specifies the attachment count. */
1366         int                   inline_content_count;                               /**< Specifies the inline content count. */
1367         char                  preview_text[MAX_PREVIEW_TEXT_LENGTH];              /**< text for preview body*/
1368         int                   thread_id;                                          /**< thread id for thread view*/
1369         int                   thread_item_count;                                  /**< item count of specific thread */
1370         email_mail_type_t     meeting_request_status;                             /**< Whether the mail is a meeting request or not */ /* email_mail_type_t */
1371         int                   message_class;                                      /**< Specifies the message class */ /* email_message_class */
1372         email_smime_type      smime_type;                                         /**< Specifies the smime type */ /* email_smime_type */
1373         time_t                scheduled_sending_time;                             /**< Specifies the scheduled sending time.*/
1374         int                   eas_data_length;                                    /**< Specifies the length of eas_data. */
1375         char                 *eas_data;                                           /**< Specifies the data for eas engine. */
1376 } email_mail_list_item_t;
1377
1378 /**
1379  * This structure is used to save the filtering structure.
1380  */
1381 typedef struct
1382 {
1383         int                  account_id;          /**< Specifies the account ID.*/
1384         int                  filter_id;           /**< Specifies the filtering ID.*/
1385         email_rule_type_t    type;                /**< Specifies the filtering type.*/
1386         char                *value;               /**< Specifies the filtering value.*/
1387         email_rule_action_t  faction;             /**< Specifies the action type for filtering.*/
1388         int                  target_mailbox_id;   /**< Specifies the mail box if action type means move.*/
1389         int                  flag1;               /**< Specifies the activation.*/
1390         int                  flag2;               /**< Reserved.*/
1391 } email_rule_t;
1392
1393 /**
1394  * This structure is used to save the information of mail flag.
1395  */
1396 typedef struct
1397 {
1398         unsigned int  seen           : 1; /**< Specifies the read email.*/
1399         unsigned int  deleted        : 1; /**< Reserved.*/
1400         unsigned int  flagged        : 1; /**< Specifies the flagged email.*/
1401         unsigned int  answered       : 1; /**< Reserved.*/
1402         unsigned int  recent         : 1; /**< Reserved.*/
1403         unsigned int  draft          : 1; /**< Specifies the draft email.*/
1404         unsigned int  attachment_count : 1; /**< Reserved.*/
1405         unsigned int  forwarded      : 1; /**< Reserved.*/
1406         unsigned int  sticky         : 1; /**< Sticky flagged mails cannot be deleted */
1407 } email_mail_flag_t /* DEPRECATED */;
1408
1409
1410 /**
1411  * This structure is used to save the information of mail extra flag.
1412  */
1413 typedef struct
1414 {
1415         unsigned int  priority         : 3; /**< Specifies the mail priority.
1416                                            The value is greater than or equal to EMAIL_MAIL_PRIORITY_HIGH.
1417                                            The value is less than or equal to EMAIL_MAIL_PRIORITY_LOW.*/
1418         unsigned int  status           : 4; /**< Specifies the mail status.
1419                                                The value is a value of enumeration email_mail_status_t.*/
1420         unsigned int  noti             : 1; /**< Specifies the notified mail.*/
1421         unsigned int  lock             : 1; /**< Specifies the locked mail.*/
1422         unsigned int  report           : 2; /**< Specifies the MDN/DSN mail. The value is a value of enumeration email_mail_report_t.*/
1423         unsigned int  drm              : 1; /**< Specifies the drm mail.*/
1424         unsigned int  text_download_yn : 2; /**< body download y/n*/
1425 } email_extra_flag_t DEPRECATED;
1426
1427 /**
1428  * This structure is used to save the information of attachment.
1429  */
1430 typedef struct
1431 {
1432         int   attachment_id;
1433         char *attachment_name;
1434         char *attachment_path;
1435         int   attachment_size;
1436         int   mail_id;
1437         int   account_id;
1438         char  mailbox_id;
1439         int   save_status;
1440         int   drm_status;
1441         int   inline_content_status;
1442         char *attachment_mime_type; /**< Specifies the context mime type.*/
1443 } email_attachment_data_t;
1444
1445 typedef struct
1446 {
1447         int        offset_from_GMT;
1448         char       standard_name[32];
1449         struct tm  standard_time_start_date;
1450         int        standard_bias;
1451         char       daylight_name[32];
1452         struct tm  daylight_time_start_date;
1453         int        daylight_bias;
1454 } email_time_zone_t;
1455
1456 typedef struct
1457 {
1458         int                        mail_id;                                        /**< Specifies the mail id of meeting request on DB. This is the primary key. */
1459         email_meeting_response_t   meeting_response;                               /**< Specifies the meeting response. */
1460         struct tm                  start_time;
1461         struct tm                  end_time;
1462         char                      *location;                                       /**< Specifies the location of meeting. Maximum length of this string is 32768 */
1463         char                      *global_object_id;                               /**< Specifies the object id. */
1464         email_time_zone_t          time_zone;
1465 } email_meeting_request_t;
1466
1467 /**
1468  * This structure is used to save the information of sender list with unread/total mail counts
1469  */
1470 typedef struct
1471 {
1472         char *address;         /**< Specifies the address of a sender.*/
1473         char *display_name;    /**< Specifies a display name. This may be one of contact name, alias in original mail and email address of sender. (Priority order : contact name, alias, email address) */
1474         int   unread_count;    /**< Specifies the number of unread mails received from sender address*/
1475         int   total_count;     /**< Specifies the total number of  mails which are received from sender address*/
1476 } email_sender_list_t /* DEPRECATED */;
1477
1478
1479 /**
1480  * This structure is used to save the information of mailbox.
1481  */
1482 typedef struct
1483 {
1484         int                   mailbox_id;                 /**< Unique id on mailbox table.*/
1485         char                 *mailbox_name;               /**< Specifies the path of mailbox.*/
1486         email_mailbox_type_e  mailbox_type;               /**< Specifies the type of mailbox */
1487         char                 *alias;                      /**< Specifies the display name of mailbox.*/
1488         int                   unread_count;               /**< Specifies the unread mail count in the mailbox.*/
1489         int                   total_mail_count_on_local;  /**< Specifies the total number of mails in the mailbox in the local DB.*/
1490         int                   total_mail_count_on_server; /**< Specifies the total number of mails in the mailbox in the mail server.*/
1491         int                   local;                      /**< Specifies the local mailbox.*/
1492         int                   account_id;                 /**< Specifies the account ID for mailbox.*/
1493         int                   mail_slot_size;             /**< Specifies how many mails can be stored in local mailbox.*/
1494         int                   no_select;                  /**< Specifies the 'no_select' attribute from xlist.*/
1495         time_t                last_sync_time;
1496         int                   deleted_flag;               /**< Specifies whether mailbox is deleted.*/
1497 } email_mailbox_t;
1498
1499 typedef struct
1500 {
1501         email_address_type_t  address_type;
1502         char                 *address;
1503         char                 *display_name;
1504         int                   storage_type;
1505         int                   contact_id;
1506 } email_address_info_t;
1507
1508 typedef struct
1509 {
1510         GList *from;
1511         GList *to;
1512         GList *cc;
1513         GList *bcc;
1514 } email_address_info_list_t;
1515
1516 typedef struct
1517 {
1518         int     address_type;           /* type of mail (sender : 0, recipient : 1)*/
1519         int     address_count;  /*  The number of email addresses */
1520         char  **address_list;   /*  strings of email addresses */
1521 } email_email_address_list_t;
1522
1523
1524 typedef struct _email_search_filter_t {
1525         email_search_filter_type search_filter_type; /* type of search filter */
1526         union {
1527                 int            integer_type_key_value;
1528                 time_t         time_type_key_value;
1529                 char          *string_type_key_value;
1530         } search_filter_key_value;
1531 } email_search_filter_t;
1532
1533 typedef enum {
1534         EMAIL_LIST_FILTER_RULE_EQUAL                  = 0,
1535         EMAIL_LIST_FILTER_RULE_NOT_EQUAL              = 1,
1536         EMAIL_LIST_FILTER_RULE_LESS_THAN              = 2,
1537         EMAIL_LIST_FILTER_RULE_GREATER_THAN           = 3,
1538         EMAIL_LIST_FILTER_RULE_LESS_THAN_OR_EQUAL     = 4,
1539         EMAIL_LIST_FILTER_RULE_GREATER_THAN_OR_EQUAL  = 5,
1540         EMAIL_LIST_FILTER_RULE_INCLUDE                = 6,
1541         EMAIL_LIST_FILTER_RULE_IN                     = 7,
1542         EMAIL_LIST_FILTER_RULE_NOT_IN                 = 8
1543 } email_list_filter_rule_type_t;
1544
1545 typedef enum {
1546         EMAIL_CASE_SENSITIVE                          = 0,
1547         EMAIL_CASE_INSENSITIVE                        = 1,
1548 } email_list_filter_case_sensitivity_t;
1549
1550 typedef union {
1551         int                                    integer_type_value;
1552         char                                  *string_type_value;
1553         time_t                                 datetime_type_value;
1554 } email_mail_attribute_value_t;
1555
1556 typedef struct {
1557         email_list_filter_rule_type_t          rule_type;
1558         email_mail_attribute_type              target_attribute;
1559         email_mail_attribute_value_t           key_value;
1560         email_list_filter_case_sensitivity_t   case_sensitivity;
1561 } email_list_filter_rule_t;
1562
1563 typedef enum {
1564         EMAIL_LIST_FILTER_ITEM_RULE                     = 0,
1565         EMAIL_LIST_FILTER_ITEM_OPERATOR                 = 1,
1566 } email_list_filter_item_type_t;
1567
1568 typedef enum {
1569         EMAIL_LIST_FILTER_OPERATOR_AND                  = 0,
1570         EMAIL_LIST_FILTER_OPERATOR_OR                   = 1,
1571         EMAIL_LIST_FILTER_OPERATOR_LEFT_PARENTHESIS     = 2,
1572         EMAIL_LIST_FILTER_OPERATOR_RIGHT_PARENTHESIS    = 3
1573 } email_list_filter_operator_type_t;
1574
1575 typedef struct {
1576         email_list_filter_item_type_t          list_filter_item_type;
1577
1578         union {
1579                 email_list_filter_rule_t           rule;
1580                 email_list_filter_operator_type_t  operator_type;
1581         } list_filter_item;
1582
1583 } email_list_filter_t;
1584
1585 typedef enum {
1586         EMAIL_SORT_ORDER_ASCEND                             = 0,
1587         EMAIL_SORT_ORDER_DESCEND                            = 1
1588 } email_list_filter_sort_order_t;
1589
1590 typedef struct {
1591         email_mail_attribute_type              target_attribute;
1592         bool                                   force_boolean_check;
1593         email_list_filter_sort_order_t         sort_order;
1594 } email_list_sorting_rule_t;
1595
1596
1597
1598 /*****************************************************************************/
1599 /*  For Active Sync                                                          */
1600 /*****************************************************************************/
1601
1602 #define VCONFKEY_EMAIL_SERVICE_ACTIVE_SYNC_HANDLE "db/email_handle/active_sync_handle"
1603 #define EMAIL_ACTIVE_SYNC_NOTI                      "User.Email.ActiveSync"
1604
1605 typedef enum
1606 {
1607         ACTIVE_SYNC_NOTI_SEND_MAIL,                                   /*  a sending notification to ASE (active sync engine */
1608         ACTIVE_SYNC_NOTI_SEND_SAVED,                                  /*  a sending notification to ASE (active sync engine), All saved mails should be sent */
1609         ACTIVE_SYNC_NOTI_SEND_REPORT,                                 /*  a sending notification to ASE (active sync engine), report should be sen */
1610         ACTIVE_SYNC_NOTI_SYNC_HEADER,                                 /*  a sync header - download mails from server. */
1611                                                                   /*  It is depended on account/s flag1 field whether it excutes downloading header only or downloading header + body */
1612                                                                   /*  downloading option : 0 is subject only, 1 is text body, 2 is normal */
1613         ACTIVE_SYNC_NOTI_DOWNLOAD_BODY,                               /*  a downloading body notification to AS */
1614         ACTIVE_SYNC_NOTI_DOWNLOAD_ATTACHMENT,                         /*  a downloading attachment notification to AS */
1615         ACTIVE_SYNC_NOTI_VALIDATE_ACCOUNT,                            /*  a account validating notification to AS */
1616         ACTIVE_SYNC_NOTI_CANCEL_JOB,                                  /*  a cancling job notification to AS */
1617         ACTIVE_SYNC_NOTI_SEARCH_ON_SERVER,                            /*  a searching on server notification to AS */
1618         ACTIVE_SYNC_NOTI_CLEAR_RESULT_OF_SEARCH_ON_SERVER,            /*  a notification for clearing result of search on server to AS */
1619         ACTIVE_SYNC_NOTI_EXPUNGE_MAILS_DELETED_FLAGGED,               /*  a notification to expunge deleted flagged mails */
1620         ACTIVE_SYNC_NOTI_RESOLVE_RECIPIENT,                           /*  a notification to get the resolve recipients */
1621         ACTIVE_SYNC_NOTI_VALIDATE_CERTIFICATE,                        /*  a notification to validate certificate */
1622         ACTIVE_SYNC_NOTI_ADD_MAILBOX,                                 /*  a notification to add mailbox */
1623         ACTIVE_SYNC_NOTI_RENAME_MAILBOX,                              /*  a notification to rename mailbox */
1624         ACTIVE_SYNC_NOTI_DELETE_MAILBOX,                              /*  a notification to delete mailbox */
1625         ACTIVE_SYNC_NOTI_CANCEL_SENDING_MAIL,                         /*  a notification to cancel a sending mail */
1626         ACTIVE_SYNC_NOTI_DELETE_MAILBOX_EX,                           /*  a notification to delete multiple mailboxes */
1627         ACTIVE_SYNC_NOTI_SEND_MAIL_WITH_DOWNLOADING_OF_ORIGINAL_MAIL, /*  a notification to send a mail with downloading attachment of original mail */
1628         ACTIVE_SYNC_NOTI_SCHEDULE_SENDING_MAIL,                       /*  a notification to schedule a mail to send later*/
1629 }       eactivesync_noti_t;
1630
1631 typedef union
1632 {
1633         struct _send_mail
1634         {
1635                 int             handle;
1636                 int             account_id;
1637                 int             mail_id;
1638         } send_mail;
1639
1640         struct _send_mail_saved
1641         {/*  not defined ye */
1642                 int             handle;
1643                 int             account_id;
1644         } send_mail_saved;
1645
1646         struct _send_report
1647         {/*  not defined ye */
1648                 int             handle;
1649                 int             account_id;
1650         } send_report;
1651
1652         struct _sync_header
1653         {
1654                 int             handle;
1655                 int             account_id;
1656                 int             mailbox_id;
1657         } sync_header;
1658
1659         struct _download_body
1660         {
1661                 int             handle;
1662                 int             account_id;
1663                 int             mail_id;
1664                 int             with_attachment;      /*  0: without attachments, 1: with attachment */
1665         } download_body;
1666
1667         struct _download_attachment
1668         {
1669                 int             handle;
1670                 int             account_id;
1671                 int             mail_id;
1672                 int             attachment_order;
1673         } download_attachment;
1674
1675         struct _cancel_job
1676         {
1677                 int             account_id;
1678                 int             handle;               /*  job handle to be canceled. this value is issued by email-service. */
1679                 int             cancel_type;
1680         } cancel_job;
1681
1682         struct _validate_account
1683         {/*  not defined yet */
1684                 int             handle;
1685                 int             account_id;
1686         } validate_account;
1687
1688         struct _search_mail_on_server
1689         {
1690                 int                    handle;
1691                 int                    account_id;
1692                 int                                        mailbox_id;
1693                 email_search_filter_t *search_filter_list;
1694                 int                    search_filter_count;
1695         } search_mail_on_server;
1696
1697         struct _clear_result_of_search_mail_on_server
1698         {
1699                 int                    handle;
1700                 int                    account_id;
1701         } clear_result_of_search_mail_on_server;
1702
1703         struct _expunge_mails_deleted_flagged
1704         {
1705                 int                    handle;
1706                 int                    account_id;
1707                 int                    mailbox_id;
1708                 int                    on_server;
1709         } expunge_mails_deleted_flagged;
1710
1711         struct _get_resolve_recipients
1712         {
1713                 int                     handle;
1714                 int                     account_id;
1715                 char                   *email_address;
1716         } get_resolve_recipients;
1717
1718         struct _validate_certificate
1719         {
1720                 int                     handle;
1721                 int                     account_id;
1722                 char                   *email_address;
1723         } validate_certificate;
1724
1725         struct _add_mailbox
1726         {
1727                 int                     handle;
1728                 int                     account_id;
1729                 char                   *mailbox_path;
1730                 char                   *mailbox_alias;
1731         } add_mailbox;
1732
1733         struct _rename_mailbox
1734         {
1735                 int                     handle;
1736                 int                     account_id;
1737                 int                     mailbox_id;
1738                 char                   *mailbox_name;
1739                 char                   *mailbox_alias;
1740         } rename_mailbox;
1741
1742         struct _delete_mailbox
1743         {
1744                 int                     handle;
1745                 int                     account_id;
1746                 int                     mailbox_id;
1747         } delete_mailbox;
1748
1749         struct _cancel_sending_mail
1750         {
1751                 int                     handle;
1752                 int                     account_id;
1753                 int                     mail_id;
1754         } cancel_sending_mail;
1755
1756         struct _delete_mailbox_ex
1757         {
1758                 int                     handle;
1759                 int                     account_id;
1760                 int                    *mailbox_id_array;
1761                 int                     mailbox_id_count;
1762                 int                     on_server;
1763         } delete_mailbox_ex;
1764
1765         struct _send_mail_with_downloading_attachment_of_original_mail
1766         {
1767                 int                     handle;
1768                 int                     account_id;
1769                 int                     mail_id;
1770         } send_mail_with_downloading_attachment_of_original_mail;
1771
1772         struct _schedule_sending_mail
1773         {
1774                 int                     handle;
1775                 int                     account_id;
1776                 int                     mail_id;
1777                 time_t                  scheduled_time;
1778         } schedule_sending_mail;
1779 } ASNotiData;
1780
1781 /*  types for noti string */
1782 typedef enum
1783 {
1784         EMAIL_CONVERT_STRUCT_TYPE_MAIL_LIST_ITEM,      /** specifies email_mail_list_t */
1785 } email_convert_struct_type_e;
1786
1787 /* Tasks */
1788 typedef enum {
1789         /* Sync tasks */
1790         EMAIL_SYNC_TASK_BOUNDARY_START                                          = 11000,
1791         /* Sync tasks for account - from 11000 */
1792         EMAIL_SYNC_TASK_ADD_ACCOUNT                                             = 11010,
1793         EMAIL_SYNC_TASK_DELETE_ACCOUNT                                          = 11020,
1794         EMAIL_SYNC_TASK_UPDATE_ACCOUNT                                          = 11030,
1795         EMAIL_SYNC_TASK_GET_ACCOUNT                                             = 11040,
1796         EMAIL_SYNC_TASK_GET_ACCOUNT_LIST                                        = 11050,
1797         EMAIL_SYNC_TASK_BACKUP_ACCOUNTS                                         = 11060,
1798         EMAIL_SYNC_TASK_RESTORE_ACCOUNTS                                        = 11070,
1799         EMAIL_SYNC_TASK_GET_PASSWORD_LENGTH_OF_ACCOUNT                          = 11090,
1800
1801         /* Sync tasks for mailbox - from 12000 */
1802         EMAIL_SYNC_TASK_GET_MAILBOX_COUNT                                       = 12010,
1803         EMAIL_SYNC_TASK_GET_MAILBOX_LIST                                        = 12020,
1804         EMAIL_SYNC_TASK_GET_SUB_MAILBOX_LIST                                    = 12030,
1805         EMAIL_SYNC_TASK_SET_MAIL_SLOT_SIZE                                      = 12040,
1806         EMAIL_SYNC_TASK_SET_MAILBOX_TYPE                                        = 12050,
1807         EMAIL_SYNC_TASK_SET_LOCAL_MAILBOX                                       = 12060,
1808
1809         /* Sync tasks for mail - from 13000 */
1810         EMAIL_SYNC_TASK_GET_ATTACHMENT                                          = 13010,
1811         EMAIL_SYNC_TASK_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER                   = 13020,
1812         EMAIL_SYNC_TASK_SCHEDULE_SENDING_MAIL                                   = 13030,
1813         EMAIL_SYNC_TASK_UPDATE_ATTRIBUTE                                        = 13040,
1814
1815         /* Sync tasks for mail thread - from 14000 */
1816
1817         /* Sync tasks for rule - from 15000 */
1818
1819         /* Sync tasks for etc - from 16000 */
1820         EMAIL_SYNC_TASK_BOUNDARY_END                                            = 59999,
1821         /* Async tasks */
1822         EMAIL_ASYNC_TASK_BOUNDARY_START                                         = 60000,
1823         /* Async tasks for account - from 61000 */
1824         EMAIL_ASYNC_TASK_VALIDATE_ACCOUNT                                       = 61010,
1825         EMAIL_ASYNC_TASK_ADD_ACCOUNT_WITH_VALIDATION                            = 61020,
1826
1827         /* Async tasks for mailbox - from 62000 */
1828         EMAIL_ASYNC_TASK_ADD_MAILBOX                                            = 62010,
1829         EMAIL_ASYNC_TASK_DELETE_MAILBOX                                         = 62020,
1830         EMAIL_ASYNC_TASK_RENAME_MAILBOX                                         = 62030,
1831         EMAIL_ASYNC_TASK_DOWNLOAD_IMAP_MAILBOX_LIST                             = 62040,
1832         EMAIL_ASYNC_TASK_DELETE_MAILBOX_EX                                      = 62050,
1833
1834         /* Async tasks for mail - from 63000 */
1835         EMAIL_ASYNC_TASK_ADD_MAIL                                               = 63010,
1836         EMAIL_ASYNC_TASK_ADD_READ_RECEIPT                                       = 63020,
1837
1838         EMAIL_ASYNC_TASK_UPDATE_MAIL                                            = 63030,
1839
1840         EMAIL_ASYNC_TASK_DELETE_MAIL                                            = 63040,
1841         EMAIL_ASYNC_TASK_DELETE_ALL_MAIL                                        = 63050,
1842         EMAIL_ASYNC_TASK_EXPUNGE_MAILS_DELETED_FLAGGED                          = 63060,
1843
1844         EMAIL_ASYNC_TASK_MOVE_MAIL                                              = 63070,
1845         EMAIL_ASYNC_TASK_MOVE_ALL_MAIL                                          = 63080,
1846         EMAIL_ASYNC_TASK_MOVE_MAILS_TO_MAILBOX_OF_ANOTHER_ACCOUNT               = 63090,
1847
1848         EMAIL_ASYNC_TASK_SET_FLAGS_FIELD                                        = 63300,
1849
1850         EMAIL_ASYNC_TASK_DOWNLOAD_MAIL_LIST                                     = 63400,
1851         EMAIL_ASYNC_TASK_DOWNLOAD_BODY                                          = 63410,
1852         EMAIL_ASYNC_TASK_DOWNLOAD_ATTACHMENT                                    = 63420,
1853
1854         EMAIL_ASYNC_TASK_SEND_MAIL                                              = 63500,
1855         EMAIL_ASYNC_TASK_SEND_SAVED                                             = 63510,
1856         EMAIL_ASYNC_TASK_SEND_MAIL_WITH_DOWNLOADING_ATTACHMENT_OF_ORIGINAL_MAIL = 63520,
1857
1858         EMAIL_ASYNC_TASK_SEARCH_MAIL_ON_SERVER                                  = 63600,
1859
1860         /* Async tasks for mail thread - from 64000 */
1861         EMAIL_ASYNC_TASK_MOVE_THREAD_TO_MAILBOX                                 = 64010,
1862         EMAIL_ASYNC_TASK_DELETE_THREAD                                          = 64020,
1863         EMAIL_ASYNC_TASK_MODIFY_SEEN_FLAG_OF_THREAD                             = 64030,
1864
1865         /* Async tasks for rule - from 65000 */
1866
1867         /* Async tasks for etc - from 66000 */
1868         EMAIL_ASYNC_TASK_BOUNDARY_END                                           = 99999,
1869 } email_task_type_t;
1870
1871 typedef enum
1872 {
1873         EMAIL_TASK_STATUS_UNUSED                   = 0,
1874         EMAIL_TASK_STATUS_WAIT                     = 1,
1875         EMAIL_TASK_STATUS_STARTED                  = 2,
1876         EMAIL_TASK_STATUS_IN_PROGRESS              = 3,
1877         EMAIL_TASK_STATUS_FINISHED                 = 4,
1878         EMAIL_TASK_STATUS_FAILED                   = 5,
1879         EMAIL_TASK_STATUS_CANCELED                 = 6,
1880         EMAIL_TASK_STATUS_SCHEDULED                = 7,
1881 } email_task_status_type_t;
1882
1883 typedef enum
1884 {
1885         EMAIL_TASK_PRIORITY_UNUSED                 = 0,
1886         EMAIL_TASK_PRIORITY_SCHEDULED              = 1,
1887         EMAIL_TASK_PRIORITY_LOW                    = 3,
1888         EMAIL_TASK_PRIORITY_MID                    = 5,
1889         EMAIL_TASK_PRIORITY_HIGH                   = 7,
1890         EMAIL_TASK_PRIORITY_BACK_GROUND_TASK       = 9,
1891 } email_task_priority_t;
1892 /* Tasks */
1893
1894 #ifdef __cplusplus
1895 }
1896 #endif
1897
1898 /**
1899 * @} @}
1900 */
1901
1902 #endif /* __EMAIL_TYPES_H__ */