1#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(non_camel_case_types)]
6#![allow(clippy::missing_safety_doc)]
7#![allow(clippy::useless_transmute)]
9#![allow(clippy::unnecessary_cast)]
10
11#[link(name = "ohweb")]
12unsafe extern "C" {}
13
14#[doc = " @error Success."]
15pub const ArkWeb_ErrorCode_ARKWEB_SUCCESS: ArkWeb_ErrorCode = 0;
16#[doc = " @error Init error."]
17pub const ArkWeb_ErrorCode_ARKWEB_INIT_ERROR: ArkWeb_ErrorCode = 17100001;
18#[doc = " @error Unknown error."]
19pub const ArkWeb_ErrorCode_ARKWEB_ERROR_UNKNOWN: ArkWeb_ErrorCode = 17100100;
20#[doc = " @error Invalid param."]
21pub const ArkWeb_ErrorCode_ARKWEB_INVALID_PARAM: ArkWeb_ErrorCode = 17100101;
22#[doc = " @error Register custom schemes should be called before create any ArkWeb."]
23pub const ArkWeb_ErrorCode_ARKWEB_SCHEME_REGISTER_FAILED: ArkWeb_ErrorCode = 17100102;
24#[doc = " @error Invalid url."]
25pub const ArkWeb_ErrorCode_ARKWEB_INVALID_URL: ArkWeb_ErrorCode = 17100103;
26#[doc = " @error Invalid cookie value."]
27pub const ArkWeb_ErrorCode_ARKWEB_INVALID_COOKIE_VALUE: ArkWeb_ErrorCode = 17100104;
28pub const ArkWeb_ErrorCode_ARKWEB_LIBRARY_OPEN_FAILURE: ArkWeb_ErrorCode = 17100105;
29pub const ArkWeb_ErrorCode_ARKWEB_LIBRARY_SYMBOL_NOT_FOUND: ArkWeb_ErrorCode = 17100106;
30#[doc = " @brief The CookieManager is not initialized.\n\n @since 20"]
31#[cfg(feature = "api-20")]
32pub const ArkWeb_ErrorCode_ARKWEB_COOKIE_MANAGER_NOT_INITIALIZED: ArkWeb_ErrorCode = 17100107;
33#[doc = " @brief The CookieManager initialization failed.\n\n @since 20"]
34#[cfg(feature = "api-20")]
35pub const ArkWeb_ErrorCode_ARKWEB_COOKIE_MANAGER_INITIALIZE_FAILED: ArkWeb_ErrorCode = 17100108;
36#[doc = " @brief Save cookie failed.\n\n @since 20"]
37#[cfg(feature = "api-20")]
38pub const ArkWeb_ErrorCode_ARKWEB_COOKIE_SAVE_FAILED: ArkWeb_ErrorCode = 17100109;
39pub type ArkWeb_ErrorCode = u32;
40#[doc = " Operation successful."]
41#[cfg(feature = "api-20")]
42pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_SUCCESS: ArkWeb_BlanklessErrorCode = 0;
43#[doc = " Unknown error."]
44#[cfg(feature = "api-20")]
45pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_ERR_UNKNOWN: ArkWeb_BlanklessErrorCode = -1;
46#[doc = " Invalid parameter."]
47#[cfg(feature = "api-20")]
48pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_ERR_INVALID_ARGS: ArkWeb_BlanklessErrorCode =
49 -2;
50#[doc = " **WebViewController** is not bound to any component."]
51#[cfg(feature = "api-20")]
52pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_ERR_CONTROLLER_NOT_INITED:
53 ArkWeb_BlanklessErrorCode = -3;
54#[doc = " The key value is not matched. The **OH_NativeArkWeb_SetBlanklessLoadingWithKey** and **\n OH_NativeArkWeb_GetBlanklessInfoWithKey** APIs must be used in pair and use the same key value."]
55#[cfg(feature = "api-20")]
56pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_ERR_KEY_NOT_MATCH: ArkWeb_BlanklessErrorCode =
57 -4;
58#[doc = " When the similarity is low, the system will deem the scene change too abrupt and frame insertion through the **\n OH_NativeArkWeb_SetBlanklessLoadingWithKey** API will fail."]
59#[cfg(feature = "api-20")]
60pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_ERR_SIGNIFICANT_CHANGE:
61 ArkWeb_BlanklessErrorCode = -5;
62#[doc = " This device does not support this feature."]
63#[cfg(feature = "api-20")]
64pub const ArkWeb_BlanklessErrorCode_ARKWEB_BLANKLESS_ERR_DEVICE_NOT_SUPPORT:
65 ArkWeb_BlanklessErrorCode = 801;
66#[doc = " @brief Enumerates the error codes for the blankless loading.\n\n @since 20"]
67#[cfg(feature = "api-20")]
68pub type ArkWeb_BlanklessErrorCode = i32;
69#[doc = " @brief Defines the javascript bridge data type.\n\n @since 12"]
70#[repr(C)]
71#[derive(Debug, Copy, Clone)]
72pub struct ArkWeb_JavaScriptBridgeData {
73 #[doc = " A buffer that contains data."]
74 pub buffer: *const u8,
75 #[doc = " The size of the buffer."]
76 pub size: usize,
77}
78#[doc = " Represent error data"]
79pub const ArkWeb_WebMessageType_ARKWEB_NONE: ArkWeb_WebMessageType = 0;
80#[doc = " The data carried in the ArkWeb_WebMessage is string."]
81pub const ArkWeb_WebMessageType_ARKWEB_STRING: ArkWeb_WebMessageType = 1;
82#[doc = " The data carried in the ArkWeb_WebMessage is buffer(uint8_t)."]
83pub const ArkWeb_WebMessageType_ARKWEB_BUFFER: ArkWeb_WebMessageType = 2;
84#[doc = " @brief Defines the data type carried in an ArkWeb_WebMessage.\n\n @since 12"]
85pub type ArkWeb_WebMessageType = u32;
86#[doc = " Represent error data"]
87#[cfg(feature = "api-18")]
88pub const ArkWeb_JavaScriptValueType_ARKWEB_JAVASCRIPT_NONE: ArkWeb_JavaScriptValueType = 0;
89#[doc = " The data carried in the ArkWeb_JavaScriptValue is string."]
90#[cfg(feature = "api-18")]
91pub const ArkWeb_JavaScriptValueType_ARKWEB_JAVASCRIPT_STRING: ArkWeb_JavaScriptValueType = 1;
92#[doc = " The data carried in the ArkWeb_JavaScriptValue is bool."]
93#[cfg(feature = "api-18")]
94pub const ArkWeb_JavaScriptValueType_ARKWEB_JAVASCRIPT_BOOL: ArkWeb_JavaScriptValueType = 2;
95#[doc = " @brief Defines the data type carried in an ArkWeb_JavaScriptValue.\n\n @since 18"]
96#[cfg(feature = "api-18")]
97pub type ArkWeb_JavaScriptValueType = u32;
98#[repr(C)]
99#[derive(Debug, Copy, Clone)]
100pub struct ArkWeb_WebMessage {
101 _unused: [u8; 0],
102}
103#[doc = " @brief Defines the ArkWeb_WebMessage.\n\n @since 12"]
104pub type ArkWeb_WebMessagePtr = *mut ArkWeb_WebMessage;
105#[cfg(feature = "api-18")]
106#[repr(C)]
107#[derive(Debug, Copy, Clone)]
108pub struct ArkWeb_JavaScriptValue {
109 _unused: [u8; 0],
110}
111#[doc = " @brief Defines the ArkWeb_JavaScriptValuePtr.\n\n @since 18"]
112#[cfg(feature = "api-18")]
113pub type ArkWeb_JavaScriptValuePtr = *mut ArkWeb_JavaScriptValue;
114#[doc = " @brief Defines the javascript callback of the native ArkWeb.\n\n @since 12"]
115pub type ArkWeb_OnJavaScriptCallback = ::std::option::Option<
116 unsafe extern "C" fn(
117 webTag: *const ::std::os::raw::c_char,
118 data: *const ArkWeb_JavaScriptBridgeData,
119 userData: *mut ::std::os::raw::c_void,
120 ),
121>;
122#[doc = " @brief Defines the javascript proxy callback of the native ArkWeb.\n\n @since 12"]
123pub type ArkWeb_OnJavaScriptProxyCallback = ::std::option::Option<
124 unsafe extern "C" fn(
125 webTag: *const ::std::os::raw::c_char,
126 dataArray: *const ArkWeb_JavaScriptBridgeData,
127 arraySize: usize,
128 userData: *mut ::std::os::raw::c_void,
129 ),
130>;
131#[doc = " @brief Defines the JavaScript proxy callback of the native ArkWeb.\n\n @param webTag The name of the web component.\n @param dataArray The JavaScript bridge data array from HTML.\n @param arraySize The number of elements in the array.\n @param userData The data set by user.\n\n @since 18"]
132#[cfg(feature = "api-18")]
133pub type ArkWeb_OnJavaScriptProxyCallbackWithResult = ::std::option::Option<
134 unsafe extern "C" fn(
135 webTag: *const ::std::os::raw::c_char,
136 dataArray: *const ArkWeb_JavaScriptBridgeData,
137 arraySize: usize,
138 userData: *mut ::std::os::raw::c_void,
139 ) -> ArkWeb_JavaScriptValuePtr,
140>;
141#[doc = " @brief Defines the component callback of the native ArkWeb.\n\n @since 12"]
142pub type ArkWeb_OnComponentCallback = ::std::option::Option<
143 unsafe extern "C" fn(
144 webTag: *const ::std::os::raw::c_char,
145 userData: *mut ::std::os::raw::c_void,
146 ),
147>;
148#[doc = " @brief Called when the **Web** component is scrolled.\n\n @param webTag Name of the **Web** component.\n @param userData Pointer to user-defined data.\n @param x Scrolling offset of the X axis. Unit: vp.\n @param y Scrolling offset of the Y axis. Unit: vp.\n @since 18"]
149#[cfg(feature = "api-18")]
150pub type ArkWeb_OnScrollCallback = ::std::option::Option<
151 unsafe extern "C" fn(
152 webTag: *const ::std::os::raw::c_char,
153 userData: *mut ::std::os::raw::c_void,
154 x: f64,
155 y: f64,
156 ),
157>;
158#[repr(C)]
159#[derive(Debug, Copy, Clone)]
160pub struct ArkWeb_WebMessagePort {
161 _unused: [u8; 0],
162}
163#[doc = " @brief Defines the ArkWeb_WebMessagePort that represent a HTML5 message port.\n\n @since 12"]
164pub type ArkWeb_WebMessagePortPtr = *mut ArkWeb_WebMessagePort;
165#[doc = " @brief Defines the callback to receive message from HTML.\n\n @param webTag The name of the web component.\n @param port The ArkWeb_WebMessagePort for registering the ArkWeb_OnMessageEventHandler.\n @param message The received ArkWeb_WebMessage.\n @param userData The data set by user.\n\n @since 12"]
166pub type ArkWeb_OnMessageEventHandler = ::std::option::Option<
167 unsafe extern "C" fn(
168 webTag: *const ::std::os::raw::c_char,
169 port: ArkWeb_WebMessagePortPtr,
170 message: ArkWeb_WebMessagePtr,
171 userData: *mut ::std::os::raw::c_void,
172 ),
173>;
174#[doc = " @brief Defines the javascript object.\n\n @since 12"]
175#[repr(C)]
176#[derive(Debug, Copy, Clone)]
177pub struct ArkWeb_JavaScriptObject {
178 #[doc = " A piece of javascript code."]
179 pub buffer: *const u8,
180 #[doc = " The size of the javascript code."]
181 pub size: usize,
182 #[doc = " Callbacks execute JavaScript script results."]
183 pub callback: ArkWeb_OnJavaScriptCallback,
184 #[doc = " The user data to set."]
185 pub userData: *mut ::std::os::raw::c_void,
186}
187#[doc = " @brief Defines the javascript proxy registered method object.\n\n @since 12"]
188#[repr(C)]
189#[derive(Debug, Copy, Clone)]
190pub struct ArkWeb_ProxyMethod {
191 #[doc = " The method of the application side JavaScript object participating in the registration."]
192 pub methodName: *const ::std::os::raw::c_char,
193 #[doc = " The callback function registered by developer is called back when HTML side uses."]
194 pub callback: ArkWeb_OnJavaScriptProxyCallback,
195 #[doc = " The user data to set."]
196 pub userData: *mut ::std::os::raw::c_void,
197}
198#[doc = " @brief Defines the JavaScript proxy method with a return value.\n\n @since 18"]
199#[cfg(feature = "api-18")]
200#[repr(C)]
201#[derive(Debug, Copy, Clone)]
202pub struct ArkWeb_ProxyMethodWithResult {
203 #[doc = " The method of the application side JavaScript object participating in the registration."]
204 pub methodName: *const ::std::os::raw::c_char,
205 #[doc = " The callback function with a return value registered by developer is called back when HTML side uses."]
206 pub callback: ArkWeb_OnJavaScriptProxyCallbackWithResult,
207 #[doc = " The user data to set."]
208 pub userData: *mut ::std::os::raw::c_void,
209}
210#[doc = " @brief Defines the javascript proxy registered object.\n\n @since 12"]
211#[repr(C)]
212#[derive(Debug, Copy, Clone)]
213pub struct ArkWeb_ProxyObject {
214 #[doc = " The name of the registered object."]
215 pub objName: *const ::std::os::raw::c_char,
216 #[doc = " The javascript proxy registered method object list"]
217 pub methodList: *const ArkWeb_ProxyMethod,
218 #[doc = " The size of the methodList."]
219 pub size: usize,
220}
221#[doc = " @brief Defines the JavaScript proxy registered object with methodList that has a return value.\n\n @since 18"]
222#[cfg(feature = "api-18")]
223#[repr(C)]
224#[derive(Debug, Copy, Clone)]
225pub struct ArkWeb_ProxyObjectWithResult {
226 #[doc = " The name of the registered object."]
227 pub objName: *const ::std::os::raw::c_char,
228 #[doc = " The JavaScript proxy registered method object list with a callback function that has a return value"]
229 pub methodList: *const ArkWeb_ProxyMethodWithResult,
230 #[doc = " The size of the methodList."]
231 pub size: usize,
232}
233#[doc = " @brief Defines the controller API for native ArkWeb.\n Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check\n whether the function structure has a corresponding function pointer to avoid crash\n caused by mismatch between the SDK and the device ROM.\n Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the Controller-related interface cluster.\n\n @since 12"]
234#[repr(C)]
235#[derive(Debug, Copy, Clone)]
236pub struct ArkWeb_ControllerAPI {
237 #[doc = " The ArkWeb_ControllerAPI struct size."]
238 pub size: usize,
239 #[doc = " Load a piece of code and execute JS code in the context of the currently displayed page."]
240 pub runJavaScript: ::std::option::Option<
241 unsafe extern "C" fn(
242 webTag: *const ::std::os::raw::c_char,
243 javascriptObject: *const ArkWeb_JavaScriptObject,
244 ),
245 >,
246 #[doc = " Register the JavaScript object and method list."]
247 pub registerJavaScriptProxy: ::std::option::Option<
248 unsafe extern "C" fn(
249 webTag: *const ::std::os::raw::c_char,
250 proxyObject: *const ArkWeb_ProxyObject,
251 ),
252 >,
253 #[doc = " Deletes the registered object which the given name."]
254 pub deleteJavaScriptRegister: ::std::option::Option<
255 unsafe extern "C" fn(
256 webTag: *const ::std::os::raw::c_char,
257 objName: *const ::std::os::raw::c_char,
258 ),
259 >,
260 #[doc = " Refresh the current web page."]
261 pub refresh: ::std::option::Option<unsafe extern "C" fn(webTag: *const ::std::os::raw::c_char)>,
262 #[doc = " Register the JavaScript object and async method list."]
263 pub registerAsyncJavaScriptProxy: ::std::option::Option<
264 unsafe extern "C" fn(
265 webTag: *const ::std::os::raw::c_char,
266 proxyObject: *const ArkWeb_ProxyObject,
267 ),
268 >,
269 #[doc = " @brief Creates a message channel to communicate with HTML and returns\n the message ports representing the message channel endpoints.\n\n @param webTag The name of the web component.\n @param size The quantity of message ports."]
270 pub createWebMessagePorts: ::std::option::Option<
271 unsafe extern "C" fn(
272 webTag: *const ::std::os::raw::c_char,
273 size: *mut usize,
274 ) -> *mut ArkWeb_WebMessagePortPtr,
275 >,
276 #[doc = " @brief Destroy message ports.\n\n @param ports Address of the message ports array pointer.\n @param size The quantity of message ports."]
277 pub destroyWebMessagePorts: ::std::option::Option<
278 unsafe extern "C" fn(ports: *mut *mut ArkWeb_WebMessagePortPtr, size: usize),
279 >,
280 #[doc = " @brief Post message ports to main frame.\n\n @param webTag The name of the web component.\n @param name Name of the message to be sent.\n @param size The quantity of message ports.\n @param url Indicates the URI for receiving the message.\n @return Post web message result code.\n {@link ARKWEB_SUCCESS} post web message success.\n {@link ARKWEB_INVALID_PARAM} the parameter verification fails.\n {@link ARKWEB_INIT_ERROR} no web associated with this webTag."]
281 pub postWebMessage: ::std::option::Option<
282 unsafe extern "C" fn(
283 webTag: *const ::std::os::raw::c_char,
284 name: *const ::std::os::raw::c_char,
285 webMessagePorts: *mut ArkWeb_WebMessagePortPtr,
286 size: usize,
287 url: *const ::std::os::raw::c_char,
288 ) -> ArkWeb_ErrorCode,
289 >,
290 #[doc = " @brief Get the url of the last frame that calls the JavaScriptProxy.\n This should be called on the thread which JavaScriptProxy called.\n\n @return The url of the last frame that calls the JavaScriptProxy.\n @since 14"]
291 #[cfg(feature = "api-14")]
292 pub getLastJavascriptProxyCallingFrameUrl:
293 ::std::option::Option<unsafe extern "C" fn() -> *const ::std::os::raw::c_char>,
294 #[doc = " @brief Register the JavaScript object and method list, the method is callback function that has a return value.\n\n @param webTag The name of the web component.\n @param proxyObject The JavaScript object to register, the object has callback functions with return value.\n @param permission The JSON string, which defaults to null, is used to configure the permission control for\n JSBridge, allowing for the definition of URL whitelists at the object and method levels.\n\n @since 18"]
295 #[cfg(feature = "api-18")]
296 pub registerJavaScriptProxyEx: ::std::option::Option<
297 unsafe extern "C" fn(
298 webTag: *const ::std::os::raw::c_char,
299 proxyObject: *const ArkWeb_ProxyObjectWithResult,
300 permission: *const ::std::os::raw::c_char,
301 ),
302 >,
303 #[doc = " @brief Register the JavaScript object and async method list.\n\n @param webTag The name of the web component.\n @param proxyObject The JavaScript object to register.\n @param permission The JSON string, which defaults to null, is used to configure the permission control\n for JSBridge, allowing for the definition of URL whitelists at the object and method levels.\n\n @since 18"]
304 #[cfg(feature = "api-18")]
305 pub registerAsyncJavaScriptProxyEx: ::std::option::Option<
306 unsafe extern "C" fn(
307 webTag: *const ::std::os::raw::c_char,
308 proxyObject: *const ArkWeb_ProxyObject,
309 permission: *const ::std::os::raw::c_char,
310 ),
311 >,
312}
313#[doc = " @brief Defines the component API for native ArkWeb.\n\n @since 12"]
314#[repr(C)]
315#[derive(Debug, Copy, Clone)]
316pub struct ArkWeb_ComponentAPI {
317 #[doc = " The ArkWeb_ComponentAPI struct size."]
318 pub size: usize,
319 #[doc = " Register the OnControllerAttached callback."]
320 pub onControllerAttached: ::std::option::Option<
321 unsafe extern "C" fn(
322 webTag: *const ::std::os::raw::c_char,
323 callback: ArkWeb_OnComponentCallback,
324 userData: *mut ::std::os::raw::c_void,
325 ),
326 >,
327 #[doc = " Register the OnPageBegin callback."]
328 pub onPageBegin: ::std::option::Option<
329 unsafe extern "C" fn(
330 webTag: *const ::std::os::raw::c_char,
331 callback: ArkWeb_OnComponentCallback,
332 userData: *mut ::std::os::raw::c_void,
333 ),
334 >,
335 #[doc = " Register the OnPageEnd callback."]
336 pub onPageEnd: ::std::option::Option<
337 unsafe extern "C" fn(
338 webTag: *const ::std::os::raw::c_char,
339 callback: ArkWeb_OnComponentCallback,
340 userData: *mut ::std::os::raw::c_void,
341 ),
342 >,
343 #[doc = " Register the OnDestroy callback."]
344 pub onDestroy: ::std::option::Option<
345 unsafe extern "C" fn(
346 webTag: *const ::std::os::raw::c_char,
347 callback: ArkWeb_OnComponentCallback,
348 userData: *mut ::std::os::raw::c_void,
349 ),
350 >,
351}
352#[doc = " @brief Defines the web message API for native ArkWeb.\n Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check\n whether the function structure has a corresponding function pointer to avoid crash\n caused by mismatch between the SDK and the device ROM.\n Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the WebMessagePort-related interface cluster.\n\n @since 12"]
353#[repr(C)]
354#[derive(Debug, Copy, Clone)]
355pub struct ArkWeb_WebMessagePortAPI {
356 #[doc = " The ArkWeb_WebMessagePortAPI struct size."]
357 pub size: usize,
358 #[doc = " @brief Post message to HTML.\n\n @param webMessagePort The ArkWeb_WebMessagePort.\n @param webTag The name of the web component.\n @param webMessage The ArkWeb_WebMessage to send.\n @return Post message result code.\n {@link ARKWEB_SUCCESS} post message success.\n {@link ARKWEB_INVALID_PARAM} the parameter verification fails.\n {@link ARKWEB_INIT_ERROR} no web associated with this webTag."]
359 pub postMessage: ::std::option::Option<
360 unsafe extern "C" fn(
361 webMessagePort: ArkWeb_WebMessagePortPtr,
362 webTag: *const ::std::os::raw::c_char,
363 webMessage: ArkWeb_WebMessagePtr,
364 ) -> ArkWeb_ErrorCode,
365 >,
366 #[doc = " @brief Close the message port.\n\n @param webMessagePort The ArkWeb_WebMessagePort.\n @param webTag The name of the web component."]
367 pub close: ::std::option::Option<
368 unsafe extern "C" fn(
369 webMessagePort: ArkWeb_WebMessagePortPtr,
370 webTag: *const ::std::os::raw::c_char,
371 ),
372 >,
373 #[doc = " @brief Set a callback to receive message from HTML.\n\n @param webMessagePort The ArkWeb_WebMessagePort.\n @param webTag The name of the web component.\n @param messageEventHandler The handler to receive message from HTML.\n @param userData The data set by user."]
374 pub setMessageEventHandler: ::std::option::Option<
375 unsafe extern "C" fn(
376 webMessagePort: ArkWeb_WebMessagePortPtr,
377 webTag: *const ::std::os::raw::c_char,
378 messageEventHandler: ArkWeb_OnMessageEventHandler,
379 userData: *mut ::std::os::raw::c_void,
380 ),
381 >,
382}
383#[doc = " @brief Defines the web message data API for native ArkWeb.\n Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check\n whether the function structure has a corresponding function pointer to avoid crash\n caused by mismatch between the SDK and the device ROM.\n Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the WebMessage-related interface cluster.\n\n @since 12"]
384#[repr(C)]
385#[derive(Debug, Copy, Clone)]
386pub struct ArkWeb_WebMessageAPI {
387 #[doc = " The ArkWeb_WebMessageAPI struct size."]
388 pub size: usize,
389 #[doc = " @brief Used to create a ArkWeb_WebMessage.\n\n @return The created ArkWeb_WebMessage, destroy it through\n destroyWebMessage after it is no longer used."]
390 pub createWebMessage: ::std::option::Option<unsafe extern "C" fn() -> ArkWeb_WebMessagePtr>,
391 #[doc = " @brief Used to destroy a ArkWeb_WebMessage.\n\n @param webMessage The ArkWeb_WebMessage to destroy."]
392 pub destroyWebMessage:
393 ::std::option::Option<unsafe extern "C" fn(webMessage: *mut ArkWeb_WebMessagePtr)>,
394 #[doc = " @brief Set the type of ArkWeb_WebMessage.\n\n @param webMessage The ArkWeb_WebMessage.\n @param type The type of ArkWeb_WebMessage."]
395 pub setType: ::std::option::Option<
396 unsafe extern "C" fn(webMessage: ArkWeb_WebMessagePtr, type_: ArkWeb_WebMessageType),
397 >,
398 #[doc = " @brief Get the type of ArkWeb_WebMessage.\n\n @param webMessage The ArkWeb_WebMessage.\n @return The type of ArkWeb_WebMessage."]
399 pub getType: ::std::option::Option<
400 unsafe extern "C" fn(webMessage: ArkWeb_WebMessagePtr) -> ArkWeb_WebMessageType,
401 >,
402 #[doc = " @brief Set the data of ArkWeb_WebMessage.\n\n @param webMessage The ArkWeb_WebMessage.\n @param data The data of ArkWeb_WebMessage.\n @param dataLength The length of data."]
403 pub setData: ::std::option::Option<
404 unsafe extern "C" fn(
405 webMessage: ArkWeb_WebMessagePtr,
406 data: *mut ::std::os::raw::c_void,
407 dataLength: usize,
408 ),
409 >,
410 #[doc = " @brief Get the data of ArkWeb_WebMessage.\n\n @param webMessage The ArkWeb_WebMessage.\n @param dataLength The length of data.\n @return The data of ArkWeb_WebMessage."]
411 pub getData: ::std::option::Option<
412 unsafe extern "C" fn(
413 webMessage: ArkWeb_WebMessagePtr,
414 dataLength: *mut usize,
415 ) -> *mut ::std::os::raw::c_void,
416 >,
417}
418#[doc = " @brief Defines the native CookieManager API for ArkWeb.\n Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check\n whether the function structure has a corresponding function pointer to avoid crash\n caused by mismatch between the SDK and the device ROM.\n Use OH_ArkWeb_GetNativeAPI in the UI thread to obtain the CookieManager-related interface cluster.\n\n @since 12"]
419#[repr(C)]
420#[derive(Debug, Copy, Clone)]
421pub struct ArkWeb_CookieManagerAPI {
422 #[doc = " The ArkWeb_CookieManagerAPI struct size."]
423 pub size: usize,
424 #[doc = " @brief Obtains the cookie value corresponding to a specified URL.\n\n @param url URL to which the cookie to be obtained belongs. A complete URL is recommended.\n @param incognito True indicates that the memory cookies of the webview in privacy mode are obtained,\n and false indicates that cookies in non-privacy mode are obtained.\n @param includeHttpOnly If true HTTP-only cookies will also be included in the cookieValue.\n @param cookieValue Get the cookie value corresponding to the URL.\n @return Fetch cookie result code.\n {@link ARKWEB_SUCCESS} fetch cookie success.\n {@link ARKWEB_INVALID_URL} invalid url.\n {@link ARKWEB_INVALID_PARAM} cookieValue is nullptr."]
425 pub fetchCookieSync: ::std::option::Option<
426 unsafe extern "C" fn(
427 url: *const ::std::os::raw::c_char,
428 incognito: bool,
429 includeHttpOnly: bool,
430 cookieValue: *mut *mut ::std::os::raw::c_char,
431 ) -> ArkWeb_ErrorCode,
432 >,
433 #[doc = " @brief Sets the cookie value for a specified URL.\n\n @param url Specifies the URL to which the cookie belongs. A complete URL is recommended.\n @param cookieValue The value of the cookie to be set.\n @param incognito True indicates that cookies of the corresponding URL are set in privacy mode,\n and false indicates that cookies of the corresponding URL are set in non-privacy mode.\n @param includeHttpOnly If true, HTTP-only cookies can also be overwritten.\n @return Config cookie result code.\n {@link ARKWEB_SUCCESS} config cookie success.\n {@link ARKWEB_INVALID_URL} invalid url.\n {@link ARKWEB_INVALID_COOKIE_VALUE} invalid cookie value."]
434 pub configCookieSync: ::std::option::Option<
435 unsafe extern "C" fn(
436 url: *const ::std::os::raw::c_char,
437 cookieValue: *const ::std::os::raw::c_char,
438 incognito: bool,
439 includeHttpOnly: bool,
440 ) -> ArkWeb_ErrorCode,
441 >,
442 #[doc = " @brief Check whether cookies exist.\n\n @param incognito True indicates whether cookies exist in privacy mode,\n and false indicates whether cookies exist in non-privacy mode.\n @return True indicates that the cookie exists, and false indicates that the cookie does not exist."]
443 pub existCookies: ::std::option::Option<unsafe extern "C" fn(incognito: bool) -> bool>,
444 #[doc = " @brief Clear all cookies.\n\n @param incognito True indicates that all memory cookies of the webview are cleared in privacy mode,\n and false indicates that persistent cookies in non-privacy mode are cleared."]
445 pub clearAllCookiesSync: ::std::option::Option<unsafe extern "C" fn(incognito: bool)>,
446 #[doc = " @brief Clear all session cookies."]
447 pub clearSessionCookiesSync: ::std::option::Option<unsafe extern "C" fn()>,
448}
449#[doc = " @brief Defines the native JavaScriptValue API for ArkWeb.\n Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check\n whether the function structure has a corresponding function pointer to avoid crash\n caused by mismatch between the SDK and the device ROM.\n\n @since 18"]
450#[cfg(feature = "api-18")]
451#[repr(C)]
452#[derive(Debug, Copy, Clone)]
453pub struct ArkWeb_JavaScriptValueAPI {
454 #[doc = " The ArkWeb_JavaScriptValueAPI struct size."]
455 pub size: usize,
456 #[doc = " @brief Create the JavaScript value responding to HTML.\n\n @param type The type of ArkWeb_JavaScriptValue.\n @param data The data buffer of ArkWeb_JavaScriptValue.\n @param dataLength The length of data buffer.\n @return ArkWeb_JavaScriptValuePtr created by ArkWeb, the memory of ArkWeb_JavaScriptValue\n is managed by ArkWeb itself."]
457 pub createJavaScriptValue: ::std::option::Option<
458 unsafe extern "C" fn(
459 type_: ArkWeb_JavaScriptValueType,
460 data: *mut ::std::os::raw::c_void,
461 dataLength: usize,
462 ) -> ArkWeb_JavaScriptValuePtr,
463 >,
464}
465#[doc = " @brief Defines the native API type of any size.\n\n @since 12"]
466#[repr(C)]
467#[derive(Debug, Copy, Clone)]
468pub struct ArkWeb_AnyNativeAPI {
469 #[doc = " Defines the size information of the native API set."]
470 pub size: usize,
471}
472#[doc = " API type related to ArkWeb component."]
473pub const ArkWeb_NativeAPIVariantKind_ARKWEB_NATIVE_COMPONENT: ArkWeb_NativeAPIVariantKind = 0;
474#[doc = " API type related to ArkWeb controller."]
475pub const ArkWeb_NativeAPIVariantKind_ARKWEB_NATIVE_CONTROLLER: ArkWeb_NativeAPIVariantKind = 1;
476#[doc = " API type related to ArkWeb WebMessagePort."]
477pub const ArkWeb_NativeAPIVariantKind_ARKWEB_NATIVE_WEB_MESSAGE_PORT: ArkWeb_NativeAPIVariantKind =
478 2;
479#[doc = " API type related to ArkWeb WebMessage."]
480pub const ArkWeb_NativeAPIVariantKind_ARKWEB_NATIVE_WEB_MESSAGE: ArkWeb_NativeAPIVariantKind = 3;
481#[doc = " API type related to ArkWeb cookie manager."]
482pub const ArkWeb_NativeAPIVariantKind_ARKWEB_NATIVE_COOKIE_MANAGER: ArkWeb_NativeAPIVariantKind = 4;
483#[doc = " @brief API type related to ArkWeb JavaScript value.\n\n @since 18"]
484#[cfg(feature = "api-18")]
485pub const ArkWeb_NativeAPIVariantKind_ARKWEB_NATIVE_JAVASCRIPT_VALUE: ArkWeb_NativeAPIVariantKind =
486 5;
487#[doc = " @brief Defines the native API set type.\n\n @since 12"]
488pub type ArkWeb_NativeAPIVariantKind = u32;
489extern "C" {
490 #[doc = " @brief Obtains the native API set of a specified type.\n @param type Indicates the type of the native API set provided by ArkWeb.\n @return Return the pointer to the native API abstract object that carries the size.\n If the type is incorrect, a null pointer is returned.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
491 pub fn OH_ArkWeb_GetNativeAPI(type_: ArkWeb_NativeAPIVariantKind) -> *mut ArkWeb_AnyNativeAPI;
492}
493extern "C" {
494 #[doc = " @brief Register a scrolling event callback.\n @param webTag Name of the **Web** component.\n @param callback Callback used when a page is scrolled.\n @param userData Pointer to user-defined data.\n @return **true** is returned if the operation is successful; otherwise, **false** is returned.\n @since 18"]
495 #[cfg(feature = "api-18")]
496 pub fn OH_ArkWeb_RegisterScrollCallback(
497 webTag: *const ::std::os::raw::c_char,
498 callback: ArkWeb_OnScrollCallback,
499 userData: *mut ::std::os::raw::c_void,
500 ) -> bool;
501}
502#[doc = " @error Normal."]
503pub const ArkWeb_NetError_ARKWEB_NET_OK: ArkWeb_NetError = 0;
504#[doc = " @error An asynchronous IO operation is not yet complete. This usually does not\n indicate a fatal error. Typically this error will be generated as a\n notification to wait for some external notification that the IO operation\n finally completed."]
505pub const ArkWeb_NetError_ARKWEB_ERR_IO_PENDING: ArkWeb_NetError = -1;
506#[doc = " @error A generic failure occurred."]
507pub const ArkWeb_NetError_ARKWEB_ERR_FAILED: ArkWeb_NetError = -2;
508#[doc = " @error An operation was aborted."]
509pub const ArkWeb_NetError_ARKWEB_ERR_ABORTED: ArkWeb_NetError = -3;
510#[doc = " @error An argument to the function is incorrect."]
511pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_ARGUMENT: ArkWeb_NetError = -4;
512#[doc = " @error The handle or file descriptor is invalid."]
513pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_HANDLE: ArkWeb_NetError = -5;
514#[doc = " @error The file or directory cannot be found."]
515pub const ArkWeb_NetError_ARKWEB_ERR_FILE_NOT_FOUND: ArkWeb_NetError = -6;
516#[doc = " @error An operation timed out."]
517pub const ArkWeb_NetError_ARKWEB_ERR_TIMED_OUT: ArkWeb_NetError = -7;
518#[doc = " @error The file is too large."]
519pub const ArkWeb_NetError_ARKWEB_ERR_FILE_TOO_LARGE: ArkWeb_NetError = -8;
520#[doc = " @error An unexpected error. This may be caused by a programming mistake or an\n invalid assumption."]
521pub const ArkWeb_NetError_ARKWEB_ERR_UNEXPECTED: ArkWeb_NetError = -9;
522#[doc = " @error Permission to access a resource, other than the network, was denied."]
523pub const ArkWeb_NetError_ARKWEB_ERR_ACCESS_DENIED: ArkWeb_NetError = -10;
524#[doc = " @error The operation failed because of unimplemented functionality."]
525pub const ArkWeb_NetError_ARKWEB_ERR_NOT_IMPLEMENTED: ArkWeb_NetError = -11;
526#[doc = " @error There were not enough resources to complete the operation."]
527pub const ArkWeb_NetError_ARKWEB_ERR_INSUFFICIENT_RESOURCES: ArkWeb_NetError = -12;
528#[doc = " @error Memory allocation failed."]
529pub const ArkWeb_NetError_ARKWEB_ERR_OUT_OF_MEMORY: ArkWeb_NetError = -13;
530#[doc = " @error The file upload failed because the file's modification time was different\n from the expectation."]
531pub const ArkWeb_NetError_ARKWEB_ERR_UPLOAD_FILE_CHANGED: ArkWeb_NetError = -14;
532#[doc = " @error The socket is not connected."]
533pub const ArkWeb_NetError_ARKWEB_ERR_SOCKET_NOT_CONNECTED: ArkWeb_NetError = -15;
534#[doc = " @error The file already exists."]
535pub const ArkWeb_NetError_ARKWEB_ERR_FILE_EXISTS: ArkWeb_NetError = -16;
536#[doc = " @error The path or file name is too long."]
537pub const ArkWeb_NetError_ARKWEB_ERR_FILE_PATH_TOO_LONG: ArkWeb_NetError = -17;
538#[doc = " @error Not enough room left on the disk."]
539pub const ArkWeb_NetError_ARKWEB_ERR_FILE_NO_SPACE: ArkWeb_NetError = -18;
540#[doc = " @error The file has a virus."]
541pub const ArkWeb_NetError_ARKWEB_ERR_FILE_VIRUS_INFECTED: ArkWeb_NetError = -19;
542#[doc = " @error The client chose to block the request."]
543pub const ArkWeb_NetError_ARKWEB_ERR_BLOCKED_BY_CLIENT: ArkWeb_NetError = -20;
544#[doc = " @error The network changed."]
545pub const ArkWeb_NetError_ARKWEB_ERR_NETWORK_CHANGED: ArkWeb_NetError = -21;
546#[doc = " @error The request was blocked by the URL block list configured by the domain\n administrator."]
547pub const ArkWeb_NetError_ARKWEB_ERR_BLOCKED_BY_ADMINISTRATOR: ArkWeb_NetError = -22;
548#[doc = " @error The socket is already connected."]
549pub const ArkWeb_NetError_ARKWEB_ERR_SOCKET_CONNECTED: ArkWeb_NetError = -23;
550#[doc = " @error The upload failed because the upload stream needed to be re-read, due to a\n retry or a redirect, but the upload stream doesn't support that operation."]
551pub const ArkWeb_NetError_ARKWEB_ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED: ArkWeb_NetError = -25;
552#[doc = " @error The request failed because the URLRequestContext is shutting down, or has\n been shut down."]
553pub const ArkWeb_NetError_ARKWEB_ERR_CONTEXT_SHUT_DOWN: ArkWeb_NetError = -26;
554#[doc = " @error The request failed because the response was delivered along with requirements\n which are not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor\n checks and 'Cross-Origin-Resource-Policy' for instance)."]
555pub const ArkWeb_NetError_ARKWEB_ERR_BLOCKED_BY_RESPONSE: ArkWeb_NetError = -27;
556#[doc = " @error The request was blocked by system policy disallowing some or all cleartext\n requests."]
557pub const ArkWeb_NetError_ARKWEB_ERR_CLEARTEXT_NOT_PERMITTED: ArkWeb_NetError = -29;
558#[doc = " @error The request was blocked by a Content Security Policy."]
559pub const ArkWeb_NetError_ARKWEB_ERR_BLOCKED_BY_CSP: ArkWeb_NetError = -30;
560#[doc = " @error The request was blocked because of no H/2 or QUIC session."]
561pub const ArkWeb_NetError_ARKWEB_ERR_H2_OR_QUIC_REQUIRED: ArkWeb_NetError = -31;
562#[doc = " @error The request was blocked by CORB or ORB."]
563pub const ArkWeb_NetError_ARKWEB_ERR_BLOCKED_BY_ORB: ArkWeb_NetError = -32;
564#[doc = " @error A connection was closed (corresponding to a TCP FIN)."]
565pub const ArkWeb_NetError_ARKWEB_ERR_CONNECTION_CLOSED: ArkWeb_NetError = -100;
566#[doc = " @error A connection was reset (corresponding to a TCP RST)."]
567pub const ArkWeb_NetError_ARKWEB_ERR_CONNECTION_RESET: ArkWeb_NetError = -101;
568#[doc = " @error A connection attempt was refused."]
569pub const ArkWeb_NetError_ARKWEB_ERR_CONNECTION_REFUSED: ArkWeb_NetError = -102;
570#[doc = " @error A connection timed out as a result of not receiving an ACK for data sent.\n This can include a FIN packet that did not get ACK'd."]
571pub const ArkWeb_NetError_ARKWEB_ERR_CONNECTION_ABORTED: ArkWeb_NetError = -103;
572#[doc = " @error A connection attempt failed."]
573pub const ArkWeb_NetError_ARKWEB_ERR_CONNECTION_FAILED: ArkWeb_NetError = -104;
574#[doc = " @error The host name could not be resolved."]
575pub const ArkWeb_NetError_ARKWEB_ERR_NAME_NOT_RESOLVED: ArkWeb_NetError = -105;
576#[doc = " @error The Internet connection has been lost."]
577pub const ArkWeb_NetError_ARKWEB_ERR_INTERNET_DISCONNECTED: ArkWeb_NetError = -106;
578#[doc = " @error An SSL protocol error occurred."]
579pub const ArkWeb_NetError_ARKWEB_ERR_SSL_PROTOCOL_ERROR: ArkWeb_NetError = -107;
580#[doc = " @error The IP address or port number is invalid (e.g., cannot connect to the IP\n address 0 or the port 0)."]
581pub const ArkWeb_NetError_ARKWEB_ERR_ADDRESS_INVALID: ArkWeb_NetError = -108;
582#[doc = " @error The IP address is unreachable. This usually means that there is no route to\n the specified host or network."]
583pub const ArkWeb_NetError_ARKWEB_ERR_ADDRESS_UNREACHABLE: ArkWeb_NetError = -109;
584#[doc = " @error The server requested a client certificate for SSL client authentication."]
585pub const ArkWeb_NetError_ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NEEDED: ArkWeb_NetError = -110;
586#[doc = " @error A tunnel connection through the proxy could not be established."]
587pub const ArkWeb_NetError_ARKWEB_ERR_TUNNEL_CONNECTION_FAILED: ArkWeb_NetError = -111;
588#[doc = " @error No SSL protocol versions are enabled."]
589pub const ArkWeb_NetError_ARKWEB_ERR_NO_SSL_VERSIONS_ENABLED: ArkWeb_NetError = -112;
590#[doc = " @error The client and server don't support a common SSL protocol version or\n cipher suite."]
591pub const ArkWeb_NetError_ARKWEB_ERR_SSL_VERSION_OR_CIPHER_MISMATCH: ArkWeb_NetError = -113;
592#[doc = " @error The server requested a renegotiation (rehandshake)."]
593pub const ArkWeb_NetError_ARKWEB_ERR_SSL_RENEGOTIATION_REQUESTED: ArkWeb_NetError = -114;
594#[doc = " @error The proxy requested authentication (for tunnel establishment, with an\n unsupported method."]
595pub const ArkWeb_NetError_ARKWEB_ERR_PROXY_AUTH_UNSUPPORTED: ArkWeb_NetError = -115;
596#[doc = " @error The SSL handshake failed because of a bad or missing client certificate."]
597pub const ArkWeb_NetError_ARKWEB_ERR_BAD_SSL_CLIENT_AUTH_CERT: ArkWeb_NetError = -117;
598#[doc = " @error A connection attempt timed out."]
599pub const ArkWeb_NetError_ARKWEB_ERR_CONNECTION_TIMED_OUT: ArkWeb_NetError = -118;
600#[doc = " @error There are too many pending DNS resolves, so a request in the queue was\n aborted."]
601pub const ArkWeb_NetError_ARKWEB_ERR_HOST_RESOLVER_QUEUE_TOO_LARGE: ArkWeb_NetError = -119;
602#[doc = " @error Failed establishing a connection to the SOCKS proxy server for a target host."]
603pub const ArkWeb_NetError_ARKWEB_ERR_SOCKS_CONNECTION_FAILED: ArkWeb_NetError = -120;
604#[doc = " @error The SOCKS proxy server failed establishing connection to the target host\n because that host is unreachable."]
605pub const ArkWeb_NetError_ARKWEB_ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: ArkWeb_NetError = -121;
606#[doc = " @error The request to negotiate an alternate protocol failed."]
607pub const ArkWeb_NetError_ARKWEB_ERR_ALPN_NEGOTIATION_FAILED: ArkWeb_NetError = -122;
608#[doc = " @error The peer sent an SSL no_renegotiation alert message."]
609pub const ArkWeb_NetError_ARKWEB_ERR_SSL_NO_RENEGOTIATION: ArkWeb_NetError = -123;
610#[doc = " @error Winsock sometimes reports more data written than passed. This is probably\n due to a broken LSP."]
611pub const ArkWeb_NetError_ARKWEB_ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES: ArkWeb_NetError = -124;
612#[doc = " @error An SSL peer sent us a fatal decompression_failure alert. This typically\n occurs when a peer selects DEFLATE compression in the mistaken belief that\n it supports it."]
613pub const ArkWeb_NetError_ARKWEB_ERR_SSL_DECOMPRESSION_FAILURE_ALERT: ArkWeb_NetError = -125;
614#[doc = " @error An SSL peer sent us a fatal bad_record_mac alert. This has been observed\n from servers with buggy DEFLATE support."]
615pub const ArkWeb_NetError_ARKWEB_ERR_SSL_BAD_RECORD_MAC_ALERT: ArkWeb_NetError = -126;
616#[doc = " @error The proxy requested authentication (for tunnel establishment)."]
617pub const ArkWeb_NetError_ARKWEB_ERR_PROXY_AUTH_REQUESTED: ArkWeb_NetError = -127;
618#[doc = " @error Could not create a connection to the proxy server. An error occurred\n either in resolving its name, or in connecting a socket to it.\n Note that this does NOT include failures during the actual \"CONNECT\" method\n of an HTTP proxy."]
619pub const ArkWeb_NetError_ARKWEB_ERR_PROXY_CONNECTION_FAILED: ArkWeb_NetError = -130;
620#[doc = " @error A mandatory proxy configuration could not be used. Currently this means\n that a mandatory PAC script could not be fetched, parsed or executed."]
621pub const ArkWeb_NetError_ARKWEB_ERR_MANDATORY_PROXY_CONFIGURATION_FAILED: ArkWeb_NetError = -131;
622#[doc = " @error We've hit the max socket limit for the socket pool while preconnecting. We\n don't bother trying to preconnect more sockets."]
623pub const ArkWeb_NetError_ARKWEB_ERR_PRECONNECT_MAX_SOCKET_LIMIT: ArkWeb_NetError = -133;
624#[doc = " @error The permission to use the SSL client certificate's private key was denied."]
625pub const ArkWeb_NetError_ARKWEB_ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED: ArkWeb_NetError =
626 -134;
627#[doc = " @error The SSL client certificate has no private key."]
628pub const ArkWeb_NetError_ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY: ArkWeb_NetError = -135;
629#[doc = " @error The certificate presented by the HTTPS Proxy was invalid."]
630pub const ArkWeb_NetError_ARKWEB_ERR_PROXY_CERTIFICATE_INVALID: ArkWeb_NetError = -136;
631#[doc = " @error An error occurred when trying to do a name resolution (DNS)."]
632pub const ArkWeb_NetError_ARKWEB_ERR_NAME_RESOLUTION_FAILED: ArkWeb_NetError = -137;
633#[doc = " @error Permission to access the network was denied. This is used to distinguish\n errors that were most likely caused by a firewall from other access denied\n errors. See also ERR_ACCESS_DENIED."]
634pub const ArkWeb_NetError_ARKWEB_ERR_NETWORK_ACCESS_DENIED: ArkWeb_NetError = -138;
635#[doc = " @error The request throttler module cancelled this request to avoid DDOS."]
636pub const ArkWeb_NetError_ARKWEB_ERR_TEMPORARILY_THROTTLED: ArkWeb_NetError = -139;
637#[doc = " @error A request to create an SSL tunnel connection through the HTTPS proxy\n received a 302 (temporary redirect, response. The response body might\n include a description of why the request failed."]
638pub const ArkWeb_NetError_ARKWEB_ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT: ArkWeb_NetError = -140;
639#[doc = " @error We were unable to sign the CertificateVerify data of an SSL client auth\n handshake with the client certificate's private key.\n Possible causes for this include the user implicitly or explicitly\n denying access to the private key, the private key may not be valid for\n signing, the key may be relying on a cached handle which is no longer\n valid, or the CSP won't allow arbitrary data to be signed."]
640pub const ArkWeb_NetError_ARKWEB_ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED: ArkWeb_NetError = -141;
641#[doc = " @error The message was too large for the transport. (for example a UDP message\n which exceeds size threshold)."]
642pub const ArkWeb_NetError_ARKWEB_ERR_MSG_TOO_BIG: ArkWeb_NetError = -142;
643#[doc = " @error Websocket protocol error. Indicates that we are terminating the connection\n due to a malformed frame or other protocol violation."]
644pub const ArkWeb_NetError_ARKWEB_ERR_WS_PROTOCOL_ERROR: ArkWeb_NetError = -145;
645#[doc = " @error Returned when attempting to bind an address that is already in use."]
646pub const ArkWeb_NetError_ARKWEB_ERR_ADDRESS_IN_USE: ArkWeb_NetError = -147;
647#[doc = " @error An operation failed because the SSL handshake has not completed."]
648pub const ArkWeb_NetError_ARKWEB_ERR_SSL_HANDSHAKE_NOT_COMPLETED: ArkWeb_NetError = -148;
649#[doc = " @error SSL peer's public key is invalid."]
650pub const ArkWeb_NetError_ARKWEB_ERR_SSL_BAD_PEER_PUBLIC_KEY: ArkWeb_NetError = -149;
651#[doc = " @error The certificate didn't match the built-in public key pins for the host name.\n The pins are set in net/http/transport_security_state.cc and require that\n one of a set of public keys exist on the path from the leaf to the root."]
652pub const ArkWeb_NetError_ARKWEB_ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN: ArkWeb_NetError = -150;
653#[doc = " @error Server request for client certificate did not contain any types we support."]
654pub const ArkWeb_NetError_ARKWEB_ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED: ArkWeb_NetError = -151;
655#[doc = " @error An SSL peer sent us a fatal decrypt_error alert. This typically occurs when\n a peer could not correctly verify a signature (in CertificateVerify or\n ServerKeyExchange, or validate a Finished message."]
656pub const ArkWeb_NetError_ARKWEB_ERR_SSL_DECRYPT_ERROR_ALERT: ArkWeb_NetError = -153;
657#[doc = " @error There are too many pending WebSocketJob instances, so the new job was not\n pushed to the queue."]
658pub const ArkWeb_NetError_ARKWEB_ERR_WS_THROTTLE_QUEUE_TOO_LARGE: ArkWeb_NetError = -154;
659#[doc = " @error The SSL server certificate changed in a renegotiation."]
660pub const ArkWeb_NetError_ARKWEB_ERR_SSL_SERVER_CERT_CHANGED: ArkWeb_NetError = -156;
661#[doc = " @error The SSL server sent us a fatal unrecognized_name alert."]
662pub const ArkWeb_NetError_ARKWEB_ERR_SSL_UNRECOGNIZED_NAME_ALERT: ArkWeb_NetError = -159;
663#[doc = " @error Failed to set the socket's receive buffer size as requested."]
664pub const ArkWeb_NetError_ARKWEB_ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR: ArkWeb_NetError = -160;
665#[doc = " @error Failed to set the socket's send buffer size as requested."]
666pub const ArkWeb_NetError_ARKWEB_ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR: ArkWeb_NetError = -161;
667#[doc = " @error Failed to set the socket's receive buffer size as requested, despite success\n return code from setsockopt."]
668pub const ArkWeb_NetError_ARKWEB_ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE: ArkWeb_NetError =
669 -162;
670#[doc = " @error Failed to set the socket's send buffer size as requested, despite success\n return code from setsockopt."]
671pub const ArkWeb_NetError_ARKWEB_ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE: ArkWeb_NetError = -163;
672#[doc = " @error Failed to import a client certificate from the platform store into the SSL\n library."]
673pub const ArkWeb_NetError_ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT: ArkWeb_NetError = -164;
674#[doc = " @error Resolving a hostname to an IP address list included the IPv4 address\n \"127.0.53.53\". This is a special IP address which ICANN has recommended to\n indicate there was a name collision, and alert admins to a potential\n problem."]
675pub const ArkWeb_NetError_ARKWEB_ERR_ICANN_NAME_COLLISION: ArkWeb_NetError = -166;
676#[doc = " @error The SSL server presented a certificate which could not be decoded. This is\n not a certificate error code as no X509Certificate object is available. This\n error is fatal."]
677pub const ArkWeb_NetError_ARKWEB_ERR_SSL_SERVER_CERT_BAD_FORMAT: ArkWeb_NetError = -167;
678#[doc = " @error Certificate Transparency: Received a signed tree head that failed to parse."]
679pub const ArkWeb_NetError_ARKWEB_ERR_CT_STH_PARSING_FAILED: ArkWeb_NetError = -168;
680#[doc = " @error Certificate Transparency: Received a signed tree head whose JSON parsing was\n OK but was missing some of the fields."]
681pub const ArkWeb_NetError_ARKWEB_ERR_CT_STH_INCOMPLETE: ArkWeb_NetError = -169;
682#[doc = " @error The attempt to reuse a connection to send proxy auth credentials failed\n before the AuthController was used to generate credentials. The caller should\n reuse the controller with a new connection. This error is only used\n internally by the network stack."]
683pub const ArkWeb_NetError_ARKWEB_ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH: ArkWeb_NetError =
684 -170;
685#[doc = " @error Certificate Transparency: Failed to parse the received consistency proof."]
686pub const ArkWeb_NetError_ARKWEB_ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED: ArkWeb_NetError = -171;
687#[doc = " @error The SSL server required an unsupported cipher suite that has since been\n removed. This error will temporarily be signaled on a fallback for one or two\n releases immediately following a cipher suite's removal, after which the\n fallback will be removed."]
688pub const ArkWeb_NetError_ARKWEB_ERR_SSL_OBSOLETE_CIPHER: ArkWeb_NetError = -172;
689#[doc = " @error When a WebSocket handshake is done successfully and the connection has been\n upgraded, the URLRequest is cancelled with this error code."]
690pub const ArkWeb_NetError_ARKWEB_ERR_WS_UPGRADE: ArkWeb_NetError = -173;
691#[doc = " @error Socket ReadIfReady support is not implemented. This error should not be user\n visible, because the normal Read(, method is used as a fallback."]
692pub const ArkWeb_NetError_ARKWEB_ERR_READ_IF_READY_NOT_IMPLEMENTED: ArkWeb_NetError = -174;
693#[doc = " @error No socket buffer space is available."]
694pub const ArkWeb_NetError_ARKWEB_ERR_NO_BUFFER_SPACE: ArkWeb_NetError = -176;
695#[doc = " @error There were no common signature algorithms between our client certificate\n private key and the server's preferences."]
696pub const ArkWeb_NetError_ARKWEB_ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS: ArkWeb_NetError = -177;
697#[doc = " @error TLS 1.3 early data was rejected by the server. This will be received before\n any data is returned from the socket. The request should be retried with\n early data disabled."]
698pub const ArkWeb_NetError_ARKWEB_ERR_EARLY_DATA_REJECTED: ArkWeb_NetError = -178;
699#[doc = " @error TLS 1.3 early data was offered, but the server responded with TLS 1.2 or\n earlier. This is an internal error code to account for a\n backwards-compatibility issue with early data and TLS 1.2. It will be\n received before any data is returned from the socket. The request should be\n retried with early data disabled.\n See https://tools.ietf.org/html/rfc8446#appendix-D.3 for details."]
700pub const ArkWeb_NetError_ARKWEB_ERR_WRONG_VERSION_ON_EARLY_DATA: ArkWeb_NetError = -179;
701#[doc = " @error TLS 1.3 was enabled, but a lower version was negotiated and the server\n returned a value indicating it supported TLS 1.3. This is part of a security\n check in TLS 1.3, but it may also indicate the user is behind a buggy\n TLS-terminating proxy which implemented TLS 1.2 incorrectly. (See\n rhttps://crbug.com/boringssl/226.,"]
702pub const ArkWeb_NetError_ARKWEB_ERR_TLS13_DOWNGRADE_DETECTED: ArkWeb_NetError = -180;
703#[doc = " @error The server's certificate has a keyUsage extension incompatible with the\n negotiated TLS key exchange method."]
704pub const ArkWeb_NetError_ARKWEB_ERR_SSL_KEY_USAGE_INCOMPATIBLE: ArkWeb_NetError = -181;
705#[doc = " @error The ECHConfigList fetched over DNS cannot be parsed."]
706pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_ECH_CONFIG_LIST: ArkWeb_NetError = -182;
707#[doc = " @error ECH was enabled, but the server was unable to decrypt the encrypted\n ClientHello."]
708pub const ArkWeb_NetError_ARKWEB_ERR_ECH_NOT_NEGOTIATED: ArkWeb_NetError = -183;
709#[doc = " @error ECH was enabled, the server was unable to decrypt the encrypted ClientHello,\n and additionally did not present a certificate valid for the public name."]
710pub const ArkWeb_NetError_ARKWEB_ERR_ECH_FALLBACK_CERTIFICATE_INVALID: ArkWeb_NetError = -184;
711#[doc = " @error The server responded with a certificate whose common name did not match\n the host name. This could mean:\n 1. An attacker has redirected our traffic to their server and is\n presenting a certificate for which they know the private key.\n 2. The server is misconfigured and responding with the wrong cert.\n 3. The user is on a wireless network and is being redirected to the\n network's login page.\n 4. The OS has used a DNS search suffix and the server doesn't have\n a certificate for the abbreviated name in the address bar."]
712pub const ArkWeb_NetError_ARKWEB_ERR_CERT_COMMON_NAME_INVALID: ArkWeb_NetError = -200;
713#[doc = " @error The server responded with a certificate that, by our clock, appears to\n either not yet be valid or to have expired. This could mean:\n 1. An attacker is presenting an old certificate for which they have\n managed to obtain the private key.\n 2. The server is misconfigured and is not presenting a valid cert.\n 3. Our clock is wrong."]
714pub const ArkWeb_NetError_ARKWEB_ERR_CERT_DATE_INVALID: ArkWeb_NetError = -201;
715#[doc = " @error The server responded with a certificate that is signed by an authority\n we don't trust. The could mean:\n 1. An attacker has substituted the real certificate for a cert that\n contains their public key and is signed by their cousin.\n 2. The server operator has a legitimate certificate from a CA we don't\n know about, but should trust.\n 3. The server is presenting a self-signed certificate, providing no\n defense against active attackers (but foiling passive attackers)."]
716pub const ArkWeb_NetError_ARKWEB_ERR_CERT_AUTHORITY_INVALID: ArkWeb_NetError = -202;
717#[doc = " @error The server responded with a certificate that contains errors.\n This error is not recoverable.\n MSDN describes this error as follows:\n \"The SSL certificate contains errors.\"\n NOTE: It's unclear how this differs from ERR_CERT_INVALID. For consistency,\n use that code instead of this one from now on."]
718pub const ArkWeb_NetError_ARKWEB_ERR_CERT_CONTAINS_ERRORS: ArkWeb_NetError = -203;
719#[doc = " @error The certificate has no mechanism for determining if it is revoked. In\n effect, this certificate cannot be revoked."]
720pub const ArkWeb_NetError_ARKWEB_ERR_CERT_NO_REVOCATION_MECHANISM: ArkWeb_NetError = -204;
721#[doc = " @error Revocation information for the security certificate for this site is not\n available. This could mean:\n 1. An attacker has compromised the private key in the certificate and is\n blocking our attempt to find out that the cert was revoked.\n 2. The certificate is unrevoked, but the revocation server is busy or\n unavailable."]
722pub const ArkWeb_NetError_ARKWEB_ERR_CERT_UNABLE_TO_CHECK_REVOCATION: ArkWeb_NetError = -205;
723#[doc = " @error The server responded with a certificate has been revoked.\n We have the capability to ignore this error, but it is probably not the\n thing to do."]
724pub const ArkWeb_NetError_ARKWEB_ERR_CERT_REVOKED: ArkWeb_NetError = -206;
725#[doc = " @error The server responded with a certificate that is invalid.\n This error is not recoverable.\n MSDN describes this error as follows:\n \"The SSL certificate is invalid.\""]
726pub const ArkWeb_NetError_ARKWEB_ERR_CERT_INVALID: ArkWeb_NetError = -207;
727#[doc = " @error The server responded with a certificate that is signed using a weak\n signature algorithm."]
728pub const ArkWeb_NetError_ARKWEB_ERR_CERT_WEAK_SIGNATURE_ALGORITHM: ArkWeb_NetError = -208;
729#[doc = " @error The host name specified in the certificate is not unique."]
730pub const ArkWeb_NetError_ARKWEB_ERR_CERT_NON_UNIQUE_NAME: ArkWeb_NetError = -210;
731#[doc = " @error The server responded with a certificate that contains a weak key (e.g.\n a too-small RSA key)."]
732pub const ArkWeb_NetError_ARKWEB_ERR_CERT_WEAK_KEY: ArkWeb_NetError = -211;
733#[doc = " @error The certificate claimed DNS names that are in violation of name constraints."]
734pub const ArkWeb_NetError_ARKWEB_ERR_CERT_NAME_CONSTRAINT_VIOLATION: ArkWeb_NetError = -212;
735#[doc = " @error The certificate's validity period is too long."]
736pub const ArkWeb_NetError_ARKWEB_ERR_CERT_VALIDITY_TOO_LONG: ArkWeb_NetError = -213;
737#[doc = " @error Certificate Transparency was required for this connection, but the server\n did not provide CT information that complied with the policy."]
738pub const ArkWeb_NetError_ARKWEB_ERR_CERTIFICATE_TRANSPARENCY_REQUIRED: ArkWeb_NetError = -214;
739#[doc = " @error The certificate chained to a legacy Symantec root that is no longer trusted."]
740pub const ArkWeb_NetError_ARKWEB_ERR_CERT_SYMANTEC_LEGACY: ArkWeb_NetError = -215;
741#[doc = " @error The certificate is known to be used for interception by an entity other\n the device owner."]
742pub const ArkWeb_NetError_ARKWEB_ERR_CERT_KNOWN_INTERCEPTION_BLOCKED: ArkWeb_NetError = -217;
743#[doc = " @error The connection uses an obsolete version of SSL/TLS or cipher."]
744pub const ArkWeb_NetError_ARKWEB_ERR_SSL_OBSOLETE_VERSION_OR_CIPHER: ArkWeb_NetError = -218;
745#[doc = " @error The value immediately past the last certificate error code."]
746pub const ArkWeb_NetError_ARKWEB_ERR_CERT_END: ArkWeb_NetError = -219;
747#[doc = " @error The URL is invalid."]
748pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_URL: ArkWeb_NetError = -300;
749#[doc = " @error The scheme of the URL is disallowed."]
750pub const ArkWeb_NetError_ARKWEB_ERR_DISALLOWED_URL_SCHEME: ArkWeb_NetError = -301;
751#[doc = " @error The scheme of the URL is unknown."]
752pub const ArkWeb_NetError_ARKWEB_ERR_UNKNOWN_URL_SCHEME: ArkWeb_NetError = -302;
753#[doc = " @error Attempting to load an URL resulted in a redirect to an invalid URL."]
754pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_REDIRECT: ArkWeb_NetError = -303;
755#[doc = " @error Attempting to load an URL resulted in too many redirects."]
756pub const ArkWeb_NetError_ARKWEB_ERR_TOO_MANY_REDIRECTS: ArkWeb_NetError = -310;
757#[doc = " @error Attempting to load an URL resulted in an unsafe redirect (e.g., a redirect\n to file:// is considered unsafe)."]
758pub const ArkWeb_NetError_ARKWEB_ERR_UNSAFE_REDIRECT: ArkWeb_NetError = -311;
759#[doc = " @error Attempting to load an URL with an unsafe port number."]
760pub const ArkWeb_NetError_ARKWEB_ERR_UNSAFE_PORT: ArkWeb_NetError = -312;
761#[doc = " @error The server's response was invalid."]
762pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_RESPONSE: ArkWeb_NetError = -320;
763#[doc = " @error Error in chunked transfer encoding."]
764pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_CHUNKED_ENCODING: ArkWeb_NetError = -321;
765#[doc = " @error The server did not support the request method."]
766pub const ArkWeb_NetError_ARKWEB_ERR_METHOD_UNSUPPORTED: ArkWeb_NetError = -322;
767#[doc = " @error The response was 407 (Proxy Authentication Required,, yet we did not send\n the request to a proxy."]
768pub const ArkWeb_NetError_ARKWEB_ERR_UNEXPECTED_PROXY_AUTH: ArkWeb_NetError = -323;
769#[doc = " @error The server closed the connection without sending any data."]
770pub const ArkWeb_NetError_ARKWEB_ERR_EMPTY_RESPONSE: ArkWeb_NetError = -324;
771#[doc = " @error The headers section of the response is too large."]
772pub const ArkWeb_NetError_ARKWEB_ERR_RESPONSE_HEADERS_TOO_BIG: ArkWeb_NetError = -325;
773#[doc = " @error The evaluation of the PAC script failed."]
774pub const ArkWeb_NetError_ARKWEB_ERR_PAC_SCRIPT_FAILED: ArkWeb_NetError = -327;
775#[doc = " @error The response was 416 (Requested range not satisfiable, and the server cannot\n satisfy the range requested."]
776pub const ArkWeb_NetError_ARKWEB_ERR_REQUEST_RANGE_NOT_SATISFIABLE: ArkWeb_NetError = -328;
777#[doc = " @error The identity used for authentication is invalid."]
778pub const ArkWeb_NetError_ARKWEB_ERR_MALFORMED_IDENTITY: ArkWeb_NetError = -329;
779#[doc = " @error Content decoding of the response body failed."]
780pub const ArkWeb_NetError_ARKWEB_ERR_CONTENT_DECODING_FAILED: ArkWeb_NetError = -330;
781#[doc = " @error An operation could not be completed because all network IO\n is suspended."]
782pub const ArkWeb_NetError_ARKWEB_ERR_NETWORK_IO_SUSPENDED: ArkWeb_NetError = -331;
783#[doc = " @error FLIP data received without receiving a SYN_REPLY on the stream."]
784pub const ArkWeb_NetError_ARKWEB_ERR_SYN_REPLY_NOT_RECEIVED: ArkWeb_NetError = -332;
785#[doc = " @error Converting the response to target encoding failed."]
786pub const ArkWeb_NetError_ARKWEB_ERR_ENCODING_CONVERSION_FAILED: ArkWeb_NetError = -333;
787#[doc = " @error The server sent an FTP directory listing in a format we do not understand."]
788pub const ArkWeb_NetError_ARKWEB_ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT: ArkWeb_NetError =
789 -334;
790#[doc = " @error There are no supported proxies in the provided list."]
791pub const ArkWeb_NetError_ARKWEB_ERR_NO_SUPPORTED_PROXIES: ArkWeb_NetError = -336;
792#[doc = " @error There is an HTTP/2 protocol error."]
793pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_PROTOCOL_ERROR: ArkWeb_NetError = -337;
794#[doc = " @error Credentials could not be established during HTTP Authentication."]
795pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_AUTH_CREDENTIALS: ArkWeb_NetError = -338;
796#[doc = " @error An HTTP Authentication scheme was tried which is not supported on this\n machine."]
797pub const ArkWeb_NetError_ARKWEB_ERR_UNSUPPORTED_AUTH_SCHEME: ArkWeb_NetError = -339;
798#[doc = " @error Detecting the encoding of the response failed."]
799pub const ArkWeb_NetError_ARKWEB_ERR_ENCODING_DETECTION_FAILED: ArkWeb_NetError = -340;
800#[doc = " @error (GSSAPI, No Kerberos credentials were available during HTTP Authentication."]
801pub const ArkWeb_NetError_ARKWEB_ERR_MISSING_AUTH_CREDENTIALS: ArkWeb_NetError = -341;
802#[doc = " @error An unexpected, but documented, SSPI or GSSAPI status code was returned."]
803pub const ArkWeb_NetError_ARKWEB_ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS: ArkWeb_NetError = -342;
804#[doc = " @error The environment was not set up correctly for authentication (for\n example, no KDC could be found or the principal is unknown."]
805pub const ArkWeb_NetError_ARKWEB_ERR_MISCONFIGURED_AUTH_ENVIRONMENT: ArkWeb_NetError = -343;
806#[doc = " @error An undocumented SSPI or GSSAPI status code was returned."]
807pub const ArkWeb_NetError_ARKWEB_ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS: ArkWeb_NetError = -344;
808#[doc = " @error The HTTP response was too big to drain."]
809pub const ArkWeb_NetError_ARKWEB_ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN: ArkWeb_NetError = -345;
810#[doc = " @error The HTTP response contained multiple distinct Content-Length headers."]
811pub const ArkWeb_NetError_ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH: ArkWeb_NetError =
812 -346;
813#[doc = " @error HTTP/2 headers have been received, but not all of them - status or version\n headers are missing, so we're expecting additional frames to complete them."]
814pub const ArkWeb_NetError_ARKWEB_ERR_INCOMPLETE_HTTP2_HEADERS: ArkWeb_NetError = -347;
815#[doc = " @error No PAC URL configuration could be retrieved from DHCP. This can indicate\n either a failure to retrieve the DHCP configuration, or that there was no\n PAC URL configured in DHCP."]
816pub const ArkWeb_NetError_ARKWEB_ERR_PAC_NOT_IN_DHCP: ArkWeb_NetError = -348;
817#[doc = " @error The HTTP response contained multiple Content-Disposition headers."]
818pub const ArkWeb_NetError_ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION:
819 ArkWeb_NetError = -349;
820#[doc = " @error The HTTP response contained multiple Location headers."]
821pub const ArkWeb_NetError_ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION: ArkWeb_NetError = -350;
822#[doc = " @error HTTP/2 server refused the request without processing, and sent either a\n GOAWAY frame with error code NO_ERROR and Last-Stream-ID lower than the\n stream id corresponding to the request indicating that this request has not\n been processed yet, or a RST_STREAM frame with error code REFUSED_STREAM.\n Client MAY retry (on a different connection). See RFC7540 Section 8.1.4."]
823pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_SERVER_REFUSED_STREAM: ArkWeb_NetError = -351;
824#[doc = " @error HTTP/2 server didn't respond to the PING message."]
825pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_PING_FAILED: ArkWeb_NetError = -352;
826#[doc = " @error The HTTP response body transferred fewer bytes than were advertised by the\n Content-Length header when the connection is closed."]
827pub const ArkWeb_NetError_ARKWEB_ERR_CONTENT_LENGTH_MISMATCH: ArkWeb_NetError = -354;
828#[doc = " @error The HTTP response body is transferred with Chunked-Encoding, but the\n terminating zero-length chunk was never sent when the connection is closed."]
829pub const ArkWeb_NetError_ARKWEB_ERR_INCOMPLETE_CHUNKED_ENCODING: ArkWeb_NetError = -355;
830#[doc = " @error There is a QUIC protocol error."]
831pub const ArkWeb_NetError_ARKWEB_ERR_QUIC_PROTOCOL_ERROR: ArkWeb_NetError = -356;
832#[doc = " @error The HTTP headers were truncated by an EOF."]
833pub const ArkWeb_NetError_ARKWEB_ERR_RESPONSE_HEADERS_TRUNCATED: ArkWeb_NetError = -357;
834#[doc = " @error The QUIC crypto handshake failed. This means that the server was unable\n to read any requests sent, so they may be resent."]
835pub const ArkWeb_NetError_ARKWEB_ERR_QUIC_HANDSHAKE_FAILED: ArkWeb_NetError = -358;
836#[doc = " @error Transport security is inadequate for the HTTP/2 version."]
837pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY: ArkWeb_NetError = -360;
838#[doc = " @error The peer violated HTTP/2 flow control."]
839pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_FLOW_CONTROL_ERROR: ArkWeb_NetError = -361;
840#[doc = " @error The peer sent an improperly sized HTTP/2 frame."]
841pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_FRAME_SIZE_ERROR: ArkWeb_NetError = -362;
842#[doc = " @error Decoding or encoding of compressed HTTP/2 headers failed."]
843pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_COMPRESSION_ERROR: ArkWeb_NetError = -363;
844#[doc = " @error Proxy Auth Requested without a valid Client Socket Handle."]
845pub const ArkWeb_NetError_ARKWEB_ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION: ArkWeb_NetError =
846 -364;
847#[doc = " @error HTTP_1_1_REQUIRED error code received on HTTP/2 session."]
848pub const ArkWeb_NetError_ARKWEB_ERR_HTTP_1_1_REQUIRED: ArkWeb_NetError = -365;
849#[doc = " @error HTTP_1_1_REQUIRED error code received on HTTP/2 session to proxy."]
850pub const ArkWeb_NetError_ARKWEB_ERR_PROXY_HTTP_1_1_REQUIRED: ArkWeb_NetError = -366;
851#[doc = " @error The PAC script terminated fatally and must be reloaded."]
852pub const ArkWeb_NetError_ARKWEB_ERR_PAC_SCRIPT_TERMINATED: ArkWeb_NetError = -367;
853#[doc = " @error The server was expected to return an HTTP/1.x response, but did not. Rather\n than treat it as HTTP/0.9, this error is returned."]
854pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_HTTP_RESPONSE: ArkWeb_NetError = -370;
855#[doc = " @error Initializing content decoding failed."]
856pub const ArkWeb_NetError_ARKWEB_ERR_CONTENT_DECODING_INIT_FAILED: ArkWeb_NetError = -371;
857#[doc = " @error Received HTTP/2 RST_STREAM frame with NO_ERROR error code. This error should\n be handled internally by HTTP/2 code, and should not make it above the\n SpdyStream layer."]
858pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED: ArkWeb_NetError = -372;
859#[doc = " @error The pushed stream claimed by the request is no longer available."]
860pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE: ArkWeb_NetError = -373;
861#[doc = " @error A pushed stream was claimed and later reset by the server. When this happens,\n the request should be retried."]
862pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER: ArkWeb_NetError =
863 -374;
864#[doc = " @error An HTTP transaction was retried too many times due for authentication or\n invalid certificates."]
865pub const ArkWeb_NetError_ARKWEB_ERR_TOO_MANY_RETRIES: ArkWeb_NetError = -375;
866#[doc = " @error Received an HTTP/2 frame on a closed stream."]
867pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_STREAM_CLOSED: ArkWeb_NetError = -376;
868#[doc = " @error Client is refusing an HTTP/2 stream."]
869pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_CLIENT_REFUSED_STREAM: ArkWeb_NetError = -377;
870#[doc = " @error A pushed HTTP/2 stream was claimed by a request based on matching URL and\n request headers, but the pushed response headers do not match the request."]
871pub const ArkWeb_NetError_ARKWEB_ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH: ArkWeb_NetError = -378;
872#[doc = " @error The server returned a non-2xx HTTP response code."]
873pub const ArkWeb_NetError_ARKWEB_ERR_HTTP_RESPONSE_CODE_FAILURE: ArkWeb_NetError = -379;
874#[doc = " @error The certificate presented on a QUIC connection does not chain to a known root\n and the origin connected to is not on a list of domains where unknown roots\n are allowed."]
875pub const ArkWeb_NetError_ARKWEB_ERR_QUIC_UNKNOWN_CERT_ROOT: ArkWeb_NetError = -380;
876#[doc = " @error A GOAWAY frame has been received indicating that the request has not been\n processed and is therefore safe to retry on a different connection."]
877pub const ArkWeb_NetError_ARKWEB_ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED: ArkWeb_NetError = -381;
878#[doc = " @error The ACCEPT_CH restart has been triggered too many times."]
879pub const ArkWeb_NetError_ARKWEB_ERR_TOO_MANY_ACCEPT_CH_RESTARTS: ArkWeb_NetError = -382;
880#[doc = " @error The IP address space of the remote endpoint differed from the previous\n observed value during the same request. Any cache entry for the affected\n request should be invalidated."]
881pub const ArkWeb_NetError_ARKWEB_ERR_INCONSISTENT_IP_ADDRESS_SPACE: ArkWeb_NetError = -383;
882#[doc = " @error The IP address space of the cached remote endpoint is blocked by local\n network access check."]
883pub const ArkWeb_NetError_ARKWEB_ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY : ArkWeb_NetError = - 384 ;
884#[doc = " @error The cache does not have the requested entry."]
885pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_MISS: ArkWeb_NetError = -400;
886#[doc = " @error Unable to read from the disk cache."]
887pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_READ_FAILURE: ArkWeb_NetError = -401;
888#[doc = " @error Unable to write to the disk cache."]
889pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_WRITE_FAILURE: ArkWeb_NetError = -402;
890#[doc = " @error The operation is not supported for this entry."]
891pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_OPERATION_UNSUPPORTED: ArkWeb_NetError = -403;
892#[doc = " @error The disk cache is unable to open this entry."]
893pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_OPEN_FAILURE: ArkWeb_NetError = -404;
894#[doc = " @error The disk cache is unable to create this entry."]
895pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_CREATE_FAILURE: ArkWeb_NetError = -405;
896#[doc = " @error Multiple transactions are racing to create disk cache entries."]
897pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_RACE: ArkWeb_NetError = -406;
898#[doc = " @error The cache was unable to read a checksum record on an entry."]
899pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_CHECKSUM_READ_FAILURE: ArkWeb_NetError = -407;
900#[doc = " @error The cache found an entry with an invalid checksum."]
901pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_CHECKSUM_MISMATCH: ArkWeb_NetError = -408;
902#[doc = " @error Internal error code for the HTTP cache."]
903pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_LOCK_TIMEOUT: ArkWeb_NetError = -409;
904#[doc = " @error Received a challenge after the transaction has read some data, and the\n credentials aren't available."]
905pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_AUTH_FAILURE_AFTER_READ: ArkWeb_NetError = -410;
906#[doc = " @error Internal not-quite error code for the HTTP cache."]
907pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_ENTRY_NOT_SUITABLE: ArkWeb_NetError = -411;
908#[doc = " @error The disk cache is unable to doom this entry."]
909pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_DOOM_FAILURE: ArkWeb_NetError = -412;
910#[doc = " @error The disk cache is unable to open or create this entry."]
911pub const ArkWeb_NetError_ARKWEB_ERR_CACHE_OPEN_OR_CREATE_FAILURE: ArkWeb_NetError = -413;
912#[doc = " @error The server's response was insecure (e.g. there was a cert error)."]
913pub const ArkWeb_NetError_ARKWEB_ERR_INSECURE_RESPONSE: ArkWeb_NetError = -501;
914#[doc = " @error An attempt to import a client certificate failed, as the user's key\n database lacked a corresponding private key."]
915pub const ArkWeb_NetError_ARKWEB_ERR_NO_PRIVATE_KEY_FOR_CERT: ArkWeb_NetError = -502;
916#[doc = " @error An error adding a certificate to the OS certificate database."]
917pub const ArkWeb_NetError_ARKWEB_ERR_ADD_USER_CERT_FAILED: ArkWeb_NetError = -503;
918#[doc = " @error An error occurred while handling a signed exchange."]
919pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_SIGNED_EXCHANGE: ArkWeb_NetError = -504;
920#[doc = " @error An error occurred while handling a Web Bundle source."]
921pub const ArkWeb_NetError_ARKWEB_ERR_INVALID_WEB_BUNDLE: ArkWeb_NetError = -505;
922#[doc = " @error A Trust Tokens protocol operation-executing request failed for one of a\n number of reasons (precondition failure, internal error, bad response)."]
923pub const ArkWeb_NetError_ARKWEB_ERR_TRUST_TOKEN_OPERATION_FAILED: ArkWeb_NetError = -506;
924#[doc = " @error When handling a Trust Tokens protocol operation-executing request, the system\n was able to execute the request's Trust Tokens operation without sending the\n request to its destination."]
925pub const ArkWeb_NetError_ARKWEB_ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST:
926 ArkWeb_NetError = -507;
927#[doc = " @error A generic error for failed FTP control connection command.\n If possible, please use or add a more specific error code."]
928pub const ArkWeb_NetError_ARKWEB_ERR_FTP_FAILED: ArkWeb_NetError = -601;
929#[doc = " @error The server cannot fulfill the request at this point. This is a temporary error.\n FTP response code 421."]
930pub const ArkWeb_NetError_ARKWEB_ERR_FTP_SERVICE_UNAVAILABLE: ArkWeb_NetError = -602;
931#[doc = " @error The server has aborted the transfer.\n FTP response code 426."]
932pub const ArkWeb_NetError_ARKWEB_ERR_FTP_TRANSFER_ABORTED: ArkWeb_NetError = -603;
933#[doc = " @error The file is busy, or some other temporary error condition on opening the file.\n FTP response code 450."]
934pub const ArkWeb_NetError_ARKWEB_ERR_FTP_FILE_BUSY: ArkWeb_NetError = -604;
935#[doc = " @error Server rejected our command because of syntax errors.\n FTP response codes 500, 501."]
936pub const ArkWeb_NetError_ARKWEB_ERR_FTP_SYNTAX_ERROR: ArkWeb_NetError = -605;
937#[doc = " @error Server does not support the command we issued.\n FTP response codes 502, 504."]
938pub const ArkWeb_NetError_ARKWEB_ERR_FTP_COMMAND_UNSUPPORTED: ArkWeb_NetError = -606;
939#[doc = " @error Server rejected our command because we didn't issue the commands in right order.\n FTP response code 503."]
940pub const ArkWeb_NetError_ARKWEB_ERR_FTP_BAD_COMMAND_SEQUENCE: ArkWeb_NetError = -607;
941#[doc = " @error PKCS #12 import failed due to incorrect password."]
942pub const ArkWeb_NetError_ARKWEB_ERR_PKCS12_IMPORT_BAD_PASSWORD: ArkWeb_NetError = -701;
943#[doc = " @error PKCS #12 import failed due to other error."]
944pub const ArkWeb_NetError_ARKWEB_ERR_PKCS12_IMPORT_FAILED: ArkWeb_NetError = -702;
945#[doc = " @error CA import failed - not a CA cert."]
946pub const ArkWeb_NetError_ARKWEB_ERR_IMPORT_CA_CERT_NOT_CA: ArkWeb_NetError = -703;
947#[doc = " @error Import failed - certificate already exists in database."]
948pub const ArkWeb_NetError_ARKWEB_ERR_IMPORT_CERT_ALREADY_EXISTS: ArkWeb_NetError = -704;
949#[doc = " @error CA import failed due to some other error."]
950pub const ArkWeb_NetError_ARKWEB_ERR_IMPORT_CA_CERT_FAILED: ArkWeb_NetError = -705;
951#[doc = " @error Server certificate import failed due to some internal error."]
952pub const ArkWeb_NetError_ARKWEB_ERR_IMPORT_SERVER_CERT_FAILED: ArkWeb_NetError = -706;
953#[doc = " @error PKCS #12 import failed due to invalid MAC."]
954pub const ArkWeb_NetError_ARKWEB_ERR_PKCS12_IMPORT_INVALID_MAC: ArkWeb_NetError = -707;
955#[doc = " @error PKCS #12 import failed due to invalid/corrupt file."]
956pub const ArkWeb_NetError_ARKWEB_ERR_PKCS12_IMPORT_INVALID_FILE: ArkWeb_NetError = -708;
957#[doc = " @error PKCS #12 import failed due to unsupported features."]
958pub const ArkWeb_NetError_ARKWEB_ERR_PKCS12_IMPORT_UNSUPPORTED: ArkWeb_NetError = -709;
959#[doc = " @error Key generation failed."]
960pub const ArkWeb_NetError_ARKWEB_ERR_KEY_GENERATION_FAILED: ArkWeb_NetError = -710;
961#[doc = " @error Failure to export private key."]
962pub const ArkWeb_NetError_ARKWEB_ERR_PRIVATE_KEY_EXPORT_FAILED: ArkWeb_NetError = -712;
963#[doc = " @error Self-signed certificate generation failed."]
964pub const ArkWeb_NetError_ARKWEB_ERR_SELF_SIGNED_CERT_GENERATION_FAILED: ArkWeb_NetError = -713;
965#[doc = " @error The certificate database changed in some way."]
966pub const ArkWeb_NetError_ARKWEB_ERR_CERT_DATABASE_CHANGED: ArkWeb_NetError = -714;
967#[doc = " @error The certificate verifier configuration changed in some way."]
968pub const ArkWeb_NetError_ARKWEB_ERR_CERT_VERIFIER_CHANGED: ArkWeb_NetError = -716;
969#[doc = " @error DNS resolver received a malformed response."]
970pub const ArkWeb_NetError_ARKWEB_ERR_DNS_MALFORMED_RESPONSE: ArkWeb_NetError = -800;
971#[doc = " @error DNS server requires TCP."]
972pub const ArkWeb_NetError_ARKWEB_ERR_DNS_SERVER_REQUIRES_TCP: ArkWeb_NetError = -801;
973#[doc = " @error DNS server failed. This error is returned for all of the following\n error conditions:\n 1 - Format error - The name server was unable to interpret the query.\n 2 - Server failure - The name server was unable to process this query\n due to a problem with the name server.\n 4 - Not Implemented - The name server does not support the requested\n kind of query.\n 5 - Refused - The name server refuses to perform the specified\n operation for policy reasons."]
974pub const ArkWeb_NetError_ARKWEB_ERR_DNS_SERVER_FAILED: ArkWeb_NetError = -802;
975#[doc = " @error DNS transaction timed out."]
976pub const ArkWeb_NetError_ARKWEB_ERR_DNS_TIMED_OUT: ArkWeb_NetError = -803;
977#[doc = " @error The entry was not found in cache or other local sources, for lookups where\n only local sources were queried."]
978pub const ArkWeb_NetError_ARKWEB_ERR_DNS_CACHE_MISS: ArkWeb_NetError = -804;
979#[doc = " @error Suffix search list rules prevent resolution of the given host name."]
980pub const ArkWeb_NetError_ARKWEB_ERR_DNS_SEARCH_EMPTY: ArkWeb_NetError = -805;
981#[doc = " @error Failed to sort addresses according to RFC3484."]
982pub const ArkWeb_NetError_ARKWEB_ERR_DNS_SORT_ERROR: ArkWeb_NetError = -806;
983#[doc = " @error Failed to resolve the hostname of a DNS-over-HTTPS server."]
984pub const ArkWeb_NetError_ARKWEB_ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED:
985 ArkWeb_NetError = -808;
986#[doc = " @error DNS identified the request as disallowed for insecure connection (http/ws).\n Error should be handled as if an HTTP redirect was received to redirect to\n https or wss."]
987pub const ArkWeb_NetError_ARKWEB_ERR_DNS_NAME_HTTPS_ONLY: ArkWeb_NetError = -809;
988#[doc = " @error All DNS requests associated with this job have been cancelled."]
989pub const ArkWeb_NetError_ARKWEB_ERR_DNS_REQUEST_CANCELED: ArkWeb_NetError = -810;
990#[doc = " @error The hostname resolution of HTTPS record was expected to be resolved with\n alpn values of supported protocols, but did not."]
991pub const ArkWeb_NetError_ARKWEB_ERR_DNS_NO_MATCHING_SUPPORTED_ALPN: ArkWeb_NetError = -811;
992pub type ArkWeb_NetError = i32;
993pub const ArkWeb_CustomSchemeOption_OH_ARKWEB_SCHEME_OPTION_NONE: ArkWeb_CustomSchemeOption = 0;
994#[doc = " If ARKWEB_SCHEME_OPTION_STANDARD is set, the scheme will be handled as a standard scheme. The standard\n schemes need to comply with the URL normalization and parsing rules defined in Section 3.1 of RFC 1738,\n which can be found in the http://www.ietf.org/rfc/rfc1738.txt."]
995pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_STANDARD: ArkWeb_CustomSchemeOption = 1;
996#[doc = " If ARKWEB_SCHEME_OPTION_LOCAL is set, the same security rules as those applied to the \"file\" URL will be\n used to handle the scheme."]
997pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_LOCAL: ArkWeb_CustomSchemeOption = 2;
998#[doc = " If ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED is set, then the scheme can only be displayed from other content\n hosted using the same scheme."]
999pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED:
1000 ArkWeb_CustomSchemeOption = 4;
1001#[doc = " If ARKWEB_SCHEME_OPTION_SECURE is set, the same security rules as those applied to the \"https\" URL will be\n used to handle the scheme."]
1002pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_SECURE: ArkWeb_CustomSchemeOption = 8;
1003#[doc = " If ARKWEB_SCHEME_OPTION_CORS_ENABLED is set, then the scheme can be sent CORS requests. In most cases this\n value should be set when ARKWEB_SCHEME_OPTION_STANDARD is set."]
1004pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_CORS_ENABLED: ArkWeb_CustomSchemeOption =
1005 16;
1006#[doc = " If ARKWEB_SCHEME_OPTION_CSP_BYPASSING is set, then this scheme can bypass Content Security Policy (CSP)\n checks. In most cases, this value should not be set when ARKWEB_SCHEME_OPTION_STANDARD is set."]
1007pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_CSP_BYPASSING: ArkWeb_CustomSchemeOption =
1008 32;
1009#[doc = " If ARKWEB_SCHEME_OPTION_FETCH_ENABLED is set, then this scheme can perform FETCH API requests."]
1010pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_FETCH_ENABLED: ArkWeb_CustomSchemeOption =
1011 64;
1012#[doc = " If ARKWEB_SCHEME_OPTION_CODE_CACHE_ENABLED is set, then the js of this scheme can generate code cache."]
1013pub const ArkWeb_CustomSchemeOption_ARKWEB_SCHEME_OPTION_CODE_CACHE_ENABLED:
1014 ArkWeb_CustomSchemeOption = 128;
1015#[doc = " @brief Configuration information for custom schemes.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1016pub type ArkWeb_CustomSchemeOption = u32;
1017#[doc = " Top level page."]
1018pub const ArkWeb_ResourceType_MAIN_FRAME: ArkWeb_ResourceType = 0;
1019#[doc = " Frame or Iframe."]
1020pub const ArkWeb_ResourceType_SUB_FRAME: ArkWeb_ResourceType = 1;
1021#[doc = " CSS stylesheet."]
1022pub const ArkWeb_ResourceType_STYLE_SHEET: ArkWeb_ResourceType = 2;
1023#[doc = " External script."]
1024pub const ArkWeb_ResourceType_SCRIPT: ArkWeb_ResourceType = 3;
1025#[doc = " Image(jpg/gif/png/etc)."]
1026pub const ArkWeb_ResourceType_IMAGE: ArkWeb_ResourceType = 4;
1027#[doc = " Font."]
1028pub const ArkWeb_ResourceType_FONT_RESOURCE: ArkWeb_ResourceType = 5;
1029#[doc = " Some other subresource. This is the default type if the actual type is unknown."]
1030pub const ArkWeb_ResourceType_SUB_RESOURCE: ArkWeb_ResourceType = 6;
1031#[doc = " Object (or embed) tag for a plugin, or a resource that a plugin requested."]
1032pub const ArkWeb_ResourceType_OBJECT: ArkWeb_ResourceType = 7;
1033#[doc = " Media resource."]
1034pub const ArkWeb_ResourceType_MEDIA: ArkWeb_ResourceType = 8;
1035#[doc = " Main resource of a dedicated worker."]
1036pub const ArkWeb_ResourceType_WORKER: ArkWeb_ResourceType = 9;
1037#[doc = " Main resource of a shared worker."]
1038pub const ArkWeb_ResourceType_SHARED_WORKER: ArkWeb_ResourceType = 10;
1039#[doc = " Explicitly requested prefetch."]
1040pub const ArkWeb_ResourceType_PREFETCH: ArkWeb_ResourceType = 11;
1041#[doc = " Favicon."]
1042pub const ArkWeb_ResourceType_FAVICON: ArkWeb_ResourceType = 12;
1043#[doc = " XMLHttpRequest."]
1044pub const ArkWeb_ResourceType_XHR: ArkWeb_ResourceType = 13;
1045#[doc = " Ping request for <a ping>/sendBeacon."]
1046pub const ArkWeb_ResourceType_PING: ArkWeb_ResourceType = 14;
1047#[doc = " The main resource of a service worker."]
1048pub const ArkWeb_ResourceType_SERVICE_WORKER: ArkWeb_ResourceType = 15;
1049#[doc = " Report of Content Security Policy violations."]
1050pub const ArkWeb_ResourceType_CSP_REPORT: ArkWeb_ResourceType = 16;
1051#[doc = " Resource that a plugin requested."]
1052pub const ArkWeb_ResourceType_PLUGIN_RESOURCE: ArkWeb_ResourceType = 17;
1053#[doc = " A main-frame service worker navigation preload request."]
1054pub const ArkWeb_ResourceType_NAVIGATION_PRELOAD_MAIN_FRAME: ArkWeb_ResourceType = 19;
1055#[doc = " A sub-frame service worker navigation preload request."]
1056pub const ArkWeb_ResourceType_NAVIGATION_PRELOAD_SUB_FRAME: ArkWeb_ResourceType = 20;
1057#[doc = " @brief Resource type for a request.\n\n These constants match their equivalents in Chromium's ResourceType and should not be renumbered.\\n\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1058pub type ArkWeb_ResourceType = u32;
1059#[repr(C)]
1060#[derive(Debug, Copy, Clone)]
1061pub struct ArkWeb_SchemeHandler_ {
1062 _unused: [u8; 0],
1063}
1064#[doc = " @brief This class is used to intercept requests for a specified scheme.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1065pub type ArkWeb_SchemeHandler = ArkWeb_SchemeHandler_;
1066#[repr(C)]
1067#[derive(Debug, Copy, Clone)]
1068pub struct ArkWeb_ResourceHandler_ {
1069 _unused: [u8; 0],
1070}
1071#[doc = " @brief Used to intercept url requests.\n\n Response headers and body can be sent through ArkWeb_ResourceHandler.\\n\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1072pub type ArkWeb_ResourceHandler = ArkWeb_ResourceHandler_;
1073#[repr(C)]
1074#[derive(Debug, Copy, Clone)]
1075pub struct ArkWeb_Response_ {
1076 _unused: [u8; 0],
1077}
1078#[doc = " @brief The response of the intercepted request.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1079pub type ArkWeb_Response = ArkWeb_Response_;
1080#[repr(C)]
1081#[derive(Debug, Copy, Clone)]
1082pub struct ArkWeb_ResourceRequest_ {
1083 _unused: [u8; 0],
1084}
1085#[doc = " @brief The info of the request.\n\n You can obtain the requested URL, method, post data, and other information through OH_ArkWeb_ResourceRequest.\\n\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1086pub type ArkWeb_ResourceRequest = ArkWeb_ResourceRequest_;
1087#[repr(C)]
1088#[derive(Debug, Copy, Clone)]
1089pub struct ArkWeb_RequestHeaderList_ {
1090 _unused: [u8; 0],
1091}
1092#[doc = " @brief The request headers of the request.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1093pub type ArkWeb_RequestHeaderList = ArkWeb_RequestHeaderList_;
1094#[repr(C)]
1095#[derive(Debug, Copy, Clone)]
1096pub struct ArkWeb_HttpBodyStream_ {
1097 _unused: [u8; 0],
1098}
1099#[doc = " @brief The http body of the request.\n\n Use OH_ArkWebHttpBodyStream_* interface to read the body.\\n\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1100pub type ArkWeb_HttpBodyStream = ArkWeb_HttpBodyStream_;
1101#[doc = " @brief Callback for handling the request.\n\n This will be called on the IO thread.\\n\n\n @param schemeHandler The ArkWeb_SchemeHandler.\n @param resourceRequest Obtain request's information through this.\n @param resourceHandler The ArkWeb_ResourceHandler for the request. It should not be used if intercept is set to\n false.\n @param intercept If true will intercept the request, if false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1102pub type ArkWeb_OnRequestStart = ::std::option::Option<
1103 unsafe extern "C" fn(
1104 schemeHandler: *const ArkWeb_SchemeHandler,
1105 resourceRequest: *mut ArkWeb_ResourceRequest,
1106 resourceHandler: *const ArkWeb_ResourceHandler,
1107 intercept: *mut bool,
1108 ),
1109>;
1110#[doc = " @brief Callback when the request is completed.\n\n This will be called on the IO thread.\\n\n Should destroy the resourceRequest by ArkWeb_ResourceRequest_Destroy and use ArkWeb_ResourceHandler_Destroy\\n\n destroy the ArkWeb_ResourceHandler received in ArkWeb_OnRequestStart.\\n\n\n @param schemeHandler The ArkWeb_SchemeHandler.\n @param resourceRequest The ArkWeb_ResourceRequest.\n\n @since 12"]
1111pub type ArkWeb_OnRequestStop = ::std::option::Option<
1112 unsafe extern "C" fn(
1113 schemeHandler: *const ArkWeb_SchemeHandler,
1114 resourceRequest: *const ArkWeb_ResourceRequest,
1115 ),
1116>;
1117#[doc = " @brief Callback when the read operation done.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param buffer The buffer to receive data.\n @param bytesRead Callback after OH_ArkWebHttpBodyStream_Read. bytesRead greater than 0 means that the buffer is\n filled with data of bytesRead size. Caller can read from the buffer, and if\n OH_ArkWebHttpBodyStream_IsEOF is false, caller can continue to read the remaining data.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1118pub type ArkWeb_HttpBodyStreamReadCallback = ::std::option::Option<
1119 unsafe extern "C" fn(
1120 httpBodyStream: *const ArkWeb_HttpBodyStream,
1121 buffer: *mut u8,
1122 bytesRead: ::std::os::raw::c_int,
1123 ),
1124>;
1125#[doc = " @brief Callback when the read operation done.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param buffer The buffer to receive data.\n @param bytesRead Callback after OH_ArkWebHttpBodyStream_AsyncRead. bytesRead greater than 0 means that\n the buffer is filled with data of bytesRead size. Caller can read from the buffer, and if\n OH_ArkWebHttpBodyStream_IsEOF is false, caller can continue to read the remaining data.\n\n @since 20"]
1126#[cfg(feature = "api-20")]
1127pub type ArkWeb_HttpBodyStreamAsyncReadCallback = ::std::option::Option<
1128 unsafe extern "C" fn(
1129 httpBodyStream: *const ArkWeb_HttpBodyStream,
1130 buffer: *mut u8,
1131 bytesRead: ::std::os::raw::c_int,
1132 ),
1133>;
1134#[doc = " @brief Callback when the init operation done.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param result {@link ARKWEB_NET_OK} on success otherwise refer to arkweb_net_error_list.h.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1135pub type ArkWeb_HttpBodyStreamInitCallback = ::std::option::Option<
1136 unsafe extern "C" fn(httpBodyStream: *const ArkWeb_HttpBodyStream, result: ArkWeb_NetError),
1137>;
1138extern "C" {
1139 #[doc = " @brief Destroy the ArkWeb_RequestHeaderList.\n @param requestHeaderList The ArkWeb_RequestHeaderList to be destroyed.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1140 pub fn OH_ArkWebRequestHeaderList_Destroy(requestHeaderList: *mut ArkWeb_RequestHeaderList);
1141}
1142extern "C" {
1143 #[doc = " @brief Get the request headers size.\n @param requestHeaderList The list of request header.\n @return The size of request headers. -1 if requestHeaderList is invalid.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1144 pub fn OH_ArkWebRequestHeaderList_GetSize(
1145 requestHeaderList: *const ArkWeb_RequestHeaderList,
1146 ) -> i32;
1147}
1148extern "C" {
1149 #[doc = " @brief Get the specified request header.\n @param requestHeaderList The list of request header.\n @param index The index of request header.\n @param key The header key. Caller must release the string by OH_ArkWeb_ReleaseString.\n @param value The header value. Caller must release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1150 pub fn OH_ArkWebRequestHeaderList_GetHeader(
1151 requestHeaderList: *const ArkWeb_RequestHeaderList,
1152 index: i32,
1153 key: *mut *mut ::std::os::raw::c_char,
1154 value: *mut *mut ::std::os::raw::c_char,
1155 );
1156}
1157extern "C" {
1158 #[doc = " @brief Set a user data to ArkWeb_ResourceRequest.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param userData The user data to set.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1159 pub fn OH_ArkWebResourceRequest_SetUserData(
1160 resourceRequest: *mut ArkWeb_ResourceRequest,
1161 userData: *mut ::std::os::raw::c_void,
1162 ) -> i32;
1163}
1164extern "C" {
1165 #[doc = " @brief Get the user data from ArkWeb_ResourceRequest.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @return The set user data.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1166 pub fn OH_ArkWebResourceRequest_GetUserData(
1167 resourceRequest: *const ArkWeb_ResourceRequest,
1168 ) -> *mut ::std::os::raw::c_void;
1169}
1170extern "C" {
1171 #[doc = " @brief Get the method of request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param method The request's http method. This function will allocate memory for the method string and caller must\n release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1172 pub fn OH_ArkWebResourceRequest_GetMethod(
1173 resourceRequest: *const ArkWeb_ResourceRequest,
1174 method: *mut *mut ::std::os::raw::c_char,
1175 );
1176}
1177extern "C" {
1178 #[doc = " @brief Get the url of request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param url The request's url. This function will allocate memory for the url string and caller must release the\n string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1179 pub fn OH_ArkWebResourceRequest_GetUrl(
1180 resourceRequest: *const ArkWeb_ResourceRequest,
1181 url: *mut *mut ::std::os::raw::c_char,
1182 );
1183}
1184extern "C" {
1185 #[doc = " @brief Create a ArkWeb_HttpBodyStream which used to read the http body.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param httpBodyStream The request's http body. This function will allocate memory for the http body stream and\n caller must release the httpBodyStream by OH_ArkWebResourceRequest_DestroyHttpBodyStream.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1186 pub fn OH_ArkWebResourceRequest_GetHttpBodyStream(
1187 resourceRequest: *const ArkWeb_ResourceRequest,
1188 httpBodyStream: *mut *mut ArkWeb_HttpBodyStream,
1189 );
1190}
1191extern "C" {
1192 #[doc = " @brief Destroy the http body stream.\n @param httpBodyStream The httpBodyStream to be destroyed.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1193 pub fn OH_ArkWebResourceRequest_DestroyHttpBodyStream(
1194 httpBodyStream: *mut ArkWeb_HttpBodyStream,
1195 );
1196}
1197extern "C" {
1198 #[doc = " @brief Get the resource type of request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @return The resource type of request. -1 if resourceRequest is invalid.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1199 pub fn OH_ArkWebResourceRequest_GetResourceType(
1200 resourceRequest: *const ArkWeb_ResourceRequest,
1201 ) -> i32;
1202}
1203extern "C" {
1204 #[doc = " @brief Get the url of frame which trigger this request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param frameUrl The url of frame which trigger this request. This function will allocate memory for the url string\n and caller must release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1205 pub fn OH_ArkWebResourceRequest_GetFrameUrl(
1206 resourceRequest: *const ArkWeb_ResourceRequest,
1207 frameUrl: *mut *mut ::std::os::raw::c_char,
1208 );
1209}
1210extern "C" {
1211 #[doc = " @brief Set a user data to ArkWeb_HttpBodyStream.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param userData The user data to set.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1212 pub fn OH_ArkWebHttpBodyStream_SetUserData(
1213 httpBodyStream: *mut ArkWeb_HttpBodyStream,
1214 userData: *mut ::std::os::raw::c_void,
1215 ) -> i32;
1216}
1217extern "C" {
1218 #[doc = " @brief Get the user data from ArkWeb_HttpBodyStream.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @return The set user data.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1219 pub fn OH_ArkWebHttpBodyStream_GetUserData(
1220 httpBodyStream: *const ArkWeb_HttpBodyStream,
1221 ) -> *mut ::std::os::raw::c_void;
1222}
1223extern "C" {
1224 #[doc = " @brief Set the callback for OH_ArkWebHttpBodyStream_Read.\n\n The result of OH_ArkWebHttpBodyStream_Read will be notified to caller through the readCallback.\\n\n The callback will run in the same thread as OH_ArkWebHttpBodyStream_Read.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param readCallback The callback of read function.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1225 pub fn OH_ArkWebHttpBodyStream_SetReadCallback(
1226 httpBodyStream: *mut ArkWeb_HttpBodyStream,
1227 readCallback: ArkWeb_HttpBodyStreamReadCallback,
1228 ) -> i32;
1229}
1230extern "C" {
1231 #[doc = " @brief Set the callback for OH_ArkWebHttpBodyStream_AsyncRead.\n\n The result of OH_ArkWebHttpBodyStream_AsyncRead will be notified to caller through the\\n\n readCallback. The callback will runs in the ArkWeb worker thread.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param readCallback The callback of read function.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @since 20"]
1232 #[cfg(feature = "api-20")]
1233 pub fn OH_ArkWebHttpBodyStream_SetAsyncReadCallback(
1234 httpBodyStream: *mut ArkWeb_HttpBodyStream,
1235 readCallback: ArkWeb_HttpBodyStreamAsyncReadCallback,
1236 ) -> i32;
1237}
1238extern "C" {
1239 #[doc = " @brief Init the http body stream.\n\n This function must be called before calling any other functions.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param initCallback The callback of init.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1240 pub fn OH_ArkWebHttpBodyStream_Init(
1241 httpBodyStream: *mut ArkWeb_HttpBodyStream,
1242 initCallback: ArkWeb_HttpBodyStreamInitCallback,
1243 ) -> i32;
1244}
1245extern "C" {
1246 #[doc = " @brief Read the http body to the buffer.\n\n The buffer must be larger than the bufLen. We will be reading data from a worker thread to the buffer,\\n\n so should not use the buffer in other threads before the callback to avoid concurrency issues.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param buffer The buffer to receive data.\n @param bufLen The size of bytes to read.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1247 pub fn OH_ArkWebHttpBodyStream_Read(
1248 httpBodyStream: *const ArkWeb_HttpBodyStream,
1249 buffer: *mut u8,
1250 bufLen: ::std::os::raw::c_int,
1251 );
1252}
1253extern "C" {
1254 #[doc = " @brief Read the http body to the buffer.\n\n The buffer must be larger than the bufLen. We will read data from a worker thread to the buffer,\\n\n so should not use the buffer in other threads before the callback to avoid concurrency issues.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @param buffer The buffer to receive data.\n @param bufLen The size of bytes to read.\n\n @since 20"]
1255 #[cfg(feature = "api-20")]
1256 pub fn OH_ArkWebHttpBodyStream_AsyncRead(
1257 httpBodyStream: *const ArkWeb_HttpBodyStream,
1258 buffer: *mut u8,
1259 bufLen: ::std::os::raw::c_int,
1260 );
1261}
1262extern "C" {
1263 #[doc = " @brief Get the total size of the data stream.\n\n When data is chunked or httpBodyStream is invalid, always return zero.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @return The size of data stream.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1264 pub fn OH_ArkWebHttpBodyStream_GetSize(httpBodyStream: *const ArkWeb_HttpBodyStream) -> u64;
1265}
1266extern "C" {
1267 #[doc = " @brief Get the current position of the data stream.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @return The current position of data stream. 0 if httpBodyStream is invalid.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1268 pub fn OH_ArkWebHttpBodyStream_GetPosition(httpBodyStream: *const ArkWeb_HttpBodyStream)
1269 -> u64;
1270}
1271extern "C" {
1272 #[doc = " @brief Get if the data stream is chunked.\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @return True if is chunked; false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1273 pub fn OH_ArkWebHttpBodyStream_IsChunked(httpBodyStream: *const ArkWeb_HttpBodyStream) -> bool;
1274}
1275extern "C" {
1276 #[doc = " @brief Returns true if all data has been consumed from this upload data stream.\n\n For chunked uploads, returns false until the first read attempt.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @return True if all data has been consumed; false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1277 pub fn OH_ArkWebHttpBodyStream_IsEof(httpBodyStream: *const ArkWeb_HttpBodyStream) -> bool;
1278}
1279extern "C" {
1280 #[doc = " @brief Returns true if the upload data in the stream is entirely in memory,\n and all read requests will succeed synchronously.\n\n Expected to return false for chunked requests.\\n\n\n @param httpBodyStream The ArkWeb_HttpBodyStream.\n @return True if the upload data is in memory; false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1281 pub fn OH_ArkWebHttpBodyStream_IsInMemory(httpBodyStream: *const ArkWeb_HttpBodyStream)
1282 -> bool;
1283}
1284extern "C" {
1285 #[doc = " @brief Destroy the ArkWeb_ResourceRequest.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1286 pub fn OH_ArkWebResourceRequest_Destroy(resourceRequest: *const ArkWeb_ResourceRequest) -> i32;
1287}
1288extern "C" {
1289 #[doc = " @brief Get the referrer of request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param referrer The request's referrer. This function will allocate memory for the post data string and caller\n must release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1290 pub fn OH_ArkWebResourceRequest_GetReferrer(
1291 resourceRequest: *const ArkWeb_ResourceRequest,
1292 referrer: *mut *mut ::std::os::raw::c_char,
1293 );
1294}
1295extern "C" {
1296 #[doc = " @brief Get the OH_ArkWeb_RequestHeaderList of the request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @param requestHeaderList The RequestHeaderList of request.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1297 pub fn OH_ArkWebResourceRequest_GetRequestHeaders(
1298 resourceRequest: *const ArkWeb_ResourceRequest,
1299 requestHeaderList: *mut *mut ArkWeb_RequestHeaderList,
1300 );
1301}
1302extern "C" {
1303 #[doc = " @brief Get if this is a redirect request.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @return True if this is a redirect; false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1304 pub fn OH_ArkWebResourceRequest_IsRedirect(
1305 resourceRequest: *const ArkWeb_ResourceRequest,
1306 ) -> bool;
1307}
1308extern "C" {
1309 #[doc = " @brief Get if this is a request from main frame.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @return True if this is from main frame; false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1310 pub fn OH_ArkWebResourceRequest_IsMainFrame(
1311 resourceRequest: *const ArkWeb_ResourceRequest,
1312 ) -> bool;
1313}
1314extern "C" {
1315 #[doc = " @brief Get if this is a request is triggered by user gesture.\n @param resourceRequest The ArkWeb_ResourceRequest.\n @return True if this is triggered by user gesture; false otherwise.\n\n @since 12"]
1316 pub fn OH_ArkWebResourceRequest_HasGesture(
1317 resourceRequest: *const ArkWeb_ResourceRequest,
1318 ) -> bool;
1319}
1320extern "C" {
1321 #[doc = " @brief Register custom scheme to the ArkWeb.\n\n Should not be called for built-in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.\\n\n This function should be called on main thread.\\n\n\n @param scheme The scheme to regist.\n @param option The configuration of the scheme.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_ERROR_UNKNOWN} 17100100 - Unknown error.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n {@link ARKWEB_SCHEME_REGISTER_FAILED} 17100102 - Register custom schemes should be called\n before create any ArkWeb.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1322 pub fn OH_ArkWeb_RegisterCustomSchemes(
1323 scheme: *const ::std::os::raw::c_char,
1324 option: i32,
1325 ) -> i32;
1326}
1327extern "C" {
1328 #[doc = " @brief Set a ArkWeb_SchemeHandler for a specific scheme to intercept requests of that scheme type.\n\n SchemeHandler should be set after the BrowserContext created.\\n\n Use WebviewController.initializeWebEngine to initialize the BrowserContext without create a ArkWeb.\\n\n\n @param scheme Scheme that need to be intercepted.\n @param schemeHandler The SchemeHandler for the scheme. Only requests triggered by ServiceWorker will be notified\n through this handler.\n @return Return true if set SchemeHandler for specific scheme successful, return false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1329 pub fn OH_ArkWebServiceWorker_SetSchemeHandler(
1330 scheme: *const ::std::os::raw::c_char,
1331 schemeHandler: *mut ArkWeb_SchemeHandler,
1332 ) -> bool;
1333}
1334extern "C" {
1335 #[doc = " @brief Set a ArkWeb_SchemeHandler for a specific scheme to intercept requests of that scheme type.\n\n SchemeHandler should be set after the BrowserContext created.\\n\n Use WebviewController.initializeWebEngine to initialize the BrowserContext without create a ArkWeb.\\n\n\n @param scheme Scheme that need to be intercepted.\n @param webTag The name of the web component.\n @param schemeHandler The SchemeHandler for the scheme. Only requests triggered from the specified web will be\n notified through this handler.\n @return Return true if set SchemeHandler for specific scheme successful, return false otherwise.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1336 pub fn OH_ArkWeb_SetSchemeHandler(
1337 scheme: *const ::std::os::raw::c_char,
1338 webTag: *const ::std::os::raw::c_char,
1339 schemeHandler: *mut ArkWeb_SchemeHandler,
1340 ) -> bool;
1341}
1342extern "C" {
1343 #[doc = " @brief Clear the handler registered on the specified web for service worker.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1344 pub fn OH_ArkWebServiceWorker_ClearSchemeHandlers() -> i32;
1345}
1346extern "C" {
1347 #[doc = " @brief Clear the handler registered on the specified web.\n @param webTag The name of the web component.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1348 pub fn OH_ArkWeb_ClearSchemeHandlers(webTag: *const ::std::os::raw::c_char) -> i32;
1349}
1350extern "C" {
1351 #[doc = " @brief Create a SchemeHandler.\n @param schemeHandler Return the created SchemeHandler. Use OH_ArkWeb_DestroySchemeHandler destroy it when don't\n need it.\n\n @since 12"]
1352 pub fn OH_ArkWeb_CreateSchemeHandler(schemeHandler: *mut *mut ArkWeb_SchemeHandler);
1353}
1354extern "C" {
1355 #[doc = " @brief Destroy a SchemeHandler.\n @param schemeHandler The ArkWeb_SchemeHandler to be destroy.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1356 pub fn OH_ArkWeb_DestroySchemeHandler(schemeHandler: *mut ArkWeb_SchemeHandler);
1357}
1358extern "C" {
1359 #[doc = " @brief Set a user data to ArkWeb_SchemeHandler.\n @param schemeHandler The ArkWeb_SchemeHandler.\n @param userData The user data to set.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1360 pub fn OH_ArkWebSchemeHandler_SetUserData(
1361 schemeHandler: *mut ArkWeb_SchemeHandler,
1362 userData: *mut ::std::os::raw::c_void,
1363 ) -> i32;
1364}
1365extern "C" {
1366 #[doc = " @brief Get the user data from ArkWeb_SchemeHandler.\n @param schemeHandler The ArkWeb_SchemeHandler.\n @return The set user data.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1367 pub fn OH_ArkWebSchemeHandler_GetUserData(
1368 schemeHandler: *const ArkWeb_SchemeHandler,
1369 ) -> *mut ::std::os::raw::c_void;
1370}
1371extern "C" {
1372 #[doc = " @brief Set the OnRequestStart callback for SchemeHandler.\n @param schemeHandler The SchemeHandler for the scheme.\n @param onRequestStart The OnRequestStart callback.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1373 pub fn OH_ArkWebSchemeHandler_SetOnRequestStart(
1374 schemeHandler: *mut ArkWeb_SchemeHandler,
1375 onRequestStart: ArkWeb_OnRequestStart,
1376 ) -> i32;
1377}
1378extern "C" {
1379 #[doc = " @brief Set the OnRequestStop callback for SchemeHandler.\n @param schemeHandler The SchemeHandler for the scheme.\n @param onRequestStop The OnRequestStop callback.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1380 pub fn OH_ArkWebSchemeHandler_SetOnRequestStop(
1381 schemeHandler: *mut ArkWeb_SchemeHandler,
1382 onRequestStop: ArkWeb_OnRequestStop,
1383 ) -> i32;
1384}
1385extern "C" {
1386 #[doc = " @brief Create a Response for a request.\n @param response The created Response. Use OH_ArkWeb_DestroyResponse to destroy when don't need it.\n\n @since 12"]
1387 pub fn OH_ArkWeb_CreateResponse(response: *mut *mut ArkWeb_Response);
1388}
1389extern "C" {
1390 #[doc = " @brief Destroy the Reponse.\n @param response The Response needs destroy.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1391 pub fn OH_ArkWeb_DestroyResponse(response: *mut ArkWeb_Response);
1392}
1393extern "C" {
1394 #[doc = " @brief Set the resolved URL after redirects or changed as a result of HSTS.\n @param response The ArkWeb_Response.\n @param url The resolved URL.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1395 pub fn OH_ArkWebResponse_SetUrl(
1396 response: *mut ArkWeb_Response,
1397 url: *const ::std::os::raw::c_char,
1398 ) -> i32;
1399}
1400extern "C" {
1401 #[doc = " @brief Get the resolved URL after redirects or changed as a result of HSTS.\n @param response The ArkWeb_Response.\n @param url The resolved URL.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1402 pub fn OH_ArkWebResponse_GetUrl(
1403 response: *const ArkWeb_Response,
1404 url: *mut *mut ::std::os::raw::c_char,
1405 );
1406}
1407extern "C" {
1408 #[doc = " @brief Set a error code to ArkWeb_Response.\n @param response The ArkWeb_Response.\n @param errorCode The error code for the failed request.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1409 pub fn OH_ArkWebResponse_SetError(
1410 response: *mut ArkWeb_Response,
1411 errorCode: ArkWeb_NetError,
1412 ) -> i32;
1413}
1414extern "C" {
1415 #[doc = " @brief Get the response's error code.\n @param response The ArkWeb_Response.\n @return The response's error code.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1416 pub fn OH_ArkWebResponse_GetError(response: *const ArkWeb_Response) -> ArkWeb_NetError;
1417}
1418extern "C" {
1419 #[doc = " @brief Set a status code to ArkWebResponse.\n @param response The ArkWeb_Response.\n @param status The http status code for the request.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1420 pub fn OH_ArkWebResponse_SetStatus(
1421 response: *mut ArkWeb_Response,
1422 status: ::std::os::raw::c_int,
1423 ) -> i32;
1424}
1425extern "C" {
1426 #[doc = " @brief Get the response's status code.\n @param response The ArkWeb_Response.\n @return The response's http status code. -1 if response is invalid.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1427 pub fn OH_ArkWebResponse_GetStatus(response: *const ArkWeb_Response) -> ::std::os::raw::c_int;
1428}
1429extern "C" {
1430 #[doc = " @brief Set a status text to ArkWebResponse.\n @param response The ArkWeb_Response.\n @param statusText The status text for the request.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1431 pub fn OH_ArkWebResponse_SetStatusText(
1432 response: *mut ArkWeb_Response,
1433 statusText: *const ::std::os::raw::c_char,
1434 ) -> i32;
1435}
1436extern "C" {
1437 #[doc = " @brief Get the response's status text.\n @param response The ArkWeb_Response.\n @param statusText Return the response's statusText. This function will allocate memory for the statusText string and\n caller must release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1438 pub fn OH_ArkWebResponse_GetStatusText(
1439 response: *const ArkWeb_Response,
1440 statusText: *mut *mut ::std::os::raw::c_char,
1441 );
1442}
1443extern "C" {
1444 #[doc = " @brief Set mime type to ArkWebResponse.\n @param response The ArkWeb_Response.\n @param mimeType The mime type for the request.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1445 pub fn OH_ArkWebResponse_SetMimeType(
1446 response: *mut ArkWeb_Response,
1447 mimeType: *const ::std::os::raw::c_char,
1448 ) -> i32;
1449}
1450extern "C" {
1451 #[doc = " @brief Get the response's mime type.\n @param response The ArkWeb_Response.\n @param mimeType Return the response's mime type. This function will allocate memory for the mime type string and\n caller must release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1452 pub fn OH_ArkWebResponse_GetMimeType(
1453 response: *const ArkWeb_Response,
1454 mimeType: *mut *mut ::std::os::raw::c_char,
1455 );
1456}
1457extern "C" {
1458 #[doc = " @brief Set charset to ArkWeb_Response.\n @param response The ArkWeb_Response.\n @param charset The charset for the request.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1459 pub fn OH_ArkWebResponse_SetCharset(
1460 response: *mut ArkWeb_Response,
1461 charset: *const ::std::os::raw::c_char,
1462 ) -> i32;
1463}
1464extern "C" {
1465 #[doc = " @brief Get the response's charset.\n @param response The ArkWeb_Response.\n @param charset Return the response's charset. This function will allocate memory for the charset string and caller\n must release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1466 pub fn OH_ArkWebResponse_GetCharset(
1467 response: *const ArkWeb_Response,
1468 charset: *mut *mut ::std::os::raw::c_char,
1469 );
1470}
1471extern "C" {
1472 #[doc = " @brief Set a header to ArkWeb_Response.\n @param response The ArkWeb_Response.\n @param name The name of the header.\n @param value The value of the header.\n @param overwrite If true will overwrite the exists header, if false otherwise.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @since 12"]
1473 pub fn OH_ArkWebResponse_SetHeaderByName(
1474 response: *mut ArkWeb_Response,
1475 name: *const ::std::os::raw::c_char,
1476 value: *const ::std::os::raw::c_char,
1477 overwrite: bool,
1478 ) -> i32;
1479}
1480extern "C" {
1481 #[doc = " @brief Get the header from the response.\n @param response The ArkWeb_Response.\n @param name The name of the header.\n @param value Return the header's value. This function will allocate memory for the value string and caller must\n release the string by OH_ArkWeb_ReleaseString.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1482 pub fn OH_ArkWebResponse_GetHeaderByName(
1483 response: *const ArkWeb_Response,
1484 name: *const ::std::os::raw::c_char,
1485 value: *mut *mut ::std::os::raw::c_char,
1486 );
1487}
1488extern "C" {
1489 #[doc = " @brief Destroy the ArkWeb_ResourceHandler.\n @param resourceHandler The ArkWeb_ResourceHandler.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1490 pub fn OH_ArkWebResourceHandler_Destroy(resourceHandler: *const ArkWeb_ResourceHandler) -> i32;
1491}
1492extern "C" {
1493 #[doc = " @brief Pass response headers to intercepted requests.\n @param resourceHandler The ArkWeb_ResourceHandler for the request.\n @param response The ArkWeb_Response for the intercepting requests.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1494 pub fn OH_ArkWebResourceHandler_DidReceiveResponse(
1495 resourceHandler: *const ArkWeb_ResourceHandler,
1496 response: *const ArkWeb_Response,
1497 ) -> i32;
1498}
1499extern "C" {
1500 #[doc = " @brief Pass response body data to intercepted requests.\n @param resourceHandler The ArkWeb_ResourceHandler for the request.\n @param buffer Buffer data to send.\n @param bufLen The size of buffer.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1501 pub fn OH_ArkWebResourceHandler_DidReceiveData(
1502 resourceHandler: *const ArkWeb_ResourceHandler,
1503 buffer: *const u8,
1504 bufLen: i64,
1505 ) -> i32;
1506}
1507extern "C" {
1508 #[doc = " @brief Notify the ArkWeb that this request should be finished and there is no more data available.\n @param resourceHandler The ArkWeb_ResourceHandler for the request.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1509 pub fn OH_ArkWebResourceHandler_DidFinish(
1510 resourceHandler: *const ArkWeb_ResourceHandler,
1511 ) -> i32;
1512}
1513extern "C" {
1514 #[doc = " @brief Notify the ArkWeb that this request should be failed.\n @param resourceHandler The ArkWeb_ResourceHandler for the request.\n @param errorCode The error code for this request. Refer to arkweb_net_error_list.h.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1515 pub fn OH_ArkWebResourceHandler_DidFailWithError(
1516 resourceHandler: *const ArkWeb_ResourceHandler,
1517 errorCode: ArkWeb_NetError,
1518 ) -> i32;
1519}
1520extern "C" {
1521 #[doc = " @brief Notify the ArkWeb that this request should be failed.\n @param resourceHandler The ArkWeb_ResourceHandler for the request.\n @param errorCode The error code for this request. Refer to arkweb_net_error_list.h.\n @param completeIfNoResponse If completeIfNoResponse is true, when DidFailWithErrorV2 is called,\n if DidReceiveResponse has not been called,\n a response is automatically constructed and the current request is terminated.\n @return {@link ARKWEB_NET_OK} 0 - Success.\n {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param, the resourceHandler is nullptr.\n @since 20"]
1522 #[cfg(feature = "api-20")]
1523 pub fn OH_ArkWebResourceHandler_DidFailWithErrorV2(
1524 resourceHandler: *const ArkWeb_ResourceHandler,
1525 errorCode: ArkWeb_NetError,
1526 completeIfNoResponse: bool,
1527 ) -> i32;
1528}
1529extern "C" {
1530 #[doc = " @brief Release the string acquired by native function.\n @param string The string to be released.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1531 pub fn OH_ArkWeb_ReleaseString(string: *mut ::std::os::raw::c_char);
1532}
1533extern "C" {
1534 #[doc = " @brief Release the byte array acquired by native function.\n @param byteArray The byte array to be released.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 12"]
1535 pub fn OH_ArkWeb_ReleaseByteArray(byteArray: *mut u8);
1536}
1537#[doc = " @brief Defines the javascript callback of the web component.\n\n @since 11"]
1538pub type NativeArkWeb_OnJavaScriptCallback =
1539 ::std::option::Option<unsafe extern "C" fn(arg1: *const ::std::os::raw::c_char)>;
1540#[doc = " @brief Defines the javascript proxy callback of the web component.\n\n @since 11"]
1541pub type NativeArkWeb_OnJavaScriptProxyCallback = ::std::option::Option<
1542 unsafe extern "C" fn(
1543 argv: *mut *const ::std::os::raw::c_char,
1544 argc: i32,
1545 ) -> *mut ::std::os::raw::c_char,
1546>;
1547#[doc = " @brief Defines the valid callback of the web component.\n\n @since 11"]
1548pub type NativeArkWeb_OnValidCallback =
1549 ::std::option::Option<unsafe extern "C" fn(arg1: *const ::std::os::raw::c_char)>;
1550#[doc = " @brief Defines the destroy callback of the web component.\n\n @since 11"]
1551pub type NativeArkWeb_OnDestroyCallback =
1552 ::std::option::Option<unsafe extern "C" fn(arg1: *const ::std::os::raw::c_char)>;
1553#[doc = " @brief Defines the callback of save cookie.\n @param errorCode {@link ARKWEB_SUCCESS} Save cookie success.\n {@link ARKWEB_COOKIE_MANAGER_INITIALIZE_FAILED} Cookie manager initialize failed.\n {@link ARKWEB_COOKIE_SAVE_FAILED} Save cookie failed.\n @since 20"]
1554#[cfg(feature = "api-20")]
1555pub type OH_ArkWeb_OnCookieSaveCallback =
1556 ::std::option::Option<unsafe extern "C" fn(errorCode: ArkWeb_ErrorCode)>;
1557#[doc = " @brief Defines the callback function type invoked when the cookie fetching operation completes.\n\n @param errorCode The result code of the cookie fetching operation.\n {@link ARKWEB_SUCCESS} fetch cookie success.\n {@link ARKWEB_INVALID_URL} invalid url.\n {@link ARKWEB_LIBRARY_OPEN_FAILURE} Failed to open the library.\n {@link ARKWEB_LIBRARY_SYMBOL_NOT_FOUND} The required symbol was not found in the library.\n @param cookieValue Get the cookie value corresponding to the URL. This function will allocate memory for the\n cookieValue string and caller must release the string by {@link OH_ArkWeb_ReleaseString}.\n @since 26.0.0"]
1558#[cfg(feature = "api-26")]
1559pub type OH_ArkWeb_OnCookieFetchCallback = ::std::option::Option<
1560 unsafe extern "C" fn(errorCode: ArkWeb_ErrorCode, cookieValue: *mut ::std::os::raw::c_char),
1561>;
1562#[doc = " @brief Describes prediction information about blankless loading, including the first screen similarity, first screen\n loading duration, and error codes. The application determines whether to enable the blankless loading solution based\n on the prediction information.\n\n @since 20"]
1563#[cfg(feature = "api-20")]
1564#[repr(C)]
1565#[derive(Debug, Copy, Clone)]
1566pub struct ArkWeb_BlanklessInfo {
1567 #[doc = " Error codes of blankless loading. For details, see {@link ArkWeb_BlanklessErrorCode}."]
1568 pub errCode: ArkWeb_BlanklessErrorCode,
1569 #[doc = " First screen similarity, which is calculated based on the historical first screen content. The value ranges from\n 0 to 1.0. 1.0 indicates that the content is the same. A value closer to 1 indicates a higher similarity. This\n value is lagging, and the similarity of the local loading is displayed in the next loading. You are advised not\n to enable the blankless loading frame insertion solution when the similarity is low."]
1570 pub similarity: f64,
1571 #[doc = " Loading duration estimated based on the historical first screen loading durations, in milliseconds. The value\n must be greater than 0."]
1572 pub loadingTime: i32,
1573}
1574#[doc = " @brief Default system kernel. For OpenHarmony 6.0, the default kernel is M132.\n\n @since 20"]
1575#[cfg(feature = "api-20")]
1576pub const ArkWebEngineVersion_SYSTEM_DEFAULT: ArkWebEngineVersion = 0;
1577#[doc = " @brief Legacy kernel of OpenHarmony 6.0. You can select this legacy kernel. If it does not exist, the setting\n is invalid.\n\n @since 20"]
1578#[cfg(feature = "api-20")]
1579pub const ArkWebEngineVersion_ARKWEB_M114: ArkWebEngineVersion = 1;
1580#[doc = " @brief Evergreen kernel of OpenHarmony 6.0, which is M132 by default. If it does not exist, the setting is\n invalid.\n\n @since 20"]
1581#[cfg(feature = "api-20")]
1582pub const ArkWebEngineVersion_ARKWEB_M132: ArkWebEngineVersion = 2;
1583#[doc = " @brief Evergreen kernel of OpenHarmony 7.0, which is M144 by default. If it does not exist, the setting is\n invalid.\n\n @since 26.0.0"]
1584#[cfg(feature = "api-26")]
1585pub const ArkWebEngineVersion_ARKWEB_M144: ArkWebEngineVersion = 3;
1586#[doc = " @brief Evergreen kernel, which is the latest kernel of the system. You can choose to use the latest kernel for\n each system version. This setting takes effect for OpenHarmony 6.1 and later versions.\n\n @since 23"]
1587#[cfg(feature = "api-23")]
1588pub const ArkWebEngineVersion_ARKWEB_EVERGREEN: ArkWebEngineVersion = 99999;
1589#[doc = " @brief For details about the ArkWeb kernel version, see\n [Adaptation Guide for the M114 Kernel on OpenHarmony 6.0]\n (https://gitcode.com/openharmony-tpc/chromium_src/blob/master/web/ReleaseNote/CompatibleWithLegacyWebEngine_6.0.md),\n [Adaptation Guide for the M114 Kernel on OpenHarmony 7.0]\n (https://gitcode.com/openharmony-tpc/chromium_src/blob/master/web/ReleaseNote/CompatibleWithLegacyWebEngine_7.0.md).\n\n @since 20"]
1590#[cfg(feature = "api-20")]
1591pub type ArkWebEngineVersion = u32;
1592extern "C" {
1593 #[doc = " @brief Loads a piece of code and execute JS code in the context of the currently displayed page.\n\n @param webTag The name of the web component.\n @param jsCode a piece of javascript code.\n @param callback Callbacks execute JavaScript script results.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1594 pub fn OH_NativeArkWeb_RunJavaScript(
1595 webTag: *const ::std::os::raw::c_char,
1596 jsCode: *const ::std::os::raw::c_char,
1597 callback: NativeArkWeb_OnJavaScriptCallback,
1598 );
1599}
1600extern "C" {
1601 #[doc = " @brief Registers the JavaScript object and method list.\n\n @param webTag The name of the web component.\n @param objName The name of the registered object.\n @param methodList The method of the application side JavaScript object participating in the registration.\n @param callback The callback function registered by developer is called back when HTML side uses.\n @param size The size of the callback.\n @param needRefresh if web need refresh.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1602 pub fn OH_NativeArkWeb_RegisterJavaScriptProxy(
1603 webTag: *const ::std::os::raw::c_char,
1604 objName: *const ::std::os::raw::c_char,
1605 methodList: *mut *const ::std::os::raw::c_char,
1606 callback: *mut NativeArkWeb_OnJavaScriptProxyCallback,
1607 size: i32,
1608 needRefresh: bool,
1609 );
1610}
1611extern "C" {
1612 #[doc = " @brief Deletes the registered object which th given name.\n\n @param webTag The name of the web component.\n @param objName The name of the registered object.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1613 pub fn OH_NativeArkWeb_UnregisterJavaScriptProxy(
1614 webTag: *const ::std::os::raw::c_char,
1615 objName: *const ::std::os::raw::c_char,
1616 );
1617}
1618extern "C" {
1619 #[doc = " @brief Registers the valid callback.\n\n @param webTag The name of the web component.\n @param callback The callback in which we can register object.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1620 pub fn OH_NativeArkWeb_SetJavaScriptProxyValidCallback(
1621 webTag: *const ::std::os::raw::c_char,
1622 callback: NativeArkWeb_OnValidCallback,
1623 );
1624}
1625extern "C" {
1626 #[doc = " @brief Get the valid callback.\n\n @param webTag The name of the web component.\n @return Return the valid callback function registered. If the valid callback function\n specified by the parameter webTag is not set, a null pointer is returned.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1627 pub fn OH_NativeArkWeb_GetJavaScriptProxyValidCallback(
1628 webTag: *const ::std::os::raw::c_char,
1629 ) -> NativeArkWeb_OnValidCallback;
1630}
1631extern "C" {
1632 #[doc = " @brief Registers the destroy callback.\n\n @param webTag The name of the web component.\n @param callback the destroy callback.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1633 pub fn OH_NativeArkWeb_SetDestroyCallback(
1634 webTag: *const ::std::os::raw::c_char,
1635 callback: NativeArkWeb_OnDestroyCallback,
1636 );
1637}
1638extern "C" {
1639 #[doc = " @brief Get the destroy callback.\n\n @param webTag The name of the web component.\n @return Return the destroy callback function registered. If the destroy callback\n function specified by the parameter webTag is not set,\n a null pointer is returned.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 11"]
1640 pub fn OH_NativeArkWeb_GetDestroyCallback(
1641 webTag: *const ::std::os::raw::c_char,
1642 ) -> NativeArkWeb_OnDestroyCallback;
1643}
1644extern "C" {
1645 #[doc = " @brief Loads the data or URL.\n This function should be called on main thread.\n\n @param webTag The name of the web component.\n @param data A string encoded according to \"Base64\" or \"URL\", should not be NULL.\n @param mimeType Media type. For example: \"text/html\", should not be NULL.\n @param encoding Encoding type. For example: \"UTF-8\", should not be NULL.\n @param baseUrl A specified URL path (\"http\"/\"https\"/\"data\" protocol),\n which is assigned to window.origin by the Web component.\n @param historyUrl History URL. When it is not empty, it can be managed by\n history records to realize the back and forth function.\n @return LoadData result code.\n {@link ARKWEB_SUCCESS} load data success.\n {@link ARKWEB_INVALID_PARAM} Mandatory parameters are left unspecified or\n Incorrect parameter types or Parameter verification failed.\n {@link ARKWEB_INIT_ERROR} Initialization error, can't get a valid Web for the webTag.\n {@link ARKWEB_LIBRARY_OPEN_FAILURE} Failed to open the library.\n {@link ARKWEB_LIBRARY_SYMBOL_NOT_FOUND} The required symbol was not found in the library.\n\n @syscap SystemCapability.Web.Webview.Core\n @since 15"]
1646 #[cfg(feature = "api-15")]
1647 pub fn OH_NativeArkWeb_LoadData(
1648 webTag: *const ::std::os::raw::c_char,
1649 data: *const ::std::os::raw::c_char,
1650 mimeType: *const ::std::os::raw::c_char,
1651 encoding: *const ::std::os::raw::c_char,
1652 baseUrl: *const ::std::os::raw::c_char,
1653 historyUrl: *const ::std::os::raw::c_char,
1654 ) -> ArkWeb_ErrorCode;
1655}
1656extern "C" {
1657 #[doc = " @brief Registers a JavaScript object with callback methods, which may return values. This object will be injected\n into all frames of the current page, including all iframes, and will be accessible using the specified\n name in ArkWeb_ProxyObjectWithResult. The object will only be available in JavaScript after the next\n load or reload.\n These methods will be executed in the ArkWeb worker thread.\n\n @param webTag Name of the web component.\n @param proxyObject JavaScript object to register, the object has callback functions with return value.\n @param permission Optional JSON string(default is null) for JSBridge permission control,\n allowing URL whitelist configuration at object-level and method-level.\n @syscap SystemCapability.Web.Webview.Core\n @since 20"]
1658 #[cfg(feature = "api-20")]
1659 pub fn OH_NativeArkWeb_RegisterAsyncThreadJavaScriptProxy(
1660 webTag: *const ::std::os::raw::c_char,
1661 proxyObject: *const ArkWeb_ProxyObjectWithResult,
1662 permission: *const ::std::os::raw::c_char,
1663 );
1664}
1665extern "C" {
1666 #[doc = " @brief Sets whether to enable blankless loading. This API must be used together with the {@link OH_NativeArkWeb_GetBlanklessInfoWithKey}\n API.\n\n @permission ohos.permission.INTERNET and ohos.permission.GET_NETWORK_INFO\n @param webTag Name of the **Web** component.\n @param key Key value that uniquely identifies the page. The value must be the same as the key value of the {@link OH_NativeArkWeb_GetBlanklessInfoWithKey}\n API.\n The value cannot be empty and can contain a maximum of 2048 characters.\n When an invalid value is set, the error code {@link ArkWeb_BlanklessErrorCode} is returned and the frame insertion\n does not take effect.\n @param isStarted Whether to enable frame insertion. The value **true** indicates to enable frame insertion, and **\n false** indicates the opposite.\n The default value is **false**.\n @return Whether the API is successfully called. For details, see {@link ArkWeb_BlanklessErrorCode}.\n @since 20"]
1667 #[cfg(feature = "api-20")]
1668 pub fn OH_NativeArkWeb_SetBlanklessLoadingWithKey(
1669 webTag: *const ::std::os::raw::c_char,
1670 key: *const ::std::os::raw::c_char,
1671 isStarted: bool,
1672 ) -> ArkWeb_BlanklessErrorCode;
1673}
1674extern "C" {
1675 #[doc = " @brief Clears the blankless loading cache of the page with a specified key value.\n\n @param key The list of key values of pages cached in the blankless loading solution. These key values are\n specified in OH_NativeArkWeb_GetBlanklessInfoWithKey.\n\n The default value is the list of key values of all pages cached in the blankless loading solution.\n\n The key length cannot exceed 2048 characters, and the number of keys must be less than or equal to 100. The\n URL is the same as that input to the Web component during page loading.\n\n When the key length exceeds 2048 characters, the key does not take effect. When the number of keys exceeds\n 100, the first 100 keys are used. If this parameter is set to NULL, the default value is used.\n\n @param size Size of the key array.\n The default value is **0**.\n The value ranges from 0 to 100. If the size exceeds 100, the first 100 keys are used.\n When an invalid value is set, the value **0** is used.\n @since 20"]
1676 #[cfg(feature = "api-20")]
1677 pub fn OH_NativeArkWeb_ClearBlanklessLoadingCache(
1678 key: *mut *const ::std::os::raw::c_char,
1679 size: u32,
1680 );
1681}
1682extern "C" {
1683 #[doc = " @brief Obtains the first screen loading prediction information, and starts to generate the loading transition frame.\n The application determines whether to enable blankless loading based on the information. For details, see {@link ArkWeb_BlanklessInfo}\n . This API must be used together with the {@link OH_NativeArkWeb_SetBlanklessLoadingWithKey} API and must be called\n before the page loading API is triggered and after **WebViewController** is bound to the **Web** component.\n\n @permission ohos.permission.INTERNET and ohos.permission.GET_NETWORK_INFO\n @param webTag Name of the **Web** component.\n @param key Key value that uniquely identifies the page.\n The value cannot be empty and can contain a maximum of 2048 characters.\n Invalid values do not take effect.\n @return Prediction information about blankless loading, including the first screen similarity and first screen\n loading duration. The application determines whether to enable blankless loading based on the prediction information.\n @since 20"]
1684 #[cfg(feature = "api-20")]
1685 pub fn OH_NativeArkWeb_GetBlanklessInfoWithKey(
1686 webTag: *const ::std::os::raw::c_char,
1687 key: *const ::std::os::raw::c_char,
1688 ) -> ArkWeb_BlanklessInfo;
1689}
1690extern "C" {
1691 #[doc = " @brief Sets the persistent cache capacity of the blankless loading solution and returns the value that takes effect.\n The default cache capacity is 30 MB, and the maximum cache capacity is 100 MB. When this limit is exceeded,\n transition frames that are not frequently used are eliminated.\n\n @param capacity Persistent cache capacity, in MB. The maximum value is 100 MB.\n The default value is 30 MB.\n The value ranges from 0 to 100. If this parameter is set to **0**, no cache capacity is available and the\n functionality is disabled globally.\n When a value less than 0 is set, the value **0** takes effect. When a value greater than 100 is set, the value **100*\n * takes effect.\n @return The effective value that ranges from 0 MB to 100 MB.\n When a value less than 0 is set, the value **0** takes effect. When a value greater than 100 is set, the value **100*\n * takes effect.\n @since 20"]
1692 #[cfg(feature = "api-20")]
1693 pub fn OH_NativeArkWeb_SetBlanklessLoadingCacheCapacity(capacity: u32) -> u32;
1694}
1695extern "C" {
1696 #[doc = " @brief Ensure that all cookies currently accessible via the CookieManager API have been persisted to disk.\n If you want to use this interface in a non-UI thread, you need to initialize the CookieManager interface\n using OH_ArkWeb_GetNativeAPI first.\n @return Save cookie result code.\n {@link ARKWEB_SUCCESS} Save cookie success.\n {@link ARKWEB_COOKIE_SAVE_FAILED} Save cookie failed.\n {@link ARKWEB_COOKIE_MANAGER_INITIALIZE_FAILED} The CookieManager initialize failed.\n {@link ARKWEB_COOKIE_MANAGER_NOT_INITIALIZED} It is not allowed to call on a non-UI thread without\n initializing the CookieManager interface. please\n \t\t\t\t\t\t\t\t\t\t\t\t\t initialize the CookieManager interface using\n \t\t\t\t\t\t\t\t\t\t\t\t\t OH_ArkWeb_GetNativeAPI first.\n @since 20"]
1697 #[cfg(feature = "api-20")]
1698 pub fn OH_ArkWebCookieManager_SaveCookieSync() -> ArkWeb_ErrorCode;
1699}
1700extern "C" {
1701 #[doc = " @brief Ensure that all cookies currently accessible via the CookieManager API have been persisted to disk.\n Without initializing the CookieManager interface, this call will automatically be executed on the UI thread.\n @param callback Callback execute when save cookie done.\n @since 20"]
1702 #[cfg(feature = "api-20")]
1703 pub fn OH_ArkWebCookieManager_SaveCookieAsync(callback: OH_ArkWeb_OnCookieSaveCallback);
1704}
1705extern "C" {
1706 #[doc = " Sets the ArkWeb kernel version. If the system does not support the specified version, the setting is invalid.\n This API is a global static method and must be called before **initializeWebEngine** is called. If any **Web**\n component has been loaded, the setting of this API is invalid.\n\n @param { ArkWebEngineVersion } webEngineVersion - ArkWeb kernel version.\n For details, see {@link ArkWebEngineVersion}.\n @since 20"]
1707 #[cfg(feature = "api-20")]
1708 pub fn OH_NativeArkWeb_SetActiveWebEngineVersion(webEngineVersion: ArkWebEngineVersion);
1709}
1710extern "C" {
1711 #[doc = " Obtains the current ArkWeb kernel version.\n\n @return The current ArkWeb kernel version defined by {@link ArkWebEngineVersion}.\n @since 20"]
1712 #[cfg(feature = "api-20")]
1713 pub fn OH_NativeArkWeb_GetActiveWebEngineVersion() -> ArkWebEngineVersion;
1714}
1715extern "C" {
1716 #[doc = " Delays the initialization of the web engine. By default, the web engine is initialized when the CookieManager\n interface is called. By setting the 'lazy' parameter to true, the web engine will not be initialized when the\n CookieManager interface is called. Instead, the web engine will be initialized either when the web component is\n created or when initializeWebEngine is called.\n @param { bool } lazy - Controls whether to delay the initialization of the web engine.\n @since 22"]
1717 #[cfg(feature = "api-22")]
1718 pub fn OH_NativeArkWeb_LazyInitializeWebEngineInCookieManager(lazy: bool);
1719}
1720extern "C" {
1721 #[doc = " Checks whether the ArkWeb kernel used by the application is the evergreen kernel, that is, the latest kernel of the\n system.\n\n @return Whether the kernel used by the application is the evergreen kernel. The value **true** indicates that the\n kernel used by the application is the evergreen kernel, and **false** indicates the opposite.\n @since 23"]
1722 #[cfg(feature = "api-23")]
1723 pub fn OH_NativeArkWeb_IsActiveWebEngineEvergreen() -> bool;
1724}
1725extern "C" {
1726 #[doc = " @brief Synchronously obtains the cookie value corresponding to a specified URL.\n\n @param url URL to which the cookie to be obtained belongs. A complete URL is recommended.\n @param incognito True indicates that the memory cookies of the webview in privacy mode are obtained,\n and false indicates that cookies in non-privacy mode are obtained.\n @param includeHttpOnly If true HTTP-only cookies will also be included in the cookieValue.\n @param includePartitionedCookies If true, allows fetching first-party partitioned cookies.\n @param cookieValue Get the cookie value corresponding to the URL. This function will allocate memory for the\n *cookieValue string and caller must release the string by {@link OH_ArkWeb_ReleaseString}.\n @return Fetch cookie result code.\n <ul>\n <li>{@link ARKWEB_SUCCESS} fetch cookie success.</li>\n <li>{@link ARKWEB_INVALID_URL} invalid url.</li>\n <li>{@link ARKWEB_INVALID_PARAM} cookieValue is nullptr.</li>\n <li>{@link ARKWEB_LIBRARY_OPEN_FAILURE} Failed to open the library.</li>\n <li>{@link ARKWEB_LIBRARY_SYMBOL_NOT_FOUND} The required symbol was not found in the library.</li>\n <li>{@link ARKWEB_COOKIE_MANAGER_NOT_INITIALIZED} It is not allowed to call on a non-UI thread without\n initializing the CookieManager interface. please\n initialize the CookieManager interface using\n OH_ArkWeb_GetNativeAPI first.</li>\n </ul>\n @since 26.0.0"]
1727 #[cfg(feature = "api-26")]
1728 pub fn OH_ArkWebCookieManager_FetchCookieSync(
1729 url: *const ::std::os::raw::c_char,
1730 incognito: bool,
1731 includeHttpOnly: bool,
1732 includePartitionedCookies: bool,
1733 cookieValue: *mut *mut ::std::os::raw::c_char,
1734 ) -> ArkWeb_ErrorCode;
1735}
1736extern "C" {
1737 #[doc = " @brief Asynchronously obtains the cookie value corresponding to a specified URL.\n\n @param url URL to which the cookie to be obtained belongs. A complete URL is recommended.\n @param incognito True indicates that the memory cookies of the webview in privacy mode are obtained,\n and false indicates that cookies in non-privacy mode are obtained.\n @param includeHttpOnly If true HTTP-only cookies will also be included in the cookieValue.\n @param includePartitionedCookies If true, allows fetching first-party partitioned cookies.\n @param callback Callback execute when fetch cookie done.\n @since 26.0.0"]
1738 #[cfg(feature = "api-26")]
1739 pub fn OH_ArkWebCookieManager_FetchCookieAsync(
1740 url: *const ::std::os::raw::c_char,
1741 incognito: bool,
1742 includeHttpOnly: bool,
1743 includePartitionedCookies: bool,
1744 callback: OH_ArkWeb_OnCookieFetchCallback,
1745 );
1746}