1 | /* |
2 | * Copyright (C) 2011 Igalia S.L. |
3 | * Copyright (C) 2008 Luca Bruno <[email protected]> |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Library General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 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 | * Library General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Library General Public License |
16 | * along with this library; see the file COPYING.LIB. If not, write to |
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | * Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) |
22 | #error "Only <webkit2/webkit2.h> can be included directly." |
23 | #endif |
24 | |
25 | #ifndef WebKitError_h |
26 | #define WebKitError_h |
27 | |
28 | #include <webkit2/WebKitDefines.h> |
29 | |
30 | G_BEGIN_DECLS |
31 | |
32 | #define WEBKIT_NETWORK_ERROR webkit_network_error_quark () |
33 | #define WEBKIT_POLICY_ERROR webkit_policy_error_quark () |
34 | #define WEBKIT_PLUGIN_ERROR webkit_plugin_error_quark () |
35 | #define WEBKIT_DOWNLOAD_ERROR webkit_download_error_quark () |
36 | #define WEBKIT_PRINT_ERROR webkit_print_error_quark () |
37 | #define WEBKIT_JAVASCRIPT_ERROR webkit_javascript_error_quark () |
38 | #define WEBKIT_SNAPSHOT_ERROR webkit_snapshot_error_quark () |
39 | #define WEBKIT_USER_CONTENT_FILTER_ERROR webkit_user_content_filter_error_quark () |
40 | |
41 | /** |
42 | * WebKitNetworkError: |
43 | * @WEBKIT_NETWORK_ERROR_FAILED: Generic load failure |
44 | * @WEBKIT_NETWORK_ERROR_TRANSPORT: Load failure due to transport error |
45 | * @WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL: Load failure due to unknown protocol |
46 | * @WEBKIT_NETWORK_ERROR_CANCELLED: Load failure due to cancellation |
47 | * @WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST: Load failure due to missing file |
48 | * |
49 | * Enum values used to denote the various network errors. |
50 | **/ |
51 | typedef enum { |
52 | WEBKIT_NETWORK_ERROR_FAILED = 399, |
53 | WEBKIT_NETWORK_ERROR_TRANSPORT = 300, |
54 | WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL = 301, |
55 | WEBKIT_NETWORK_ERROR_CANCELLED = 302, |
56 | WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST = 303 |
57 | } WebKitNetworkError; |
58 | |
59 | /** |
60 | * WebKitPolicyError: |
61 | * @WEBKIT_POLICY_ERROR_FAILED: Generic load failure due to policy error |
62 | * @WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE: Load failure due to unsupported mime type |
63 | * @WEBKIT_POLICY_ERROR_CANNOT_SHOW_URI: Load failure due to URI that can not be shown |
64 | * @WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE: Load failure due to frame load interruption by policy change |
65 | * @WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT: Load failure due to port restriction |
66 | * |
67 | * Enum values used to denote the various policy errors. |
68 | **/ |
69 | typedef enum { |
70 | WEBKIT_POLICY_ERROR_FAILED = 199, |
71 | WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE = 100, |
72 | WEBKIT_POLICY_ERROR_CANNOT_SHOW_URI = 101, |
73 | WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE = 102, |
74 | WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT = 103 |
75 | } WebKitPolicyError; |
76 | |
77 | /** |
78 | * WebKitPluginError: |
79 | * @WEBKIT_PLUGIN_ERROR_FAILED: Generic plugin load failure |
80 | * @WEBKIT_PLUGIN_ERROR_CANNOT_FIND_PLUGIN: Load failure due to missing plugin |
81 | * @WEBKIT_PLUGIN_ERROR_CANNOT_LOAD_PLUGIN: Load failure due to inability to load plugin |
82 | * @WEBKIT_PLUGIN_ERROR_JAVA_UNAVAILABLE: Load failure due to missing Java support that is required to load plugin |
83 | * @WEBKIT_PLUGIN_ERROR_CONNECTION_CANCELLED: Load failure due to connection cancellation |
84 | * @WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD: Load failure since plugin handles the load |
85 | * |
86 | * Enum values used to denote the various plugin errors. |
87 | **/ |
88 | typedef enum { |
89 | WEBKIT_PLUGIN_ERROR_FAILED = 299, |
90 | WEBKIT_PLUGIN_ERROR_CANNOT_FIND_PLUGIN = 200, |
91 | WEBKIT_PLUGIN_ERROR_CANNOT_LOAD_PLUGIN = 201, |
92 | WEBKIT_PLUGIN_ERROR_JAVA_UNAVAILABLE = 202, |
93 | WEBKIT_PLUGIN_ERROR_CONNECTION_CANCELLED = 203, |
94 | WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD = 204, |
95 | } WebKitPluginError; |
96 | |
97 | /** |
98 | * WebKitDownloadError: |
99 | * @WEBKIT_DOWNLOAD_ERROR_NETWORK: Download failure due to network error |
100 | * @WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER: Download was cancelled by user |
101 | * @WEBKIT_DOWNLOAD_ERROR_DESTINATION: Download failure due to destination error |
102 | * |
103 | * Enum values used to denote the various download errors. |
104 | */ |
105 | typedef enum { |
106 | WEBKIT_DOWNLOAD_ERROR_NETWORK = 499, |
107 | WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER = 400, |
108 | WEBKIT_DOWNLOAD_ERROR_DESTINATION = 401 |
109 | } WebKitDownloadError; |
110 | |
111 | /** |
112 | * WebKitPrintError: |
113 | * @WEBKIT_PRINT_ERROR_GENERAL: Unspecified error during a print operation |
114 | * @WEBKIT_PRINT_ERROR_PRINTER_NOT_FOUND: Selected printer cannot be found |
115 | * @WEBKIT_PRINT_ERROR_INVALID_PAGE_RANGE: Invalid page range |
116 | * |
117 | * Enum values used to denote the various print errors. |
118 | */ |
119 | typedef enum { |
120 | WEBKIT_PRINT_ERROR_GENERAL = 599, |
121 | WEBKIT_PRINT_ERROR_PRINTER_NOT_FOUND = 500, |
122 | WEBKIT_PRINT_ERROR_INVALID_PAGE_RANGE = 501 |
123 | } WebKitPrintError; |
124 | |
125 | /** |
126 | * WebKitJavascriptError: |
127 | * @WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED: An exception was raised in JavaScript execution |
128 | * |
129 | * Enum values used to denote errors happening when executing JavaScript |
130 | */ |
131 | typedef enum { |
132 | WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED = 699 |
133 | } WebKitJavascriptError; |
134 | |
135 | /** |
136 | * WebKitSnapshotError: |
137 | * @WEBKIT_SNAPSHOT_ERROR_FAILED_TO_CREATE: An error occurred when creating a webpage snapshot. |
138 | * |
139 | * Enum values used to denote errors happening when creating snapshots of #WebKitWebView |
140 | */ |
141 | typedef enum { |
142 | WEBKIT_SNAPSHOT_ERROR_FAILED_TO_CREATE = 799 |
143 | } WebKitSnapshotError; |
144 | |
145 | /** |
146 | * WebKitUserContentFilterError: |
147 | * @WEBKIT_USER_CONTENT_FILTER_ERROR_INVALID_SOURCE: The JSON source for a content filter is invalid. |
148 | * @WEBKIT_USER_CONTENT_FILTER_ERROR_NOT_FOUND: The requested content filter could not be found. |
149 | * |
150 | * Since: 2.24 |
151 | */ |
152 | typedef enum { |
153 | WEBKIT_USER_CONTENT_FILTER_ERROR_INVALID_SOURCE, |
154 | WEBKIT_USER_CONTENT_FILTER_ERROR_NOT_FOUND, |
155 | } WebKitUserContentFilterError; |
156 | |
157 | WEBKIT_API GQuark |
158 | webkit_network_error_quark (void); |
159 | |
160 | WEBKIT_API GQuark |
161 | webkit_policy_error_quark (void); |
162 | |
163 | WEBKIT_API GQuark |
164 | webkit_plugin_error_quark (void); |
165 | |
166 | WEBKIT_API GQuark |
167 | webkit_download_error_quark (void); |
168 | |
169 | WEBKIT_API GQuark |
170 | webkit_print_error_quark (void); |
171 | |
172 | WEBKIT_API GQuark |
173 | webkit_javascript_error_quark (void); |
174 | |
175 | WEBKIT_API GQuark |
176 | webkit_snapshot_error_quark (void); |
177 | |
178 | WEBKIT_API GQuark |
179 | webkit_user_content_filter_error_quark (void); |
180 | |
181 | G_END_DECLS |
182 | |
183 | #endif |
184 | |