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 ///
58 /// **Use instead:** OH_ArkUI_NodeContent_AddNode
59 #[cfg(feature = "api-12")]
60 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
61 #[deprecated(since = "20", note = "Use instead: OH_ArkUI_NodeContent_AddNode")]
62 pub fn OH_NativeXComponent_AttachNativeRootNode(
63 component: *mut OH_NativeXComponent,
64 root: ArkUI_NodeHandle,
65 ) -> i32;
66 /// Detaches the native component of ArkUI from this <b>OH_NativeXComponent</b> instance.
67 ///
68 /// # Arguments
69 ///
70 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
71 ///
72 /// * `root` - Indicates the pointer to the component instance created by the native API.
73 ///
74 /// # Returns
75 ///
76 /// * Returns the error code.
77 /// Returns [`OH_NATIVEXCOMPONENT_RESULT_SUCCESS`] if the operation is successful.
78 /// Returns [`OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER`] if a parameter error occurs.
79 ///
80 ///
81 /// Available since API-level: 12
82 ///
83 /// **Deprecated** since 20
84 ///
85 /// **Use instead:** OH_ArkUI_NodeContent_RemoveNode
86 #[cfg(feature = "api-12")]
87 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
88 #[deprecated(since = "20", note = "Use instead: OH_ArkUI_NodeContent_RemoveNode")]
89 pub fn OH_NativeXComponent_DetachNativeRootNode(
90 component: *mut OH_NativeXComponent,
91 root: ArkUI_NodeHandle,
92 ) -> i32;
93 /// Registers a UI input event callback for an <b>OH_NativeXComponent</b> instance and enables the callback to be
94 /// invoked when a UI input event is received. Currently, only axis events are supported.
95 ///
96 /// # Arguments
97 ///
98 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
99 ///
100 /// * `callback` - Indicates the pointer to the UI input event callback.
101 ///
102 /// * `type` - Indicates the type of the current UI input event.
103 ///
104 /// # Returns
105 ///
106 /// * Returns the error code.
107 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
108 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
109 ///
110 /// Available since API-level: 12
111 #[cfg(feature = "api-12")]
112 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
113 pub fn OH_NativeXComponent_RegisterUIInputEventCallback(
114 component: *mut OH_NativeXComponent,
115 callback: ::core::option::Option<
116 unsafe extern "C" fn(
117 component: *mut OH_NativeXComponent,
118 event: *mut ArkUI_UIInputEvent,
119 type_: ArkUI_UIInputEvent_Type,
120 ),
121 >,
122 type_: ArkUI_UIInputEvent_Type,
123 ) -> i32;
124 /// Registers a custom event intercept callback for an <b>OH_NativeXComponent</b> instance.
125 /// This enables the specified during hit testing.
126 /// UI input-related operations are not supported on event objects received through this callback.
127 /// For full functionality, use the <b>NODE_ON_TOUCH_INTERCEPT</b> event on native nodes instead.
128 ///
129 /// # Arguments
130 ///
131 /// * `component` - Indicates the pointer to the <b>OH_NativeXComponent</b> instance.
132 ///
133 /// * `callback` - Indicates the pointer to the custom event intercept callback.
134 ///
135 /// # Returns
136 ///
137 /// * Returns the error code.
138 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
139 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
140 ///
141 /// Available since API-level: 12
142 #[cfg(feature = "api-12")]
143 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
144 pub fn OH_NativeXComponent_RegisterOnTouchInterceptCallback(
145 component: *mut OH_NativeXComponent,
146 callback: ::core::option::Option<
147 unsafe extern "C" fn(
148 component: *mut OH_NativeXComponent,
149 event: *mut ArkUI_UIInputEvent,
150 ) -> HitTestMode,
151 >,
152 ) -> i32;
153 /// Start image analyzer for the specified XComponent
154 /// instance created by the native API.
155 ///
156 /// # Arguments
157 ///
158 /// * `node` - Indicates the pointer to the XComponent instance created by the native API.
159 ///
160 /// * `userData` - Indicates the pointer to a user defined data.
161 ///
162 /// * `callback` - Indicates the pointer to a image analyzer status callback function.
163 ///
164 /// # Returns
165 ///
166 /// * Returns the status code of the execution.
167 /// [`ARKUI_ERROR_CODE_NO_ERROR`] the execution is successful.
168 ///
169 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] component is nullptr or callback is nullptr,
170 /// or the type of node is not XComponent.
171 ///
172 ///
173 /// Available since API-level: 18
174 #[cfg(feature = "api-18")]
175 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
176 pub fn OH_ArkUI_XComponent_StartImageAnalyzer(
177 node: ArkUI_NodeHandle,
178 userData: *mut ::core::ffi::c_void,
179 callback: ::core::option::Option<
180 unsafe extern "C" fn(
181 node: ArkUI_NodeHandle,
182 statusCode: ArkUI_XComponent_ImageAnalyzerState,
183 userData: *mut ::core::ffi::c_void,
184 ),
185 >,
186 ) -> i32;
187 /// Stop image analyzer for the specified XComponent
188 /// instance created by the native API.
189 ///
190 /// # Arguments
191 ///
192 /// * `node` - Indicates the pointer to the XComponent instance created by the native API.
193 ///
194 /// # Returns
195 ///
196 /// * Returns the status code of the execution.
197 /// [`ARKUI_ERROR_CODE_NO_ERROR`] the execution is successful.
198 ///
199 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] component is nullptr or the type of node is not XComponent.
200 ///
201 ///
202 /// Available since API-level: 18
203 #[cfg(feature = "api-18")]
204 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
205 pub fn OH_ArkUI_XComponent_StopImageAnalyzer(node: ArkUI_NodeHandle) -> i32;
206}