xcomponent_sys/xcomponent_arkui_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 super::xcomponent_ffi::*;
7use arkui_sys::native_type::ArkUI_NodeHandle;
8use arkui_sys::ui_input_event::{ArkUI_UIInputEvent, ArkUI_UIInputEvent_Type, HitTestMode};
9
10#[cfg(feature = "api-18")]
11#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
12impl ArkUI_XComponent_ImageAnalyzerState {
13 /// AI analyzer execution is finished.
14 pub const ARKUI_XCOMPONENT_AI_ANALYSIS_FINISHED: ArkUI_XComponent_ImageAnalyzerState =
15 ArkUI_XComponent_ImageAnalyzerState(0);
16 /// AI analyzer is disabled.
17 pub const ARKUI_XCOMPONENT_AI_ANALYSIS_DISABLED: ArkUI_XComponent_ImageAnalyzerState =
18 ArkUI_XComponent_ImageAnalyzerState(110000);
19 /// AI analyzer is unsupported.
20 pub const ARKUI_XCOMPONENT_AI_ANALYSIS_UNSUPPORTED: ArkUI_XComponent_ImageAnalyzerState =
21 ArkUI_XComponent_ImageAnalyzerState(110001);
22 /// AI analyzer is ongoing.
23 pub const ARKUI_XCOMPONENT_AI_ANALYSIS_ONGOING: ArkUI_XComponent_ImageAnalyzerState =
24 ArkUI_XComponent_ImageAnalyzerState(110002);
25 /// AI analyzer is stopped.
26 pub const ARKUI_XCOMPONENT_AI_ANALYSIS_STOPPED: ArkUI_XComponent_ImageAnalyzerState =
27 ArkUI_XComponent_ImageAnalyzerState(110003);
28}
29#[repr(transparent)]
30/// Status code for AI analyzer.
31///
32///
33/// Available since API-level: 18
34#[cfg(feature = "api-18")]
35#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
36#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
37pub struct ArkUI_XComponent_ImageAnalyzerState(pub ::core::ffi::c_uint);
38extern "C" {
39 /// Attaches the UI component created through the native API of ArkUI to this <b>OH_NativeXComponent</b> instance.
40 ///
41 /// # Arguments
42 ///
43 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
44 ///
45 /// * `root` - Indicates the pointer to the component instance created by the native API.
46 ///
47 /// # Returns
48 ///
49 /// * Returns the error code.
50 /// Returns [`OH_NATIVEXCOMPONENT_RESULT_SUCCESS`] if the operation is successful.
51 /// Returns [`OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER`] if a parameter error occurs.
52 ///
53 ///
54 /// Available since API-level: 12
55 ///
56 /// **Deprecated** since 20
57 /// OH_ArkUI_NodeContent_AddNode
58 #[cfg(feature = "api-12")]
59 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
60 #[deprecated(since = "20")]
61 pub fn OH_NativeXComponent_AttachNativeRootNode(
62 component: *mut OH_NativeXComponent,
63 root: ArkUI_NodeHandle,
64 ) -> i32;
65 /// Detaches the native component of ArkUI from this <b>OH_NativeXComponent</b> instance.
66 ///
67 /// # Arguments
68 ///
69 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
70 ///
71 /// * `root` - Indicates the pointer to the component instance created by the native API.
72 ///
73 /// # Returns
74 ///
75 /// * Returns the error code.
76 /// Returns [`OH_NATIVEXCOMPONENT_RESULT_SUCCESS`] if the operation is successful.
77 /// Returns [`OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER`] if a parameter error occurs.
78 ///
79 ///
80 /// Available since API-level: 12
81 ///
82 /// **Deprecated** since 20
83 /// OH_ArkUI_NodeContent_RemoveNode
84 #[cfg(feature = "api-12")]
85 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
86 #[deprecated(since = "20")]
87 pub fn OH_NativeXComponent_DetachNativeRootNode(
88 component: *mut OH_NativeXComponent,
89 root: ArkUI_NodeHandle,
90 ) -> i32;
91 /// Registers a UI input event callback for an <b>OH_NativeXComponent</b> instance and enables the callback to be
92 /// invoked when a UI input event is received. Currently, only axis events are supported.
93 ///
94 /// # Arguments
95 ///
96 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
97 ///
98 /// * `callback` - Indicates the pointer to the UI input event callback.
99 ///
100 /// * `type` - Indicates the type of the current UI input event.
101 ///
102 /// # Returns
103 ///
104 /// * Returns the error code.
105 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
106 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
107 ///
108 /// Available since API-level: 12
109 #[cfg(feature = "api-12")]
110 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
111 pub fn OH_NativeXComponent_RegisterUIInputEventCallback(
112 component: *mut OH_NativeXComponent,
113 callback: ::core::option::Option<
114 unsafe extern "C" fn(
115 component: *mut OH_NativeXComponent,
116 event: *mut ArkUI_UIInputEvent,
117 type_: ArkUI_UIInputEvent_Type,
118 ),
119 >,
120 type_: ArkUI_UIInputEvent_Type,
121 ) -> i32;
122 /// Registers a custom event intercept callback for an <b>OH_NativeXComponent</b> instance.
123 /// This enables the specified during hit testing.
124 /// UI input-related operations are not supported on event objects received through this callback.
125 /// For full functionality, use the <b>NODE_ON_TOUCH_INTERCEPT</b> event on native nodes instead.
126 ///
127 /// # Arguments
128 ///
129 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
130 ///
131 /// * `callback` - Indicates the pointer to the custom event intercept callback.
132 ///
133 /// # Returns
134 ///
135 /// * Returns the error code.
136 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
137 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
138 ///
139 /// Available since API-level: 12
140 #[cfg(feature = "api-12")]
141 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
142 pub fn OH_NativeXComponent_RegisterOnTouchInterceptCallback(
143 component: *mut OH_NativeXComponent,
144 callback: ::core::option::Option<
145 unsafe extern "C" fn(
146 component: *mut OH_NativeXComponent,
147 event: *mut ArkUI_UIInputEvent,
148 ) -> HitTestMode,
149 >,
150 ) -> i32;
151 /// Start image analyzer for the specified XComponent
152 /// instance created by the native API.
153 ///
154 /// # Arguments
155 ///
156 /// * `node` - Indicates the pointer to the XComponent instance created by the native API.
157 ///
158 /// * `userData` - Indicates the pointer to a user defined data.
159 ///
160 /// * `callback` - Indicates the pointer to a image analyzer status callback function.
161 ///
162 /// # Returns
163 ///
164 /// * Returns the status code of the execution.
165 /// [`ARKUI_ERROR_CODE_NO_ERROR`] the execution is successful.
166 ///
167 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] component is nullptr or callback is nullptr,
168 /// or the type of node is not XComponent.
169 ///
170 ///
171 /// Available since API-level: 18
172 #[cfg(feature = "api-18")]
173 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
174 pub fn OH_ArkUI_XComponent_StartImageAnalyzer(
175 node: ArkUI_NodeHandle,
176 userData: *mut ::core::ffi::c_void,
177 callback: ::core::option::Option<
178 unsafe extern "C" fn(
179 node: ArkUI_NodeHandle,
180 statusCode: ArkUI_XComponent_ImageAnalyzerState,
181 userData: *mut ::core::ffi::c_void,
182 ),
183 >,
184 ) -> i32;
185 /// Stop image analyzer for the specified XComponent
186 /// instance created by the native API.
187 ///
188 /// # Arguments
189 ///
190 /// * `node` - Indicates the pointer to the XComponent instance created by the native API.
191 ///
192 /// # Returns
193 ///
194 /// * Returns the status code of the execution.
195 /// [`ARKUI_ERROR_CODE_NO_ERROR`] the execution is successful.
196 ///
197 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] component is nullptr or the type of node is not XComponent.
198 ///
199 ///
200 /// Available since API-level: 18
201 #[cfg(feature = "api-18")]
202 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
203 pub fn OH_ArkUI_XComponent_StopImageAnalyzer(node: ArkUI_NodeHandle) -> i32;
204}