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