arkui_sys/native_interface_focus/
native_interface_focus_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)]
6use crate::native_type::*;
7
8#[cfg(feature = "api-15")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
10impl ArkUI_KeyProcessingMode {
11    /// Key events are used to move focus.
12    pub const ARKUI_KEY_PROCESSING_MODE_FOCUS_NAVIGATION: ArkUI_KeyProcessingMode =
13        ArkUI_KeyProcessingMode(0);
14    /// Key events bubble up to ancestors.
15    pub const ARKUI_KEY_PROCESSING_MODE_FOCUS_ANCESTOR_EVENT: ArkUI_KeyProcessingMode =
16        ArkUI_KeyProcessingMode(1);
17}
18#[repr(transparent)]
19/// Determines the priority of key event processing when component cannot handle the key event.
20///
21///
22/// Available since API-level: 15
23#[cfg(feature = "api-15")]
24#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
25#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26pub struct ArkUI_KeyProcessingMode(pub ::core::ffi::c_uint);
27extern "C" {
28    /// Apply focus for a specific node.
29    ///
30    /// # Arguments
31    ///
32    /// * `node` - The node.
33    ///
34    /// # Returns
35    ///
36    /// * The error code.
37    /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
38    /// [`ARKUI_ERROR_CODE_FOCUS_NON_FOCUSABLE`] if the node is not focusable.
39    /// [`ARKUI_ERROR_CODE_FOCUS_NON_FOCUSABLE_ANCESTOR`] if the node has unfocusable ancestor.
40    /// [`ARKUI_ERROR_CODE_FOCUS_NON_EXISTENT`] if the node is not exists.
41    ///
42    /// Available since API-level: 15
43    #[cfg(feature = "api-15")]
44    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
45    pub fn OH_ArkUI_FocusRequest(node: ArkUI_NodeHandle) -> ArkUiResult;
46    /// Clear current focus to root scope.
47    ///
48    /// # Arguments
49    ///
50    /// * `uiContext` - Indicates the pointer to a UI instance.
51    ///
52    /// Available since API-level: 15
53    #[cfg(feature = "api-15")]
54    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
55    pub fn OH_ArkUI_FocusClear(uiContext: ArkUI_ContextHandle);
56    /// Set the focus active state in current window, the focus node would show its focus box.
57    ///
58    /// # Arguments
59    ///
60    /// * `uiContext` - Indicates the pointer to a UI instance.
61    ///
62    /// * `isActive` - Set the state to be active or inactive.
63    ///
64    /// * `isAutoInactive` - When touch event or mouse-pressed event triggerd,
65    /// "true" indicates to set state to inactive,
66    /// "false" indicates to maintain the state until relative API is called.
67    ///
68    /// Available since API-level: 15
69    #[cfg(feature = "api-15")]
70    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
71    pub fn OH_ArkUI_FocusActivate(
72        uiContext: ArkUI_ContextHandle,
73        isActive: bool,
74        isAutoInactive: bool,
75    );
76    /// Set the focus transfer behaviour when current focus view changes.
77    ///
78    /// # Arguments
79    ///
80    /// * `uiContext` - Indicates the pointer to a UI instance.
81    ///
82    /// * `autoTransfer` - Indicates whether to transfer focus when focus view show.
83    ///
84    /// Available since API-level: 15
85    #[cfg(feature = "api-15")]
86    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
87    pub fn OH_ArkUI_FocusSetAutoTransfer(uiContext: ArkUI_ContextHandle, autoTransfer: bool);
88    /// Set the priority of key event processing when component cannot handle the key event.
89    ///
90    /// # Arguments
91    ///
92    /// * `uiContext` - Indicates the pointer to a UI instance.
93    ///
94    /// * `mode` - Indicates the key processing mode.
95    ///
96    /// Available since API-level: 15
97    #[cfg(feature = "api-15")]
98    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
99    pub fn OH_ArkUI_FocusSetKeyProcessingMode(
100        uiContext: ArkUI_ContextHandle,
101        mode: ArkUI_KeyProcessingMode,
102    );
103}