arkweb-sys 0.1.0

Raw Bindings to the Web module of OpenHarmony
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#[cfg(feature = "api-18")]
use crate::arkweb_type::ArkWeb_OnScrollCallback;

/// Defines the native API type of any size.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct ArkWeb_AnyNativeAPI {
    /// Defines the size information of the native API set.
    pub size: usize,
}
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl ArkWeb_NativeAPIVariantKind {
    /// API type related to ArkWeb component.
    pub const ARKWEB_NATIVE_COMPONENT: ArkWeb_NativeAPIVariantKind = ArkWeb_NativeAPIVariantKind(0);
    /// API type related to ArkWeb controller.
    pub const ARKWEB_NATIVE_CONTROLLER: ArkWeb_NativeAPIVariantKind =
        ArkWeb_NativeAPIVariantKind(1);
    /// API type related to ArkWeb WebMessagePort.
    pub const ARKWEB_NATIVE_WEB_MESSAGE_PORT: ArkWeb_NativeAPIVariantKind =
        ArkWeb_NativeAPIVariantKind(2);
    /// API type related to ArkWeb WebMessage.
    pub const ARKWEB_NATIVE_WEB_MESSAGE: ArkWeb_NativeAPIVariantKind =
        ArkWeb_NativeAPIVariantKind(3);
    /// API type related to ArkWeb cookie manager.
    pub const ARKWEB_NATIVE_COOKIE_MANAGER: ArkWeb_NativeAPIVariantKind =
        ArkWeb_NativeAPIVariantKind(4);
    /// API type related to ArkWeb JavaScript value.
    ///
    ///
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub const ARKWEB_NATIVE_JAVASCRIPT_VALUE: ArkWeb_NativeAPIVariantKind =
        ArkWeb_NativeAPIVariantKind(5);
}
#[repr(transparent)]
/// Defines the native API set type.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ArkWeb_NativeAPIVariantKind(pub ::core::ffi::c_uint);
extern "C" {
    /// Obtains the native API set of a specified type.
    /// # Arguments
    ///
    /// * `type` - Indicates the type of the native API set provided by ArkWeb.
    ///
    /// # Returns
    ///
    /// * Return the pointer to the native API abstract object that carries the size.
    /// If the type is incorrect, a null pointer is returned.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Web.Webview.Core
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkWeb_GetNativeAPI(type_: ArkWeb_NativeAPIVariantKind) -> *mut ArkWeb_AnyNativeAPI;
    /// Register a scrolling event callback.
    /// # Arguments
    ///
    /// * `webTag` - The name of the web component.
    ///
    /// * `callback` - The ArkWeb scrolling callback.
    ///
    /// * `userData` - The data set by user.
    ///
    /// # Returns
    ///
    /// * Returns whether the registration was successful, false indicates failure.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Web.Webview.Core
    ///
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_ArkWeb_RegisterScrollCallback(
        webTag: *const ::core::ffi::c_char,
        callback: ArkWeb_OnScrollCallback,
        userData: *mut ::core::ffi::c_void,
    ) -> bool;
}