[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.24
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_error.h
1 /*
2    Copyright (C) 2012 Samsung Electronics
3
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Library General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later version.
8
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Library General Public License for more details.
13
14     You should have received a copy of the GNU Library General Public License
15     along with this library; see the file COPYING.LIB.  If not, write to
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef ewk_error_h
21 #define ewk_error_h
22
23 #include <Eina.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 typedef struct _Ewk_Error Ewk_Error;
30
31 typedef enum {
32     EWK_ERROR_CODE_CANNOTSHOWMIMETYPE = 100,
33     EWK_ERROR_CODE_CANNOTSHOWURL,
34     EWK_ERROR_CODE_FRAMELOADINTERRUPTEDBYPOLICYCHANGE,
35     EWK_ERROR_CODE_CANNOTUSERESTRICTEDPORT,
36     EWK_ERROR_CODE_CANNOTFINDPLUGIN = 200,
37     EWK_ERROR_CODE_CANNOTLOADPLUGIN,
38     EWK_ERROR_CODE_JAVAUNAVAILABLE,
39     EWK_ERROR_CODE_PLUGINCANCELLEDCONNECTION,
40     EWK_ERROR_CODE_PLUGINWILLHANDLELOAD,
41 } Ewk_Error_Code;
42
43 typedef enum {
44     EWK_ERROR_NETWORK_STATUS_NONE,
45
46     /* Transport Errors */
47     EWK_ERROR_NETWORK_STATUS_CANCELLED = 1,
48     EWK_ERROR_NETWORK_STATUS_CANT_RESOLVE,
49     EWK_ERROR_NETWORK_STATUS_CANT_RESOLVE_PROXY,
50     EWK_ERROR_NETWORK_STATUS_CANT_CONNECT,
51     EWK_ERROR_NETWORK_STATUS_CANT_CONNECT_PROXY,
52     EWK_ERROR_NETWORK_STATUS_SSL_FAILED,
53     EWK_ERROR_NETWORK_STATUS_IO_ERROR,
54     EWK_ERROR_NETWORK_STATUS_MALFORMED,
55     EWK_ERROR_NETWORK_STATUS_TRY_AGAIN,
56     EWK_ERROR_NETWORK_STATUS_TOO_MANY_REDIRECTS,
57     EWK_ERROR_NETWORK_STATUS_TLS_FAILED,
58
59     /* HTTP Status Codes */
60     EWK_ERROR_NETWORK_STATUS_CONTINUE = 100,
61     EWK_ERROR_NETWORK_STATUS_SWITCHING_PROTOCOLS,
62     EWK_ERROR_NETWORK_STATUS_PROCESSING,
63
64     EWK_ERROR_NETWORK_STATUS_OK = 200,
65     EWK_ERROR_NETWORK_STATUS_CREATED,
66     EWK_ERROR_NETWORK_STATUS_ACCEPTED,
67     EWK_ERROR_NETWORK_STATUS_NON_AUTHORITATIVE,
68     EWK_ERROR_NETWORK_STATUS_NO_CONTENT,
69     EWK_ERROR_NETWORK_STATUS_RESET_CONTENT,
70     EWK_ERROR_NETWORK_STATUS_PARTIAL_CONTENT,
71     EWK_ERROR_NETWORK_STATUS_MULTI_STATUS,
72
73     EWK_ERROR_NETWORK_STATUS_MULTIPLE_CHOICES = 300,
74     EWK_ERROR_NETWORK_STATUS_MOVED_PERMANENTLY,
75     EWK_ERROR_NETWORK_STATUS_FOUND = 302,
76     EWK_ERROR_NETWORK_STATUS_MOVED_TEMPORARILY = 302,
77     EWK_ERROR_NETWORK_STATUS_SEE_OTHER,
78     EWK_ERROR_NETWORK_STATUS_NOT_MODIFIED,
79     EWK_ERROR_NETWORK_STATUS_USE_PROXY,
80     EWK_ERROR_NETWORK_STATUS_NOT_APPEARING_IN_THIS_PROTOCOL,
81     EWK_ERROR_NETWORK_STATUS_TEMPORARY_REDIRECT,
82
83     EWK_ERROR_NETWORK_STATUS_BAD_REQUEST = 400,
84     EWK_ERROR_NETWORK_STATUS_UNAUTHORIZED,
85     EWK_ERROR_NETWORK_STATUS_PAYMENT_REQUIRED,
86     EWK_ERROR_NETWORK_STATUS_FORBIDDEN,
87     EWK_ERROR_NETWORK_STATUS_NOT_FOUND,
88     EWK_ERROR_NETWORK_STATUS_METHOD_NOT_ALLOWED,
89     EWK_ERROR_NETWORK_STATUS_NOT_ACCEPTABLE,
90     EWK_ERROR_NETWORK_STATUS_PROXY_AUTHENTICATION_REQUIRED,
91     EWK_ERROR_NETWORK_STATUS_PROXY_UNAUTHORIZED = EWK_ERROR_NETWORK_STATUS_PROXY_AUTHENTICATION_REQUIRED,
92     EWK_ERROR_NETWORK_STATUS_REQUEST_TIMEOUT,
93     EWK_ERROR_NETWORK_STATUS_CONFLICT,
94     EWK_ERROR_NETWORK_STATUS_GONE,
95     EWK_ERROR_NETWORK_STATUS_LENGTH_REQUIRED,
96     EWK_ERROR_NETWORK_STATUS_PRECONDITION_FAILED,
97     EWK_ERROR_NETWORK_STATUS_REQUEST_ENTITY_TOO_LARGE,
98     EWK_ERROR_NETWORK_STATUS_REQUEST_URI_TOO_LONG,
99     EWK_ERROR_NETWORK_STATUS_UNSUPPORTED_MEDIA_TYPE,
100     EWK_ERROR_NETWORK_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE,
101     EWK_ERROR_NETWORK_STATUS_INVALID_RANGE = EWK_ERROR_NETWORK_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE,
102     EWK_ERROR_NETWORK_STATUS_EXPECTATION_FAILED,
103     EWK_ERROR_NETWORK_STATUS_UNPROCESSABLE_ENTITY = 422,
104     EWK_ERROR_NETWORK_STATUS_LOCKED,
105     EWK_ERROR_NETWORK_STATUS_FAILED_DEPENDENCY,
106
107     EWK_ERROR_NETWORK_STATUS_INTERNAL_SERVER_ERROR = 500,
108     EWK_ERROR_NETWORK_STATUS_NOT_IMPLEMENTED,
109     EWK_ERROR_NETWORK_STATUS_BAD_GATEWAY,
110     EWK_ERROR_NETWORK_STATUS_SERVICE_UNAVAILABLE,
111     EWK_ERROR_NETWORK_STATUS_GATEWAY_TIMEOUT,
112     EWK_ERROR_NETWORK_STATUS_HTTP_VERSION_NOT_SUPPORTED,
113     EWK_ERROR_NETWORK_STATUS_INSUFFICIENT_STORAGE = 507,
114     EWK_ERROR_NETWORK_STATUS_NOT_EXTENDED = 510
115 } Ewk_Error_Network_Status;
116
117 typedef enum {
118     EWK_ERROR_IO_CODE_FAILED,
119     EWK_ERROR_IO_CODE_NOT_FOUND,
120     EWK_ERROR_IO_CODE_EXISTS,
121     EWK_ERROR_IO_CODE_IS_DIRECTORY,
122     EWK_ERROR_IO_CODE_NOT_DIRECTORY,
123     EWK_ERROR_IO_CODE_NOT_EMPTY,
124     EWK_ERROR_IO_CODE_NOT_REGULAR_FILE,
125     EWK_ERROR_IO_CODE_NOT_SYMBOLIC_LINK,
126     EWK_ERROR_IO_CODE_NOT_MOUNTABLE_FILE,
127     EWK_ERROR_IO_CODE_FILENAME_TOO_LONG,
128     EWK_ERROR_IO_CODE_INVALID_FILENAME,
129     EWK_ERROR_IO_CODE_TOO_MANY_LINKS,
130     EWK_ERROR_IO_CODE_NO_SPACE,
131     EWK_ERROR_IO_CODE_INVALID_ARGUMENT,
132     EWK_ERROR_IO_CODE_PERMISSION_DENIED,
133     EWK_ERROR_IO_CODE_NOT_SUPPORTED,
134     EWK_ERROR_IO_CODE_NOT_MOUNTED,
135     EWK_ERROR_IO_CODE_ALREADY_MOUNTED,
136     EWK_ERROR_IO_CODE_CLOSED,
137     EWK_ERROR_IO_CODE_CANCELLED,
138     EWK_ERROR_IO_CODE_PENDING,
139     EWK_ERROR_IO_CODE_READ_ONLY,
140     EWK_ERROR_IO_CODE_CANT_CREATE_BACKUP,
141     EWK_ERROR_IO_CODE_WRONG_ETAG,
142     EWK_ERROR_IO_CODE_TIMED_OUT,
143     EWK_ERROR_IO_CODE_WOULD_RECURSE,
144     EWK_ERROR_IO_CODE_BUSY,
145     EWK_ERROR_IO_CODE_WOULD_BLOCK,
146     EWK_ERROR_IO_CODE_HOST_NOT_FOUND,
147     EWK_ERROR_IO_CODE_WOULD_MERGE,
148     EWK_ERROR_IO_CODE_FAILED_HANDLED,
149     EWK_ERROR_IO_CODE_TOO_MANY_OPEN_FILES,
150     EWK_ERROR_IO_CODE_NOT_INITIALIZED,
151     EWK_ERROR_IO_CODE_ADDRESS_IN_USE,
152     EWK_ERROR_IO_CODE_PARTIAL_INPUT,
153     EWK_ERROR_IO_CODE_INVALID_DATA,
154     EWK_ERROR_IO_CODE_DBUS_ERROR,
155     EWK_ERROR_IO_CODE_HOST_UNREACHABLE,
156     EWK_ERROR_IO_CODE_NETWORK_UNREACHABLE,
157     EWK_ERROR_IO_CODE_CONNECTION_REFUSED,
158     EWK_ERROR_IO_CODE_PROXY_FAILED,
159     EWK_ERROR_IO_CODE_PROXY_AUTH_FAILED,
160     EWK_ERROR_IO_CODE_PROXY_NEED_AUTH,
161     EWK_ERROR_IO_CODE_PROXY_NOT_ALLOWED
162 } Ewk_Error_Io_Code;
163
164 /**
165  * Returns domain from Ewk_Error.
166  *
167  * @param error Ewk_Error object received from "load,error" evas object smart callback
168  *
169  * @return @c domain string on success or empty string on failure
170  */
171 EAPI const char* ewk_error_domain_get(Ewk_Error* error);
172
173 /**
174  * Returns error code from Ewk_Error.
175  *
176  * @param error Ewk_Error object received from "load,error" evas object smart callback
177  *
178  * @note If ewk_error_domain_get returns "WebKitErrorDomain", the error code represents Ewk_Error_Code.
179  *       If "soup_http_error_quark", it represents Ewk_Error_Network_Status.
180  *       If "g-io-error-quark", it represents Ewk_Error_Io_Code.
181  *
182  * @return @c error code
183  */
184 EAPI int ewk_error_code_get(Ewk_Error* error);
185
186 /**
187  * Returns url from Ewk_Error.
188  *
189  * @param error Ewk_Error object received from "load,error" evas object smart callback
190  *
191  * @return @c url string on success or empty string on failure
192  */
193 EAPI const char* ewk_error_url_get(Ewk_Error* error);
194
195 /**
196  * Returns description from Ewk_Error.
197  *
198  * @param error Ewk_Error object received from "load,error" evas object smart callback
199  *
200  * @return @c domain string on success or empty string on failure
201  */
202 EAPI const char* ewk_error_description_get(Ewk_Error* error);
203
204 #ifdef __cplusplus
205 }
206 #endif
207 #endif // ewk_error_h