a9d839a6ef1705e18564a4ae0da9685383086d3b
[platform/core/messaging/email-service.git] / email-common-use / include / email-internal-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 /******************************************************************************
24  * File :  email-internal-types.h
25  * Desc :  defines data structures and macros
26  *
27  * Auth :
28  *
29  * History :
30  *    2011.04.05  :  created
31  *****************************************************************************/
32 #ifndef __EMAIL_INTERNAL_TYPES_H__
33 #define __EMAIL_INTERNAL_TYPES_H__
34
35 #include <tzplatform_config.h>
36 #include "email-types.h"
37
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif /*  __cplusplus */
42
43 #ifndef INTERNAL_FUNC
44 #define INTERNAL_FUNC __attribute__((visibility("default")))
45 #endif
46
47 /* ----------------------------------------------------------------------------- */
48 /* notification type */
49 #define __NOTI_NEW_MAIL_SINGLE "NEW_MAIL_SINGLE"
50 #define __NOTI_NEW_MAIL_MULTI "NEW_MAIL_MULTI"
51 #define __NOTI_SENT "SENT"
52 #define __NOTI_SENDING "SENDING"
53 #define __NOTI_SENT_FAIL "SENT_FAIL"
54
55
56 /* ----------------------------------------------------------------------------- */
57 /*  Feature definitions */
58 /* #define __FEATURE_USING_ACCOUNT_SVC_FOR_ACCOUNT_MANAGEMENT__ */
59 #define __FEATURE_USING_ACCOUNT_SVC_FOR_SYNC_STATUS__
60 #define __FEATURE_BACKUP_ACCOUNT__
61 #define __FEATURE_MOVE_TO_OUTBOX_FIRST__
62 #define __FEATURE_PARTIAL_BODY_FOR_POP3__
63 /*  #define __FEATURE_KEEP_CONNECTION__  */
64 #define __FEATURE_PARTIAL_BODY_DOWNLOAD__
65 #define __FEATURE_HEADER_OPTIMIZATION__
66 #define __FEATURE_SEND_OPTMIZATION__
67 #define __FEATURE_DOWNLOAD_BODY_ATTACHMENT_OPTIMIZATION__
68 #define __FEATURE_BULK_DELETE_MOVE_UPDATE_REQUEST_OPTI__
69 #define __FEATURE_SYNC_CLIENT_TO_SERVER__
70 #define __FEATURE_AUTO_POLLING__
71 #define __FEATURE_DEBUG_LOG__
72 #define __FEATURE_USE_SHARED_MUTEX_FOR_GENERATING_MAIL_ID__
73 #define __FEATURE_XLIST_SUPPORT__
74 #define __FEATURE_SUPPORT_REPORT_MAIL__
75 #define __FEATURE_SUPPORT_IMAP_ID__
76 /* #define __FEATURE_SUPPORT_SYNC_STATE_ON_NOTI_BAR__ */
77 /* #define __FEATURE_SUPPORT_VALIDATION_SYSTEM__ */
78 #define __FEATURE_PROGRESS_IN_OUTBOX__
79
80 /*  #define __FEATURE_USE_SHARED_MUTEX_FOR_PROTECTED_FUNC_CALL__ */
81 #define __FEATURE_IMAP_IDLE__
82 /* #define __FEATURE_DRIVING_MODE__ */
83 #define __FEATURE_DELETE_MAILBOX_RECURSIVELY__
84 #define __FEATURE_RENAME_MAILBOX_RECURSIVELY__
85 #define __FEATURE_AUTO_RETRY_SEND__
86 #define __FEATURE_SMTP_VALIDATION__
87 #define __FEATURE_WIFI_AUTO_DOWNLOAD__
88
89 /* #define __FEATURE_BLOCKING_MODE__ */
90 #define __FEATURE_BODY_SEARCH__
91 #define __FEATURE_ACCESS_CONTROL__
92 #define __FEATURE_UPDATE_DB_TABLE_SCHEMA__
93 #define __FEATURE_OPEN_SSL_MULTIHREAD_HANDLE__
94 /* #define __FEATURE_COMPARE_DOMAIN__ */
95 /* #define __FEATURE_FORK_FOR_CURL__ */
96 /* #define __FEATURE_USE_DRM_API__ */
97 #define __FEATURE_SECURE_PGP__
98 /* #define __FEATURE_SYNC_STATUS__ */
99 #define __FEATURE_NOTIFICATION_ENABLE__
100 /* #define __FEATURE_VOICERECORDER_STATUS_FOR_NOTI__ */
101
102 /* #define __FEATURE_IMAP_QUOTA__ */
103
104 #define TIZEN_FEATURE_EMAIL_DPM
105 /* ----------------------------------------------------------------------------- */
106 /*  Macro */
107 #ifndef NULL
108 #define NULL (char *)0
109 #endif
110
111 #define SESSION_MAX                             50
112 #define IMAP_2004_LOG                       1
113 #define TEXT_SIZE                           161
114 #define MAILBOX_COUNT                       6
115 #define PARTIAL_DOWNLOAD_SIZE               1024
116 #define PARTIAL_BODY_SIZE_IN_BYTES          15360     /*  Partial Body download - 15K */
117 #define NO_LIMITATION                       0
118 #define MAX_MAILBOX_TYPE                    100
119 #define EMAIL_SYNC_ALL_MAILBOX              1
120 #define EMAIL_ATTACHMENT_MAX_COUNT          512
121 #define DOWNLOAD_MAX_BUFFER_SIZE            8000
122 #define LOCAL_MAX_BUFFER_SIZE               1000000
123 #define IMAP_MAX_COMMAND_LENGTH             2000
124 #define DOWNLOAD_NOTI_INTERVAL_PERCENT      5         /*  notify every 5% */
125 #define DOWNLOAD_NOTI_INTERVAL_SIZE         51200     /*  notify every 50k */
126 #define MAX_PATH                            4096      /* /usr/src/linux-2.4.20-8/include/linux/limits.h */
127 #define MAX_FILENAME                        255
128 #define DATETIME_LENGTH                     16
129 #define MAIL_ID_STRING_LENGTH               10
130 #define MAILBOX_ID_STRING_LENGTH            10
131 #define EMAIL_LIMITATION_FREE_SPACE         (5)       /* This value means 5MB */
132 #define EMAIL_MAIL_MAX_COUNT                5000
133 #define HTML_EXTENSION_STRING               ".htm"
134 #define MAX_PATH_HTML                       256
135 #define MAX_ACTIVE_TASK                     10
136 #define AUTO_RESEND_INTERVAL                1200      /* 20 minutes */
137
138 #define DIR_SEPERATOR                       "/"
139
140 #define DATA_PATH                           tzplatform_getenv(TZ_USER_DATA)
141 #define DB_PATH                             tzplatform_getenv(TZ_USER_DB)
142 #define EMAIL_SERVICE_DB_FILE_PATH          tzplatform_mkpath(TZ_USER_DB, ".email-service.db")
143 #define EMAIL_SERVICE_DB_JOURNAL_FILE_PATH  tzplatform_mkpath(TZ_USER_DB, ".email-service.db-journal")
144
145 #define EMAIL_PATH                          tzplatform_mkpath(TZ_USER_DATA, "email")
146 #define EMAIL_SQL_PATH                      tzplatform_mkpath(TZ_USER_DATA, "email/res/email-service.sql")
147 #define MAIL_HOME                           tzplatform_mkpath(TZ_USER_DATA, "email/.email_data")
148 #define MAIL_TEMP                           tzplatform_mkpath(TZ_USER_DATA, "email/.email_data/tmp")
149 #define TEMP_MIME                           tzplatform_mkpath(TZ_USER_SHARE, "email/.email_data/tmp")
150 #define DIRECTORY_PERMISSION                0775
151
152 #define MIME_SUBTYPE_DRM_OBJECT             "vnd.oma.drm.message"
153 #define MIME_SUBTYPE_DRM_RIGHTS             "vnd.oma.drm.rights+xml"
154 #define MIME_SUBTYPE_DRM_DCF                "vnd.oma.drm.dcf"
155
156 #define SHM_FILE_FOR_DB_LOCK                "/.email_shm_db_lock"
157
158 #define ACCOUNT_PASSWORD_SS_GROUP_ID        "secure-storage::email-service"
159
160 #define NATIVE_EMAIL_APPLICATION_PKG        "org.tizen.email"
161 #define NATIVE_EMAIL_DOMAIN                 "email"
162
163 #define IMAP_ID_OS                          "TIZEN"
164 #define IMAP_ID_OS_VERSION                  "2.0b"
165 #define IMAP_ID_VENDOR                      "Samsung Mobile"
166 #define IMAP_ID_DEVICE_NAME                 "GT-I8800_EUR_XX"
167 #define IMAP_ID_AGUID                       "1"
168 #define IMAP_ID_ACLID                       "Samsung"
169
170 #ifdef __FEATURE_USE_SHARED_MUTEX_FOR_GENERATING_MAIL_ID__
171 #define SHM_FILE_FOR_MAIL_ID_LOCK           "/.email_shm_mail_id_lock"
172 #endif /* __FEATURE_USE_SHARED_MUTEX_FOR_GENERATING_MAIL_ID__ */
173
174 #define CR                                  '\r'
175 #define LF                                  '\n'
176 #define SPACE                               ' '
177 #define TAB                                 '\t'
178 #define NULL_CHAR                           '\0'
179 #define TAB_STRING                          "\t"
180 #define CR_STRING                           "\r"
181 #define LF_STRING                           "\n"
182 #define CRLF_STRING                         "\r\n"
183
184 #define GRAB_TYPE_TEXT                      1        /*  retrieve text and attachment list */
185 #define GRAB_TYPE_ATTACHMENT                2        /*  retrieve attachment */
186
187 #define SAVE_TYPE_SIZE                      1        /*  only get content size */
188 #define SAVE_TYPE_BUFFER                    2        /*  save content to buffer */
189 #define SAVE_TYPE_FILE                      3        /*  save content to temporary file */
190
191 #define TOKEN_FOR_MULTI_USER                 "_"
192
193 #define SNPRINTF(buff, size, format, args...)  snprintf(buff, size, format, ##args)
194 #define SNPRINTF_OFFSET(base_buf, offset, base_size, format, args...) \
195                         ({\
196                                 int _offset = offset;\
197                                 snprintf(base_buf + _offset, base_size - _offset - 1, format, ##args);\
198                         })
199
200 #define THREAD_CREATE(tv, func, param, err)       { EM_DEBUG_LOG("THREAD_CREATE "#tv); err = pthread_create(&tv, NULL, func, param); }
201 #define THREAD_CREATE_JOINABLE(tv, func, err)     { pthread_attr_t attr; EM_DEBUG_LOG("THREAD_CREATE_JOINABLE "#tv); \
202                                                    pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);\
203                                                    err = pthread_create(&tv, &attr, func, NULL); pthread_attr_destroy(&attr); }
204 #define THREAD_JOIN(tv)                           {EM_DEBUG_LOG("THREAD_JOIN "#tv); pthread_join(tv, NULL); }
205 #define THREAD_SELF()                             pthread_self()
206 #define THREAD_DETACH(tv)                         pthread_detach(tv)
207 #define INITIALIZE_CRITICAL_SECTION(cs)           {EM_DEBUG_LOG("INITIALIZE_CRITICAL_SECTION "#cs); pthread_mutex_init(&cs, NULL); }
208 #define ENTER_CRITICAL_SECTION(cs)                {pthread_mutex_lock(&cs); }
209 #define TRY_ENTER_CRITICAL_SECTION(cs)            {pthread_mutex_trylock(&cs); }
210 #define LEAVE_CRITICAL_SECTION(cs)                {pthread_mutex_unlock(&cs); }
211 #define DELETE_CRITICAL_SECTION(cs)               {EM_DEBUG_LOG("DELETE_CRITICAL_SECTION "#cs); pthread_mutex_destroy(&cs); }
212
213 #define INITIALIZE_CONDITION_VARIABLE(cv)         {EM_DEBUG_LOG("INITIALIZE_CONDITION_VARIABLE "#cv); pthread_cond_init(&cv, NULL); }
214 #define SLEEP_CONDITION_VARIABLE(cv, cs)          {EM_DEBUG_LOG("SLEEP_CONDITION_VARIABLE "#cv); pthread_cond_wait(&cv, &cs); }
215 #define WAKE_CONDITION_VARIABLE(cv)               {EM_DEBUG_LOG("WAKE_CONDITION_VARIABLE "#cv); pthread_cond_signal(&cv); }
216 #define DELETE_CONDITION_VARIABLE(cv)             {EM_DEBUG_LOG("DELETE_CONDITION_VARIABLE "#cv); pthread_cond_destroy(&cv); }
217
218 #define INITIALIZE_RECURSIVE_CRITICAL_SECTION(cs) {EM_DEBUG_LOG("INITIALIZE_RECURSIVE_CRITICAL_SECTION "#cs);\
219                                                    if (cs == NULL) {pthread_mutexattr_t attr; cs = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));\
220                                                    pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);\
221                                                    pthread_mutex_init(cs, &attr); pthread_mutexattr_destroy(&attr);}}
222 #define ENTER_RECURSIVE_CRITICAL_SECTION(cs)      {if(cs) pthread_mutex_lock(cs);}
223 #define TRY_ENTER_RECURSIVE_CRITICAL_SECTION(cs)  {if(cs)  pthread_mutex_trylock(cs);}
224 #define LEAVE_RECURSIVE_CRITICAL_SECTION(cs)      {if(cs) pthread_mutex_unlock(cs);}
225 #define DELETE_RECURSIVE_CRITICAL_SECTION(cs)     {EM_DEBUG_LOG("DELETE_RECURSIVE_CRITICAL_SECTION "#cs); if(cs) pthread_mutex_destroy(cs);}
226 typedef pthread_t thread_t;
227
228 #define SMTP_RESPONSE_OK                   250
229 #define SMTP_RESPONSE_READY                354
230 #define SMTP_RESPONSE_CONNECTION_BROKEN    421
231 #define SMTP_RESPONSE_WANT_AUTH            505
232 #define SMTP_RESPONSE_WANT_AUTH2           530
233 #define SMTP_RESPONSE_UNAVAIL              550
234 #define SMTP_RESPONSE_EXCEED_SIZE_LIMIT    552
235
236 #define VCONF_KEY_LATEST_MAIL_ID        "db/private/email-service/latest_mail_id"
237 #define VCONF_KEY_DEFAULT_ACCOUNT_ID    "db/private/email-service/default_account_id"
238 #define VCONF_KEY_NOTI_PRIVATE_ID       "db/private/email-service/noti_private_id"
239
240 #define VCONF_KEY_TOPMOST_WINDOW        "db/private/org.tizen.email/is_inbox_active"
241
242 #define OUTMODE  "wb"
243 #define INMODE   "rb"
244 #define READMODE "r"
245 #define WRITEMODE "w"
246
247 #define TYPEPKCS7_SIGN 10
248 #define TYPEPKCS7_MIME 11
249 #define TYPEPGP        12
250
251 #define INLINE_ATTACHMENT    1
252 #define ATTACHMENT           2
253
254 #define EVENT_QUEUE_MAX 64
255
256 #define EMAIL_LAUNCHED_BY_UNKNOWN_METHOD  0
257 #define EMAIL_LAUNCHED_BY_DBUS_ACTIVATION 1
258
259 #define EML_FOLDER 20 /*  save eml content to temporary folder */
260
261 /* __FEATURE_LOCAL_ACTIVITY__ supported
262 #define BULK_OPERATION_COUNT              50
263 #define ALL_ACTIVITIES                    0
264 */
265
266 /* ----------------------------------------------------------------------------- */
267 /*  Type */
268 typedef enum
269 {
270         _SERVICE_THREAD_TYPE_NONE      = 0,
271         _SERVICE_THREAD_TYPE_RECEIVING = 1,
272         _SERVICE_THREAD_TYPE_SENDING   = 2,
273 #ifdef __FEATURE_PARTIAL_BODY_DOWNLOAD__
274         _SERVICE_THREAD_TYPE_PBD       = 3,
275 #endif /*  __FEATURE_PARTIAL_BODY_DOWNLOAD__ */
276 } email_service_thread_type;
277
278
279 typedef enum
280 {
281         EMAIL_PROTOCOL_NONE                        = 0,
282         EMAIL_PROTOCOL_POP3                        = 1,
283         EMAIL_PROTOCOL_IMAP                        = 2,
284         EMAIL_PROTOCOL_SMTP                        = 3,
285 } email_protocol_type_t;
286
287 typedef enum
288 {
289         ACCOUNT_SVC_SYNC_STATUS_RUNNING            = 0,
290         ACCOUNT_SVC_SYNC_STATUS_IDLE               = 1,
291         ACCOUNT_SVC_SYNC_STATUS_OFF                = 2,
292 } email_account_svc_sync_status;
293
294 typedef enum {
295         SET_TYPE_SET        = 1,
296         SET_TYPE_UNION      = 2,
297         SET_TYPE_MINUS      = 3,
298         SET_TYPE_INTERSECT  = 4 /* Not supported */
299 } email_set_type_t;
300
301 #ifdef __FEATURE_KEEP_CONNECTION__
302 enum
303 {
304         EMAIL_STREAM_STATUS_DISCONNECTED = 0,
305         EMAIL_STREAM_STATUS_CONNECTED = 1
306 } ;
307 #endif /* __FEATURE_KEEP_CONNECTION__ */
308
309 enum
310 {
311         EXTENSION_JPEG   = 0,
312         EXTENSION_JPG    = 1,
313         EXTENSION_PNG    = 2,
314         EXTENSION_GIF    = 3,
315         EXTENSION_BMP    = 4,
316         EXTENSION_PIC    = 5,
317         EXTENSION_AGIF   = 6,
318         EXTENSION_TIF    = 7,
319         EXTENSION_WBMP   = 8,
320         EXTENSION_P7S    = 9,
321         EXTENSION_P7M    = 10,
322         EXTENSION_ASC    = 11
323 };
324
325 typedef enum {
326         EMAIL_ALARM_CLASS_SCHEDULED_SENDING   = 1,
327         EMAIL_ALARM_CLASS_NEW_MAIL_ALERT      = 2,
328         EMAIL_ALARM_CLASS_AUTO_POLLING        = 3,
329         EMAIL_ALARM_CLASS_AUTO_RESEND         = 4,
330         EMAIL_ALARM_CLASS_IMAP_IDLE           = 5,
331 } email_alarm_class_t;
332
333
334 /*  event information */
335 typedef struct
336 {
337         int                        account_id;         /*  in general, account id */
338         int                        handle;
339         email_event_type_t         type;
340         email_event_status_type_t  status;
341         char                      *multi_user_name;
342         char                      *event_param_data_1; /*  in general, mailbox name (exception in emcore_send_mail, emcore_send_saved_mail it is email_option_t **/
343         char                      *event_param_data_2;
344         char                      *event_param_data_3;
345         int                        event_param_data_4;
346         int                        event_param_data_5;
347         int                        event_param_data_6; /* in general, notification parameter #1 */
348         int                        event_param_data_7; /* in general, notification parameter #2 */
349         int                        event_param_data_8;
350 } email_event_t;
351
352
353 typedef struct
354 {
355         int   num;
356         void *data;
357 } email_callback_holder_t;
358
359
360 typedef struct email_search_key_t email_search_key_t;
361 struct email_search_key_t
362 {
363         int               type;
364         char             *value;
365         email_search_key_t *next;
366 };
367
368 /* the type is used to get uw-imap-toolkit error with thread local storage */
369 typedef struct {
370         int                  auth;
371         int                  network;
372         int                  error;
373 } email_session_t;
374
375 typedef struct
376 {
377         int                    mailbox_id;                 /**< Unique id on mailbox table.*/
378         char                  *mailbox_name;               /**< Specifies the path of mailbox.*/
379         email_mailbox_type_e   mailbox_type;               /**< Specifies the type of mailbox */
380         char                  *alias;                      /**< Specifies the display name of mailbox.*/
381         int                    unread_count;               /**< Specifies the Unread Mail count in the mailbox.*/
382         int                    total_mail_count_on_local;  /**< Specifies the total number of mails in the mailbox in the local DB.*/
383         int                    total_mail_count_on_server; /**< Specifies the total number of mails in the mailbox in the mail server.*/
384         int                    local;                      /**< Specifies the local mailbox.*/
385         int                    synchronous;                /**< Specifies the mailbox with synchronized the server.*/
386         int                    account_id;                 /**< Specifies the account ID for mailbox.*/
387         int                    has_archived_mails;         /**< Specifies the archived mails.*/
388         int                    mail_slot_size;             /**< Specifies how many mails can be stored in local mailbox.*/
389         int                    no_select;                  /**< Specifies the 'no_select' attribute from xlist.*/
390         int                    eas_data_length;            /**< Specifies the length of eas_data. */
391         char                  *eas_data;                   /**< Specifies the data for eas engine. */
392         void                  *user_data;                  /**< Specifies the internal data.*/
393         void                  *mail_stream;                /**< Specifies the internal data.*/
394 } email_internal_mailbox_t;
395
396 #ifdef __FEATURE_KEEP_CONNECTION__
397 typedef struct email_connection_info
398 {
399         int                    account_id;
400         int                    sending_server_stream_status;
401         void                  *sending_server_stream;
402         int                    receiving_server_stream_status;
403         void                  *receiving_server_stream;
404         struct email_connection_info *next;
405 } email_connection_info_t;
406 #endif /* __FEATURE_KEEP_CONNECTION__ */
407
408 typedef struct
409 {
410         char *contact_name;
411         char *email_address;
412         char *alias;
413         int   storage_type;
414         int   contact_id;
415 } email_mail_contact_info_t;
416
417 /*  global account list */
418 typedef struct  email_account_list {
419     email_account_t *account;
420     struct email_account_list *next;
421 } email_account_list_t;
422
423 typedef struct {
424         int                task_id;
425         email_task_type_t  task_type;
426         thread_t           thread_id;
427 } email_active_task_t;
428
429 typedef struct emcore_uid_elem {
430         int msgno;
431         char *uid;
432         char *internaldate;
433         email_mail_flag_t flag;
434         struct emcore_uid_elem *next;
435 } emcore_uid_list;
436
437 typedef void (*email_event_callback)(int total, int done, int status, int account_id, int mail_id, int handle, void *user_data, int error);
438
439 /* ----------------------------------------------------------------------------- */
440 /*  Please contact Himanshu [h.gahlaut@samsung.com] for any explanation in code here under __FEATURE_PARTIAL_BODY_DOWNLOAD__ MACRO */
441 #ifdef __FEATURE_PARTIAL_BODY_DOWNLOAD__
442 typedef enum
443 {
444         ACTIVITY_PARTIAL_BODY_DOWNLOAD_IMAP4 = 1,
445         ACTIVITY_PARTIAL_BODY_DOWNLOAD_POP3_WAIT,
446         ACTIVITY_PARTIAL_BODY_DOWNLOAD_POP3_ACTIVE
447 }       email_pdb_activity_type_e;
448
449 typedef struct
450 {
451         int account_id;
452         int mail_id;
453         unsigned long server_mail_id;
454         int activity_id;
455         int mailbox_id;
456         char *mailbox_name;
457         char *multi_user_name;
458         email_event_type_t event_type;   /*  Event Type Null means event is created from local activitys    */
459         int activity_type;             /*  Activity Type Null means event is created from event queue */
460 } email_event_partial_body_thd;
461 #endif /*  __FEATURE_PARTIAL_BODY_DOWNLOAD__ */
462
463 typedef enum
464 {
465         EMAIL_ALERT_TYPE_MELODY,
466         EMAIL_ALERT_TYPE_VIB,
467         EMAIL_ALERT_TYPE_MELODY_AND_VIB,
468         EMAIL_ALERT_TYPE_MUTE,
469         EMAIL_ALERT_TYPE_NONE,
470 } EMAIL_ALERT_TYPE;
471
472 enum {
473     /* Account */
474     _EMAIL_API_ADD_ACCOUNT                               = 0x01000000,    /**< IPC API ID for email_add_account */
475     _EMAIL_API_DELETE_ACCOUNT                            = 0x01000001,    /**< IPC API ID for email_delete_account */
476     _EMAIL_API_UPDATE_ACCOUNT                            = 0x01000002,    /**< IPC API ID for email_update_account */
477     _EMAIL_API_GET_ACCOUNT                               = 0x01000003,    /**< IPC API ID for email_get_account */
478     _EMAIL_API_GET_ACCOUNT_LIST                          = 0x01000005,    /**< IPC API ID for email_get_account_list */
479     _EMAIL_API_GET_MAILBOX_COUNT                         = 0x01000007,    /**< IPC API ID for email_get_mailbox_count */
480     _EMAIL_API_VALIDATE_ACCOUNT                          = 0x01000008,    /**< IPC API ID for email_validate_account */
481     _EMAIL_API_ADD_ACCOUNT_WITH_VALIDATION               = 0x01000009,    /**< IPC API ID for email_add_account_with_validation */
482     _EMAIL_API_BACKUP_ACCOUNTS                           = 0x0100000A,    /**< IPC API ID for email_backup_accounts */
483     _EMAIL_API_RESTORE_ACCOUNTS                          = 0x0100000B,    /**< IPC API ID for email_restore_accounts */
484     _EMAIL_API_GET_PASSWORD_LENGTH_OF_ACCOUNT            = 0x0100000C,    /**< IPC API ID for email_get_password_legnth_of_account */
485     _EMAIL_API_VALIDATE_ACCOUNT_EX                       = 0x0100000D,    /**< IPC API ID for email_validate_account_ex */
486         _EMAIL_API_SAVE_DEFAULT_ACCOUNT_ID                   = 0x0100000E,    /**< IPC API ID for email_save_default_account_id */
487         _EMAIL_API_LOAD_DEFAULT_ACCOUNT_ID                   = 0x01000010,    /**< IPC API ID for email_load_default_account_id */
488
489     /* Mail */
490     _EMAIL_API_DELETE_MAIL                               = 0x01100002,    /**< IPC API ID for email_delete_mail */
491     _EMAIL_API_DELETE_ALL_MAIL                           = 0x01100004,    /**< IPC API ID for email_delete_mail_all */
492     _EMAIL_API_GET_MAILBOX_LIST                          = 0x01100006,    /**< IPC API ID for email_get_mailbox_list */
493     _EMAIL_API_GET_SUBMAILBOX_LIST                       = 0x01100007,    /**< IPC API ID for email_get_submailbox_list */
494     _EMAIL_API_CLEAR_DATA                                = 0x01100009,    /**< IPC API ID for email_clear_data */
495     _EMAIL_API_MOVE_MAIL                                 = 0x0110000A,    /**< IPC API ID for email_move_mail */
496     _EMAIL_API_MOVE_ALL_MAIL                             = 0x0110000B,    /**< IPC API ID for email_move_all_mail */
497     _EMAIL_API_ADD_ATTACHMENT                            = 0x0110000C,    /**< IPC API ID for email_move_add_attachment */
498     _EMAIL_API_GET_ATTACHMENT                            = 0x0110000D,    /**< IPC API ID for email_get_attachment */
499     _EMAIL_API_DELETE_ATTACHMENT                         = 0x0110000E,    /**< IPC API ID for email_delete_attachment */
500     _EMAIL_API_MODIFY_MAIL_FLAG                          = 0x0110000F,    /**< IPC API ID for email_modify_mail_flag */
501     _EMAIL_API_MODIFY_MAIL_EXTRA_FLAG                    = 0x01100011,    /**< IPC API ID for email_modify_mail_extra_flag */
502     _EMAIL_API_SET_FLAGS_FIELD                           = 0x01100016,    /**< IPC API ID for email_set_flags_field */
503     _EMAIL_API_ADD_MAIL                                  = 0x01100017,    /**< IPC API ID for email_add_mail */
504     _EMAIL_API_UPDATE_MAIL                               = 0x01100018,    /**< IPC API ID for email_update_mail */
505     _EMAIL_API_ADD_READ_RECEIPT                          = 0x01100019,    /**< IPC API ID for email_add_read_receipt */
506     _EMAIL_API_EXPUNGE_MAILS_DELETED_FLAGGED             = 0x0110001A,    /**< IPC API ID for email_expunge_mails_deleted_flagged */
507
508     /* Thread */
509     _EMAIL_API_MOVE_THREAD_TO_MAILBOX                    = 0x01110000,    /**< IPC API ID for email_move_thread_to_mailbox */
510     _EMAIL_API_DELETE_THREAD                             = 0x01110001,    /**< IPC API ID for email_delete_thread */
511     _EMAIL_API_MODIFY_SEEN_FLAG_OF_THREAD                = 0x01110002,    /**< IPC API ID for email_modify_seen_flag_of_thread */
512
513     /* Mailbox */
514     _EMAIL_API_ADD_MAILBOX                               = 0x01200000,    /**< IPC API ID for email_add_mailbox */
515     _EMAIL_API_DELETE_MAILBOX                            = 0x01200001,    /**< IPC API ID for email_delete mailbox */
516         _EMAIL_API_STAMP_SYNC_TIME_OF_MAILBOX                = 0x01200006,    /**< IPC API ID for email_stamp_sync_time_of_mailbox */
517     _EMAIL_API_SET_MAIL_SLOT_SIZE                        = 0x01200007,    /**< IPC API ID for email_set_mail_slot_size */
518     _EMAIL_API_RENAME_MAILBOX                            = 0x01200008,    /**< IPC API ID for email_rename_mailbox */
519     _EMAIL_API_RENAME_MAILBOX_EX                         = 0x0120000B,    /**< IPC API ID for email_rename_mailbox_ex */
520     _EMAIL_API_SET_MAILBOX_TYPE                          = 0x01200009,    /**< IPC API ID for email_set_mailbox_type */
521     _EMAIL_API_SET_LOCAL_MAILBOX                         = 0x0120000A,    /**< IPC API ID for email_set_local_mailbox */
522
523     /* Network */
524     _EMAIL_API_SEND_MAIL                                 = 0x01300000,    /**< IPC API ID for email_send_mail */
525     _EMAIL_API_SYNC_HEADER                               = 0x01300001,    /**< IPC API ID for email_sycn_header */
526     _EMAIL_API_DOWNLOAD_BODY                             = 0x01300002,    /**< IPC API ID for email_download_body */
527     _EMAIL_API_DOWNLOAD_ATTACHMENT                       = 0x01300003,    /**< IPC API ID for email_download_attachment */
528     _EMAIL_API_SEND_SAVED                                = 0x01300005,    /**< IPC API ID for email_send_saved */
529     _EMAIL_API_DELETE_EMAIL                              = 0x01300007,    /**< IPC API ID for email_delete_email */
530     _EMAIL_API_DELETE_EMAIL_ALL                          = 0x01300008,    /**< IPC API ID for email_delete_email_all */
531     _EMAIL_API_GET_IMAP_MAILBOX_LIST                     = 0x01300015,    /**< IPC API ID for email_get_imap_mailbox_list */
532     _EMAIL_API_SEND_MAIL_CANCEL_JOB                      = 0x01300017,    /**< IPC API ID for email_send_mail_cancel_job */
533     _EMAIL_API_SEARCH_MAIL_ON_SERVER                     = 0x01300019,    /**< IPC API ID for email_search_mail_on_server */
534     _EMAIL_API_CLEAR_RESULT_OF_SEARCH_MAIL_ON_SERVER     = 0x0130001A,    /**< IPC API ID for email_clear_result_of_search_mail_on_server */
535     _EMAIL_API_QUERY_SMTP_MAIL_SIZE_LIMIT                = 0x0130001B,    /**< IPC API ID for email_query_smtp_mail_size_limit */
536
537     /* Rule */
538     _EMAIL_API_ADD_RULE                                  = 0x01400000,    /**< IPC API ID for email_add_rule */
539     _EMAIL_API_GET_RULE                                  = 0x01400001,    /**< IPC API ID for email_get_rule */
540     _EMAIL_API_GET_RULE_LIST                             = 0x01400002,    /**< IPC API ID for email_get_rule_list */
541     _EMAIL_API_FIND_RULE                                 = 0x01400003,    /**< IPC API ID for email_find_rule */
542     _EMAIL_API_DELETE_RULE                               = 0x01400004,    /**< IPC API ID for email_delete_rule */
543     _EMAIL_API_UPDATE_RULE                               = 0x01400005,    /**< IPC API ID for email_update_rule */
544     _EMAIL_API_APPLY_RULE                                = 0x01400006,    /**< IPC API ID for email_apply_rule */
545     _EMAIL_API_CANCEL_JOB                                = 0x01400007,    /**< IPC API ID for email_cancel_job */
546     _EMAIL_API_SEND_RETRY                                = 0x01400009,    /**< IPC API ID for email_send_retry */
547     _EMAIL_API_UPDATE_ACTIVITY                           = 0x0140000A,    /**< IPC API ID for email_update_activity */
548     _EMAIL_API_SYNC_LOCAL_ACTIVITY                       = 0x0140000B,    /**< IPC API ID for email_sync_local_activity */
549
550         /* Etc */
551         _EMAIL_API_PING_SERVICE                              = 0x01500000,    /**< IPC API ID for email_ping_service */
552         _EMAIL_API_UPDATE_NOTIFICATION_BAR_FOR_UNREAD_MAIL   = 0x01500001,    /**< IPC API ID for email_update_notification_bar_for_unread_mail */
553         _EMAIL_API_SHOW_USER_MESSAGE                         = 0x01500002,    /**< IPC API ID for email_show_user_message */
554         _EMAIL_API_WRITE_MIME_FILE                           = 0x01500003,    /**< IPC API ID for email_write_mime_file */
555         _EMAIL_API_GET_TASK_INFORMATION                      = 0x01500004,    /**< IPC API ID for email_get_task_information */
556         _EMAIL_API_CLEAR_NOTIFICATION_BAR                    = 0x01500005,
557         _EMAIL_API_GET_USER_NAME                             = 0x01500006,
558
559     /* Smime */
560     _EMAIL_API_VERIFY_SIGNATURE                          = 0x01600001,    /**< IPC API ID for email_verify_signature */
561 };
562
563 #ifdef __cplusplus
564 }
565 #endif /*  __cplusplus */
566
567 #endif /*  __EMAIL_INTERNAL_TYPES_H__ */