1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// 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;
}