Skip to main content

arkweb_sys/arkweb_interface/
arkweb_interface_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6#[cfg(feature = "api-18")]
7use crate::arkweb_type::ArkWeb_OnScrollCallback;
8
9/// Defines the native API type of any size.
10///
11///
12/// Available since API-level: 12
13#[cfg(feature = "api-12")]
14#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
15#[repr(C)]
16pub struct ArkWeb_AnyNativeAPI {
17    /// Defines the size information of the native API set.
18    pub size: usize,
19}
20#[cfg(feature = "api-12")]
21#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
22impl ArkWeb_NativeAPIVariantKind {
23    /// API type related to ArkWeb component.
24    pub const ARKWEB_NATIVE_COMPONENT: ArkWeb_NativeAPIVariantKind = ArkWeb_NativeAPIVariantKind(0);
25    /// API type related to ArkWeb controller.
26    pub const ARKWEB_NATIVE_CONTROLLER: ArkWeb_NativeAPIVariantKind =
27        ArkWeb_NativeAPIVariantKind(1);
28    /// API type related to ArkWeb WebMessagePort.
29    pub const ARKWEB_NATIVE_WEB_MESSAGE_PORT: ArkWeb_NativeAPIVariantKind =
30        ArkWeb_NativeAPIVariantKind(2);
31    /// API type related to ArkWeb WebMessage.
32    pub const ARKWEB_NATIVE_WEB_MESSAGE: ArkWeb_NativeAPIVariantKind =
33        ArkWeb_NativeAPIVariantKind(3);
34    /// API type related to ArkWeb cookie manager.
35    pub const ARKWEB_NATIVE_COOKIE_MANAGER: ArkWeb_NativeAPIVariantKind =
36        ArkWeb_NativeAPIVariantKind(4);
37    /// API type related to ArkWeb JavaScript value.
38    ///
39    ///
40    /// Available since API-level: 18
41    #[cfg(feature = "api-18")]
42    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
43    pub const ARKWEB_NATIVE_JAVASCRIPT_VALUE: ArkWeb_NativeAPIVariantKind =
44        ArkWeb_NativeAPIVariantKind(5);
45}
46#[repr(transparent)]
47/// Defines the native API set type.
48///
49///
50/// Available since API-level: 12
51#[cfg(feature = "api-12")]
52#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
53#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
54pub struct ArkWeb_NativeAPIVariantKind(pub ::core::ffi::c_uint);
55extern "C" {
56    /// Obtains the native API set of a specified type.
57    /// # Arguments
58    ///
59    /// * `type` - Indicates the type of the native API set provided by ArkWeb.
60    ///
61    /// # Returns
62    ///
63    /// * Return the pointer to the native API abstract object that carries the size.
64    /// If the type is incorrect, a null pointer is returned.
65    ///
66    ///
67    /// Required System Capabilities: SystemCapability.Web.Webview.Core
68    ///
69    /// Available since API-level: 12
70    #[cfg(feature = "api-12")]
71    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
72    pub fn OH_ArkWeb_GetNativeAPI(type_: ArkWeb_NativeAPIVariantKind) -> *mut ArkWeb_AnyNativeAPI;
73    /// Register a scrolling event callback.
74    /// # Arguments
75    ///
76    /// * `webTag` - The name of the web component.
77    ///
78    /// * `callback` - The ArkWeb scrolling callback.
79    ///
80    /// * `userData` - The data set by user.
81    ///
82    /// # Returns
83    ///
84    /// * Returns whether the registration was successful, false indicates failure.
85    ///
86    ///
87    /// Required System Capabilities: SystemCapability.Web.Webview.Core
88    ///
89    /// Available since API-level: 18
90    #[cfg(feature = "api-18")]
91    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
92    pub fn OH_ArkWeb_RegisterScrollCallback(
93        webTag: *const ::core::ffi::c_char,
94        callback: ArkWeb_OnScrollCallback,
95        userData: *mut ::core::ffi::c_void,
96    ) -> bool;
97}