xcomponent-sys 0.3.5

Raw Bindings to the `xcomponent` API 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)]
use super::xcomponent_ffi::*;
use arkui_sys::native_type::ArkUI_NodeHandle;
use arkui_sys::ui_input_event::{ArkUI_UIInputEvent, ArkUI_UIInputEvent_Type, HitTestMode};

#[cfg(feature = "api-18")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
impl ArkUI_XComponent_ImageAnalyzerState {
    /// AI analyzer execution is finished.
    pub const ARKUI_XCOMPONENT_AI_ANALYSIS_FINISHED: ArkUI_XComponent_ImageAnalyzerState =
        ArkUI_XComponent_ImageAnalyzerState(0);
    /// AI analyzer is disabled.
    pub const ARKUI_XCOMPONENT_AI_ANALYSIS_DISABLED: ArkUI_XComponent_ImageAnalyzerState =
        ArkUI_XComponent_ImageAnalyzerState(110000);
    /// AI analyzer is unsupported.
    pub const ARKUI_XCOMPONENT_AI_ANALYSIS_UNSUPPORTED: ArkUI_XComponent_ImageAnalyzerState =
        ArkUI_XComponent_ImageAnalyzerState(110001);
    /// AI analyzer is ongoing.
    pub const ARKUI_XCOMPONENT_AI_ANALYSIS_ONGOING: ArkUI_XComponent_ImageAnalyzerState =
        ArkUI_XComponent_ImageAnalyzerState(110002);
    /// AI analyzer is stopped.
    pub const ARKUI_XCOMPONENT_AI_ANALYSIS_STOPPED: ArkUI_XComponent_ImageAnalyzerState =
        ArkUI_XComponent_ImageAnalyzerState(110003);
}
#[repr(transparent)]
/// Status code for AI analyzer.
///
///
/// Available since API-level: 18
#[cfg(feature = "api-18")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_XComponent_ImageAnalyzerState(pub ::core::ffi::c_uint);
extern "C" {
    /// Attaches the UI component created through the native API of ArkUI to this <b>OH_NativeXComponent</b> instance.
    ///
    /// # Arguments
    ///
    /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
    ///
    /// * `root` - Indicates the pointer to the component instance created by the native API.
    ///
    /// # Returns
    ///
    /// * Returns the error code.
    /// Returns [`OH_NATIVEXCOMPONENT_RESULT_SUCCESS`] if the operation is successful.
    /// Returns [`OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER`] if a parameter error occurs.
    ///
    ///
    /// Available since API-level: 12
    ///
    /// **Deprecated** since 20
    /// OH_ArkUI_NodeContent_AddNode
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    #[deprecated(since = "20")]
    pub fn OH_NativeXComponent_AttachNativeRootNode(
        component: *mut OH_NativeXComponent,
        root: ArkUI_NodeHandle,
    ) -> i32;
    /// Detaches the native component of ArkUI from this <b>OH_NativeXComponent</b> instance.
    ///
    /// # Arguments
    ///
    /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
    ///
    /// * `root` - Indicates the pointer to the component instance created by the native API.
    ///
    /// # Returns
    ///
    /// * Returns the error code.
    /// Returns [`OH_NATIVEXCOMPONENT_RESULT_SUCCESS`] if the operation is successful.
    /// Returns [`OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER`] if a parameter error occurs.
    ///
    ///
    /// Available since API-level: 12
    ///
    /// **Deprecated** since 20
    /// OH_ArkUI_NodeContent_RemoveNode
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    #[deprecated(since = "20")]
    pub fn OH_NativeXComponent_DetachNativeRootNode(
        component: *mut OH_NativeXComponent,
        root: ArkUI_NodeHandle,
    ) -> i32;
    /// Registers a UI input event callback for an <b>OH_NativeXComponent</b> instance and enables the callback to be
    /// invoked when a UI input event is received. Currently, only axis events are supported.
    ///
    /// # Arguments
    ///
    /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
    ///
    /// * `callback` - Indicates the pointer to the UI input event callback.
    ///
    /// * `type` - Indicates the type of the current UI input event.
    ///
    /// # Returns
    ///
    /// * Returns the error code.
    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeXComponent_RegisterUIInputEventCallback(
        component: *mut OH_NativeXComponent,
        callback: ::core::option::Option<
            unsafe extern "C" fn(
                component: *mut OH_NativeXComponent,
                event: *mut ArkUI_UIInputEvent,
                type_: ArkUI_UIInputEvent_Type,
            ),
        >,
        type_: ArkUI_UIInputEvent_Type,
    ) -> i32;
    /// Registers a custom event intercept callback for an <b>OH_NativeXComponent</b> instance.
    /// This enables the specified during hit testing.
    /// UI input-related operations are not supported on event objects received through this callback.
    /// For full functionality, use the <b>NODE_ON_TOUCH_INTERCEPT</b> event on native nodes instead.
    ///
    /// # Arguments
    ///
    /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
    ///
    /// * `callback` - Indicates the pointer to the custom event intercept callback.
    ///
    /// # Returns
    ///
    /// * Returns the error code.
    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeXComponent_RegisterOnTouchInterceptCallback(
        component: *mut OH_NativeXComponent,
        callback: ::core::option::Option<
            unsafe extern "C" fn(
                component: *mut OH_NativeXComponent,
                event: *mut ArkUI_UIInputEvent,
            ) -> HitTestMode,
        >,
    ) -> i32;
    /// Start image analyzer for the specified XComponent
    /// instance created by the native API.
    ///
    /// # Arguments
    ///
    /// * `node` - Indicates the pointer to the XComponent instance created by the native API.
    ///
    /// * `userData` - Indicates the pointer to a user defined data.
    ///
    /// * `callback` - Indicates the pointer to a image analyzer status callback function.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`ARKUI_ERROR_CODE_NO_ERROR`] the execution is successful.
    ///
    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] component is nullptr or callback is nullptr,
    /// or the type of node is not XComponent.
    ///
    ///
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_ArkUI_XComponent_StartImageAnalyzer(
        node: ArkUI_NodeHandle,
        userData: *mut ::core::ffi::c_void,
        callback: ::core::option::Option<
            unsafe extern "C" fn(
                node: ArkUI_NodeHandle,
                statusCode: ArkUI_XComponent_ImageAnalyzerState,
                userData: *mut ::core::ffi::c_void,
            ),
        >,
    ) -> i32;
    /// Stop image analyzer for the specified XComponent
    /// instance created by the native API.
    ///
    /// # Arguments
    ///
    /// * `node` - Indicates the pointer to the XComponent instance created by the native API.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`ARKUI_ERROR_CODE_NO_ERROR`] the execution is successful.
    ///
    /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] component is nullptr or the type of node is not XComponent.
    ///
    ///
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_ArkUI_XComponent_StopImageAnalyzer(node: ArkUI_NodeHandle) -> i32;
}