[M67 Dev][EWK] Classify EWK APIs by public, internal, or product
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_error.h
1 /*
2  * Copyright (C) 2012 Intel Corporation.
3  * Copyright (C) 2013-2016 Samsung Electronics.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 /**
21  * @file    ewk_error.h
22  * @brief   This file describes the Ewk Web Error API.
23  */
24
25 #ifndef ewk_error_h
26 #define ewk_error_h
27
28 #include <Eina.h>
29 #include <tizen.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /**
36  * @addtogroup WEBVIEW
37  * @{
38  */
39
40 /**
41  * @if MOBILE
42  * @brief The structure type that creates a type name for #Ewk_Error.
43  * @since_tizen 2.3
44  * @endif
45  */
46 typedef struct _Ewk_Error Ewk_Error;
47
48 /**
49  * @if MOBILE
50  * \enum   Ewk_Error_Code
51  * @brief  Enumeration that provides an option to error codes.
52  * @since_tizen 2.3
53  * @endif
54  */
55 typedef enum {
56     EWK_ERROR_CODE_UNKNOWN,    /**< Unknown */
57     EWK_ERROR_CODE_CANCELED,   /**< User canceled */
58     EWK_ERROR_CODE_CANT_SUPPORT_MIMETYPE,
59     /**< Can't show page for this MIME Type */
60     EWK_ERROR_CODE_FAILED_FILE_IO, /**< Error */
61     EWK_ERROR_CODE_CANT_CONNECT,   /**< Cannot connect to Network */
62     EWK_ERROR_CODE_CANT_LOOKUP_HOST,   /**< Fail to look up host from DNS */
63     EWK_ERROR_CODE_FAILED_TLS_HANDSHAKE, /**< Fail to SSL/TLS handshake */
64     EWK_ERROR_CODE_INVALID_CERTIFICATE,  /**< Received certificate is invalid */
65     EWK_ERROR_CODE_REQUEST_TIMEOUT,      /**< Connection timeout */
66     EWK_ERROR_CODE_TOO_MANY_REDIRECTS,   /**< Too many redirects */
67     EWK_ERROR_CODE_TOO_MANY_REQUESTS, /**< Too many requests during this load */
68     EWK_ERROR_CODE_BAD_URL,           /**< Malformed url */
69     EWK_ERROR_CODE_UNSUPPORTED_SCHEME,/**< Unsupported scheme */
70     EWK_ERROR_CODE_AUTHENTICATION,  /**< User authentication failed on server */
71     EWK_ERROR_CODE_INTERNAL_SERVER, /**< Web server has internal server error */
72     EWK_ERROR_CODE_CANNOTSHOWMIMETYPE = 100,
73     EWK_ERROR_CODE_CANNOTSHOWURL,
74     EWK_ERROR_CODE_FRAMELOADINTERRUPTEDBYPOLICYCHANGE,
75     EWK_ERROR_CODE_CANNOTUSERESTRICTEDPORT,
76     EWK_ERROR_CODE_CANNOTFINDPLUGIN = 200,
77     EWK_ERROR_CODE_CANNOTLOADPLUGIN,
78     EWK_ERROR_CODE_JAVAUNAVAILABLE,
79     EWK_ERROR_CODE_PLUGINCANCELLEDCONNECTION,
80     EWK_ERROR_CODE_PLUGINWILLHANDLELOAD,
81 } Ewk_Error_Code;
82
83 /**
84  * @if MOBILE
85  * @brief Query failing URL for this error.
86  *
87  * @details URL that failed loading.
88  *
89  * @since_tizen 2.3
90  *
91  * @param[in] error The error object to query
92  *
93  * @return The URL pointer, that may be @c NULL. This pointer is\n
94  *         guaranteed to be eina_stringshare, so whenever possible\n
95  *         save yourself some cpu cycles and use\n
96  *         eina_stringshare_ref() instead of eina_stringshare_add() or\n
97  *         strdup()
98  * @endif
99  */
100 EXPORT_API const char* ewk_error_url_get(const Ewk_Error* error);
101
102 /**
103  * @if MOBILE
104  * @brief Query the error code.
105  *
106  * @since_tizen 2.3
107  *
108  * @param[in] error The error object to query
109  *
110  * @return The error code #Ewk_Error_Code
111  * @endif
112  */
113 EXPORT_API int ewk_error_code_get(const Ewk_Error* error);
114
115 /**
116  * @if MOBILE
117  * @brief Query description for this error.
118  *
119  * @since_tizen 2.3
120  *
121  * @param[in] error The error object to query
122  *
123  * @return The description pointer, that may be @c NULL. This pointer is\n
124  *         guaranteed to be eina_stringshare, so whenever possible\n
125  *         save yourself some cpu cycles and use\n
126  *         eina_stringshare_ref() instead of eina_stringshare_add() or\n
127  *         strdup()
128  * @endif
129  */
130 EXPORT_API const char* ewk_error_description_get(const Ewk_Error* error);
131
132 /**
133  * @if MOBILE
134  * @brief Query if error should be treated as a cancellation.
135  *
136  * @since_tizen 2.3
137  *
138  * @param[in] error The error object to query
139  *
140  * @return @c EINA_TRUE if this error should be treated as a cancellation\n
141  *         otherwise @c EINA_FALSE
142  * @endif
143  */
144 EXPORT_API Eina_Bool ewk_error_cancellation_get(const Ewk_Error* error);
145
146 /**
147 * @}
148 */
149
150 #ifdef __cplusplus
151 }
152 #endif
153
154 #endif // ewk_error_h