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