arkui-sys 0.3.3

Bindings to the native ArkUI 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 crate::native_type::*;

#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
impl ArkUI_KeyProcessingMode {
    /// Key events are used to move focus.
    pub const ARKUI_KEY_PROCESSING_MODE_FOCUS_NAVIGATION: ArkUI_KeyProcessingMode =
        ArkUI_KeyProcessingMode(0);
    /// Key events bubble up to ancestors.
    pub const ARKUI_KEY_PROCESSING_MODE_FOCUS_ANCESTOR_EVENT: ArkUI_KeyProcessingMode =
        ArkUI_KeyProcessingMode(1);
}
#[repr(transparent)]
/// Determines the priority of key event processing when component cannot handle the key event.
///
///
/// Available since API-level: 15
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_KeyProcessingMode(pub ::core::ffi::c_uint);
extern "C" {
    /// Apply focus for a specific node.
    ///
    /// # Arguments
    ///
    /// * `node` - The node.
    ///
    /// # Returns
    ///
    /// * The error code.
    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// [`ARKUI_ERROR_CODE_FOCUS_NON_FOCUSABLE`] if the node is not focusable.
    /// [`ARKUI_ERROR_CODE_FOCUS_NON_FOCUSABLE_ANCESTOR`] if the node has unfocusable ancestor.
    /// [`ARKUI_ERROR_CODE_FOCUS_NON_EXISTENT`] if the node is not exists.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_ArkUI_FocusRequest(node: ArkUI_NodeHandle) -> ArkUiResult;
    /// Clear current focus to root scope.
    ///
    /// # Arguments
    ///
    /// * `uiContext` - Indicates the pointer to a UI instance.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_ArkUI_FocusClear(uiContext: ArkUI_ContextHandle);
    /// Set the focus active state in current window, the focus node would show its focus box.
    ///
    /// # Arguments
    ///
    /// * `uiContext` - Indicates the pointer to a UI instance.
    ///
    /// * `isActive` - Set the state to be active or inactive.
    ///
    /// * `isAutoInactive` - When touch event or mouse-pressed event triggerd,
    /// "true" indicates to set state to inactive,
    /// "false" indicates to maintain the state until relative API is called.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_ArkUI_FocusActivate(
        uiContext: ArkUI_ContextHandle,
        isActive: bool,
        isAutoInactive: bool,
    );
    /// Set the focus transfer behaviour when current focus view changes.
    ///
    /// # Arguments
    ///
    /// * `uiContext` - Indicates the pointer to a UI instance.
    ///
    /// * `autoTransfer` - Indicates whether to transfer focus when focus view show.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_ArkUI_FocusSetAutoTransfer(uiContext: ArkUI_ContextHandle, autoTransfer: bool);
    /// Set the priority of key event processing when component cannot handle the key event.
    ///
    /// # Arguments
    ///
    /// * `uiContext` - Indicates the pointer to a UI instance.
    ///
    /// * `mode` - Indicates the key processing mode.
    ///
    /// Available since API-level: 15
    #[cfg(feature = "api-15")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
    pub fn OH_ArkUI_FocusSetKeyProcessingMode(
        uiContext: ArkUI_ContextHandle,
        mode: ArkUI_KeyProcessingMode,
    );
}