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