Tizen 2.0 Release
[platform/core/messaging/email-service.git] / email-common-use / include / email-errors.h
1 /*
2 *  email-service
3 *
4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5 *
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21
22
23 #ifndef __EMAIL_ERRORS_H__
24 #define __EMAIL_ERRORS_H__
25
26 /*****************************************************************************/
27 /*  Errors                                                                   */
28 /*****************************************************************************/
29 #define EMAIL_ERROR_NONE                                 1       /*  There is no error */
30
31 /* Error codes for invalid input */
32 #define EMAIL_ERROR_INVALID_PARAM                       -1001    /*  invalid parameter was given. - Invalid input parameter */
33 #define EMAIL_ERROR_INVALID_ACCOUNT                     -1002    /*  invalid account information was given. - Unsupported account */
34 #define EMAIL_ERROR_INVALID_SERVER                      -1005    /*  invalid server information was given. - Server unavailable */
35 #define EMAIL_ERROR_INVALID_MAIL                        -1006    /*  invalid mail information was given */
36 #define EMAIL_ERROR_INVALID_ADDRESS                     -1007    /*  invalid address information was given. - Incorrect address */
37 #define EMAIL_ERROR_INVALID_ATTACHMENT                  -1008    /*  invalid attachment information was given */
38 #define EMAIL_ERROR_INVALID_MAILBOX                     -1009    /*  invalid mailbox information was given */
39 #define EMAIL_ERROR_INVALID_FILTER                      -1010    /*  invalid filter information was given */
40 #define EMAIL_ERROR_INVALID_DATA                        -1012    /*  invalid data */
41 #define EMAIL_ERROR_INVALID_RESPONSE                    -1013    /*  unexpected network response was given. - Invalid server response */
42 #define EMAIL_ERROR_NO_RECIPIENT                        -1062    /*  no recipients information was found */
43 #define EMAIL_ERROR_INVALID_FILE_PATH                   -4101    /*  invalid file path was given */
44 #define EMAIL_ERROR_INVALID_REFERENCE_MAIL              -4102    /*  invalid reference mail was given */
45
46 /* Error codes for missing data */
47 #define EMAIL_ERROR_ACCOUNT_NOT_FOUND                   -1014    /*  no matched account was found */
48 #define EMAIL_ERROR_MAIL_NOT_FOUND                      -1015    /*  no matched mail was found */
49 #define EMAIL_ERROR_MAILBOX_NOT_FOUND                   -1016    /*  no matched mailbox was found */
50 #define EMAIL_ERROR_ATTACHMENT_NOT_FOUND                -1017    /*  no matched attachment was found */
51 #define EMAIL_ERROR_FILTER_NOT_FOUND                    -1018    /*  no matched filter was found */
52 #define EMAIL_ERROR_CONTACT_NOT_FOUND                   -1019    /*  no matched contact was found */
53 #define EMAIL_ERROR_FILE_NOT_FOUND                      -1020    /*  no matched file was found */
54 #define EMAIL_ERROR_DATA_NOT_FOUND                      -1021    /*  no matched data was found */
55 #define EMAIL_ERROR_TASK_BINDER_NOT_FOUND               -1023    /*  no matched task binder was found */
56 #define EMAIL_ERROR_TASK_NOT_FOUND                      -1168    /*  no matched task was found */
57 #define EMAIL_ERROR_HANDLE_NOT_FOUND                    -1301
58
59 /* Error codes for specification for maximum data */
60 #define EMAIL_ERROR_NO_MORE_DATA                        -1022    /*  No more data available */
61 #define EMAIL_ERROR_MAX_EXCEEDED                        -1024    /*  Can't handle more data */
62 #define EMAIL_ERROR_OUT_OF_MEMORY                       -1028    /*  There is not enough memory */
63 #define EMAIL_ERROR_ACCOUNT_MAX_COUNT                   -1053    /*  There is too many account */
64 #define EMAIL_ERROR_MAIL_MEMORY_FULL                    -1054    /*  There is no more storage */
65 #define EMAIL_ERROR_DATA_TOO_LONG                       -1025    /*  Data is too long */
66 #define EMAIL_ERROR_MAXIMUM_DEVICES_LIMIT_REACHED       -1530    /*  EAS - Maximum devices limit reached */
67
68 /* Error codes for storage */
69 #define EMAIL_ERROR_DB_FAILURE                          -1029    /*  database operation failed */
70 #define EMAIL_ERROR_SECURED_STORAGE_FAILURE             -2100    /*  Error from secured storage */
71 #define EMAIL_ERROR_GCONF_FAILURE                       -1058    /*  The error occurred on accessing Gconf */
72
73 /* Error codes for network */
74 #define EMAIL_ERROR_SOCKET_FAILURE                      -1031    /*  socket operation failed */
75 #define EMAIL_ERROR_CONNECTION_FAILURE                  -1032    /*  network connection failed */
76 #define EMAIL_ERROR_CONNECTION_BROKEN                   -1033    /*  network connection was broken */
77 #define EMAIL_ERROR_NO_SUCH_HOST                        -1059    /*  no such host was found */
78 #define EMAIL_ERROR_NETWORK_NOT_AVAILABLE               -1800    /*  WIFI not available*/
79 #define EMAIL_ERROR_INVALID_STREAM                      -1068
80
81 /* Error codes for SSL/TLS */
82 #define EMAIL_ERROR_STARTLS                             -1401    /*  "STARTLS" */
83 #define EMAIL_ERROR_TLS_NOT_SUPPORTED                   -1040    /*  The server doesn't support TLS */
84 #define EMAIL_ERROR_TLS_SSL_FAILURE                     -1041    /*  The agent failed TLS/SSL */
85 #define EMAIL_ERROR_CANNOT_NEGOTIATE_TLS                -1400    /*  "Cannot negotiate TLS" */
86
87 #define EMAIL_ERROR_NO_RESPONSE                         -1036    /*  There is no server response */
88
89 /* Error codes for authentication */
90 #define EMAIL_ERROR_AUTH_NOT_SUPPORTED                  -1038    /*  The server doesn't support authentication */
91 #define EMAIL_ERROR_AUTHENTICATE                        -1039    /*  The server failed to authenticate user */
92 #define EMAIL_ERROR_AUTH_REQUIRED                       -1069    /*  SMTP Authentication needed */
93 #define EMAIL_ERROR_LOGIN_FAILURE                       -1035    /*  login failed */
94 #define EMAIL_ERROR_LOGIN_ALLOWED_EVERY_15_MINS         -1600    /*  "login allowed only every 15 minutes" */
95 #define EMAIL_ERROR_TOO_MANY_LOGIN_FAILURE              -1601    /*  "Too many login failure" */
96
97 /* Error codes for functionality */
98 #define EMAIL_ERROR_NOT_IMPLEMENTED                     -1047    /*  The function is not implemented yet*/
99 #define EMAIL_ERROR_NOT_SUPPORTED                       -1048    /*  The function is not supported */
100
101 /* Error codes for from system */
102 #define EMAIL_ERROR_NO_SIM_INSERTED                     -1205
103 #define EMAIL_ERROR_BADGE_API_FAILED                    -3004
104
105 /* Error codes for event handling */
106 #define EMAIL_ERROR_EVENT_QUEUE_FULL                    -1060    /*  event queue is full */
107 #define EMAIL_ERROR_EVENT_QUEUE_EMPTY                   -1061    /*  event queue is empty */
108 #define EMAIL_ERROR_SESSION_NOT_FOUND                   -1067    /*  no matched session was found */
109 #define EMAIL_ERROR_CANNOT_STOP_THREAD                  -2000
110 #define EMAIL_ERROR_CANCELLED                           -1046    /*  The job was canceled by user */
111 #define EMAIL_NO_AVAILABLE_TASK_SLOT                    -2656    /*  There is no available task slot */
112
113 /* Error codes for IPC*/
114 #define EMAIL_ERROR_IPC_CRASH                           -1500
115 #define EMAIL_ERROR_IPC_CONNECTION_FAILURE              -1501
116 #define EMAIL_ERROR_IPC_SOCKET_FAILURE                  -1502
117 #define EMAIL_ERROR_IPC_PROTOCOL_FAILURE                -1503
118 #define EMAIL_ERROR_IPC_ALREADY_INITIALIZED             -1504
119 #define EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE            -1300
120
121 /* Error codes for error from server */
122 #define EMAIL_ERROR_COMMAND_NOT_SUPPORTED               -1043    /* The server doesn't support this command */
123 #define EMAIL_ERROR_ANNONYM_NOT_SUPPORTED               -1044    /* The server doesn't support anonymous user */
124 #define EMAIL_ERROR_SCAN_NOT_SUPPORTED                  -1037    /* The server doesn't support 'scan mailbox' */
125
126 #define EMAIL_ERROR_SMTP_SEND_FAILURE                   -1063    /* SMTP send failed */
127
128 #define EMAIL_ERROR_POP3_DELE_FAILURE                   -1100    /* Failed to run the command 'Dele' on POP server */
129 #define EMAIL_ERROR_POP3_UIDL_FAILURE                   -1101    /* Failed to run the command 'Uidl' on POP server */
130 #define EMAIL_ERROR_POP3_LIST_FAILURE                   -1102    /* Failed to run the command 'List' on POP server */
131
132 #define EMAIL_ERROR_IMAP4_APPEND_FAILURE                -1042    /* Failed to run the command 'Append' on IMAP server */
133 #define EMAIL_ERROR_IMAP4_STORE_FAILURE                 -1200    /* Failed to run the command 'Store' on IMAP server */
134 #define EMAIL_ERROR_IMAP4_EXPUNGE_FAILURE               -1201    /* Failed to run the command 'Expunge' on IMAP server */
135 #define EMAIL_ERROR_IMAP4_FETCH_UID_FAILURE             -1202    /* Failed to run the command 'Fetch UID' on IMAP server */
136 #define EMAIL_ERROR_IMAP4_FETCH_SIZE_FAILURE            -1203    /* Failed to run the command 'Fetch SIZE' on IMAP server */
137 #define EMAIL_ERROR_IMAP4_IDLE_FAILURE                  -1204    /* Failed to run the command 'Idle' on IMAP server */
138 #define EMAIL_ERROR_IMAP4_CREATE_FAILURE                -1210    /* Failed to run the command 'Create' on IMAP server */
139 #define EMAIL_ERROR_IMAP4_DELETE_FAILURE                -1211    /* Failed to run the command 'Delete' on IMAP server */
140 #define EMAIL_ERROR_IMAP4_RENAME_FAILURE                -1212    /* Failed to run the command 'Rename' on IMAP server */
141
142 #define EMAIL_ERROR_INVALID_ATTACHMENT_SAVE_NAME        -1301
143
144 /* Error codes for certificate */
145 #define EMAIL_ERROR_LOAD_CERTIFICATE_FAILURE            -3001    /*  Cannot load the certificate */
146 #define EMAIL_ERROR_INVALID_CERTIFICATE                 -3002    /*  invalid certificate */
147 #define EMAIL_ERROR_DECRYPT_FAILED                      -3003    /*  Cannot decipher the encrypt mail */
148 #define EMAIL_ERROR_CERTIFICATE_FAILURE                 -1045    /*  certificate failure - Invalid server certificate */
149
150 /* Error codes for account */
151 #define EMAIL_ERROR_ACCOUNT_IS_QUARANTINED              -5001
152 #define EMAIL_ERROR_ACCOUNT_IS_BLOCKED                  -5002
153
154 /* Error codes for mails */
155 #define EMAIL_ERROR_MAIL_NOT_FOUND_ON_SERVER            -1055    /*  The expected mail is not found in server */
156 #define EMAIL_ERROR_MAIL_IS_NOT_DOWNLOADED              -1095    /*  The mail is not downloaded */
157
158 /* Error codes for attachment */
159 #define EMAIL_ERROR_ATTACHMENT_SIZE_EXCEED_POLICY_LIMIT -7001
160
161 /* Etc */
162 #define EMAIL_ERROR_ALREADY_INITIALIZED                 -7321
163 #define EMAIL_ERROR_NOT_INITIALIZED                     -7322
164 #define EMAIL_ERROR_UNKNOWN                             -8000    /*  unknown error */
165
166 /* Should be replaced with proper name */
167 #define EMAIL_ERROR_LOAD_ENGINE_FAILURE                 -1056    /*  loading engine failed */
168 #define EMAIL_ERROR_CLOSE_FAILURE                       -1057    /*  engine is still used */
169 #define EMAIL_ERROR_NULL_VALUE                          -1302
170 #define EMAIL_ERROR_EMPTY_FILE                          -1304
171
172 /* Should be classified */
173 #define EMAIL_ERROR_SYSTEM_FAILURE                      -1050    /*  There is a system error */
174 #define EMAIL_ERROR_ON_PARSING                          -1700
175 #define EMAIL_ERROR_ALREADY_EXISTS                      -1023    /*  data duplicated */
176
177 /* Not used */
178 #define EMAIL_ERROR_INVALID_USER                        -1003    /*  invalid user ID was given. - Invalid user or password */
179 #define EMAIL_ERROR_INVALID_PASSWORD                    -1004    /*  invalid password was given. - Invalid user or password */
180 #define EMAIL_ERROR_INVALID_PATH                        -1011    /*  invalid flle path was given */
181 #define EMAIL_ERROR_MAIL_MAX_COUNT                      -1052    /*  The mailbox is full */
182 #define EMAIL_ERROR_DATA_TOO_SMALL                      -1026    /*  Data is too small */
183 #define EMAIL_ERROR_PROFILE_FAILURE                     -1030    /*  no proper profile was found */
184 #define EMAIL_ERROR_NO_MMC_INSERTED                     -1209
185 #define EMAIL_ERROR_VALIDATE_ACCOUNT                    -1208
186 #define EMAIL_ERROR_NETWORK_TOO_BUSY                    -1027    /*  Network is busy */
187 #define EMAIL_ERROR_DISCONNECTED                        -1034    /*  connection was disconnected */
188 #define EMAIL_ERROR_MAIL_LOCKED                         -1049    /*  The mail was locked */
189 #define EMAIL_ERROR_RETRIEVE_HEADER_DATA_FAILURE        -1065    /*  retrieving header failed */
190 #define EMAIL_ERROR_MAILBOX_OPEN_FAILURE                -1064    /*  accessing mailbox failed */
191 #define EMAIL_ERROR_XML_PARSER_FAILURE                  -1066    /*  XML parsing failed */
192 #define EMAIL_ERROR_FAILED_BY_SECURITY_POLICY           -1303
193 #define EMAIL_ERROR_FLIGHT_MODE                         -1206
194
195 #endif /* __EMAIL_ERRORS_H__ */