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