arkui_sys/ui_input_event/ui_input_event_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/// Defines the UI input event.
9///
10///
11/// Available since API-level: 12
12#[cfg(feature = "api-12")]
13#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
14#[repr(C)]
15pub struct ArkUI_UIInputEvent {
16 _unused: [u8; 0],
17}
18/// Defines the coasting axis event.
19/// When a user swipes with two fingers on the touchpad, the system constructs
20/// sliding events based on the speed at the moment the fingers are lifted according to
21/// a certain decay curve. You can listen for such events to handle the flick effect
22/// immediately after the regular axis events.
23///
24/// It only can be received when user flings on the touchpad with two fingers and any components register
25/// NODE_ON_COASTING_AXIS_EVENT through [`registerNodeEvent`] exist under the pointer location.
26///
27///
28/// Available since API-level: 22
29#[cfg(feature = "api-22")]
30#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
31#[repr(C)]
32pub struct ArkUI_CoastingAxisEvent {
33 _unused: [u8; 0],
34}
35/// Defines the touch test info.
36///
37///
38/// Available since API-level: 22
39#[cfg(feature = "api-22")]
40#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
41#[repr(C)]
42pub struct ArkUI_TouchTestInfo {
43 _unused: [u8; 0],
44}
45/// Defines the touch test info item.
46///
47///
48/// Available since API-level: 22
49#[cfg(feature = "api-22")]
50#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
51#[repr(C)]
52pub struct ArkUI_TouchTestInfoItem {
53 _unused: [u8; 0],
54}
55/// Defines the touch test info item handle.
56///
57///
58/// Available since API-level: 22
59#[cfg(feature = "api-22")]
60#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
61pub type ArkUI_TouchTestInfoItemHandle = *mut ArkUI_TouchTestInfoItem;
62/// Defines the gesture recognizer handle array.
63///
64///
65/// Available since API-level: 22
66#[cfg(feature = "api-22")]
67#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
68pub type ArkUI_TouchTestInfoItemArray = *mut ArkUI_TouchTestInfoItemHandle;
69#[cfg(feature = "api-12")]
70#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
71impl ArkUI_UIInputEvent_Type {
72 pub const ARKUI_UIINPUTEVENT_TYPE_UNKNOWN: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(0);
73 pub const ARKUI_UIINPUTEVENT_TYPE_TOUCH: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(1);
74 pub const ARKUI_UIINPUTEVENT_TYPE_AXIS: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(2);
75 /// Mouse event.
76 pub const ARKUI_UIINPUTEVENT_TYPE_MOUSE: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(3);
77 /// key event.
78 ///
79 ///
80 /// Available since API-level: 20
81 #[cfg(feature = "api-20")]
82 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
83 pub const ARKUI_UIINPUTEVENT_TYPE_KEY: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(4);
84}
85#[repr(transparent)]
86/// Enumerates the UI input event types.
87///
88///
89/// Available since API-level: 12
90#[cfg(feature = "api-12")]
91#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
92#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
93pub struct ArkUI_UIInputEvent_Type(pub ::core::ffi::c_uint);
94#[cfg(feature = "api-22")]
95#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
96impl ArkUI_CoastingAxisEventPhase {
97 /// Idle phase, indicating no-coasting phase.
98 pub const ARKUI_COASTING_AXIS_EVENT_PHASE_NONE: ArkUI_CoastingAxisEventPhase =
99 ArkUI_CoastingAxisEventPhase(0);
100 /// Coasting begin, this is the first coasting event.
101 pub const ARKUI_COASTING_AXIS_EVENT_PHASE_BEGIN: ArkUI_CoastingAxisEventPhase =
102 ArkUI_CoastingAxisEventPhase(1);
103 /// Coasting ongoing.
104 pub const ARKUI_COASTING_AXIS_EVENT_PHASE_UPDATE: ArkUI_CoastingAxisEventPhase =
105 ArkUI_CoastingAxisEventPhase(2);
106 /// Coasting end, this is the last coasting event.
107 pub const ARKUI_COASTING_AXIS_EVENT_PHASE_END: ArkUI_CoastingAxisEventPhase =
108 ArkUI_CoastingAxisEventPhase(3);
109}
110#[repr(transparent)]
111/// Enumerates the coasting axis event phases.
112///
113///
114/// Available since API-level: 22
115#[cfg(feature = "api-22")]
116#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
117#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
118pub struct ArkUI_CoastingAxisEventPhase(pub ::core::ffi::c_uint);
119#[cfg(feature = "api-12")]
120#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
121impl HitTestMode {
122 /// Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from
123 /// the hit test.
124 pub const HTM_DEFAULT: HitTestMode = HitTestMode(0);
125 /// The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit
126 /// test.
127 pub const HTM_BLOCK: HitTestMode = HitTestMode(1);
128 /// Both the node and its child node respond to the hit test of a touch event, and its sibling node is also
129 /// considered during the hit test.
130 pub const HTM_TRANSPARENT: HitTestMode = HitTestMode(2);
131 /// The node does not respond to the hit test of a touch event, but its child node and sibling node are considered
132 /// during the hit test.
133 pub const HTM_NONE: HitTestMode = HitTestMode(3);
134 /// The node and its child nodes participate in hit tests, while blocking hit tests for all sibling nodes and parent
135 /// nodes with lower priority.
136 ///
137 ///
138 /// Available since API-level: 20
139 #[cfg(feature = "api-20")]
140 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
141 pub const HTM_BLOCK_HIERARCHY: HitTestMode = HitTestMode(4);
142 /// The node does not respond to hit tests, and none of its descendants (including children and grandchildren)
143 /// participate in hit tests either.
144 ///
145 ///
146 /// Available since API-level: 20
147 #[cfg(feature = "api-20")]
148 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
149 pub const HTM_BLOCK_DESCENDANTS: HitTestMode = HitTestMode(5);
150}
151#[repr(transparent)]
152/// Enumerates the hit test modes.
153///
154///
155/// Available since API-level: 12
156#[cfg(feature = "api-12")]
157#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
158#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
159pub struct HitTestMode(pub ::core::ffi::c_uint);
160#[cfg(feature = "api-12")]
161#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
162impl ::core::ops::BitOr<ArkUI_ModifierKeyName> for ArkUI_ModifierKeyName {
163 type Output = Self;
164 #[inline]
165 fn bitor(self, other: Self) -> Self {
166 ArkUI_ModifierKeyName(self.0 | other.0)
167 }
168}
169#[cfg(feature = "api-12")]
170#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
171impl ::core::ops::BitOrAssign for ArkUI_ModifierKeyName {
172 #[inline]
173 fn bitor_assign(&mut self, rhs: ArkUI_ModifierKeyName) {
174 self.0 |= rhs.0;
175 }
176}
177#[cfg(feature = "api-12")]
178#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
179impl ::core::ops::BitAnd<ArkUI_ModifierKeyName> for ArkUI_ModifierKeyName {
180 type Output = Self;
181 #[inline]
182 fn bitand(self, other: Self) -> Self {
183 ArkUI_ModifierKeyName(self.0 & other.0)
184 }
185}
186#[cfg(feature = "api-12")]
187#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
188impl ::core::ops::BitAndAssign for ArkUI_ModifierKeyName {
189 #[inline]
190 fn bitand_assign(&mut self, rhs: ArkUI_ModifierKeyName) {
191 self.0 &= rhs.0;
192 }
193}
194#[cfg(feature = "api-12")]
195#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
196impl ArkUI_ModifierKeyName {
197 /// Ctrl.
198 pub const ARKUI_MODIFIER_KEY_CTRL: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(1);
199 /// Shift.
200 pub const ARKUI_MODIFIER_KEY_SHIFT: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(2);
201 /// Alt.
202 pub const ARKUI_MODIFIER_KEY_ALT: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(4);
203 /// Fn.
204 pub const ARKUI_MODIFIER_KEY_FN: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(8);
205}
206#[repr(transparent)]
207/// Defines an enum for modifier keys.
208///
209///
210/// Available since API-level: 12
211#[cfg(feature = "api-12")]
212#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
213#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
214pub struct ArkUI_ModifierKeyName(pub ::core::ffi::c_uint);
215/// ABS_X.
216#[cfg(feature = "api-15")]
217#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
218pub const UI_FOCUS_AXIS_EVENT_ABS_X: _bindgen_ty_6 = _bindgen_ty_6(0);
219/// ABS_Y.
220#[cfg(feature = "api-15")]
221#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
222pub const UI_FOCUS_AXIS_EVENT_ABS_Y: _bindgen_ty_6 = _bindgen_ty_6(1);
223/// ABS_Z.
224#[cfg(feature = "api-15")]
225#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
226pub const UI_FOCUS_AXIS_EVENT_ABS_Z: _bindgen_ty_6 = _bindgen_ty_6(2);
227/// ABS_RZ.
228#[cfg(feature = "api-15")]
229#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
230pub const UI_FOCUS_AXIS_EVENT_ABS_RZ: _bindgen_ty_6 = _bindgen_ty_6(3);
231/// ABS_GAS.
232#[cfg(feature = "api-15")]
233#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
234pub const UI_FOCUS_AXIS_EVENT_ABS_GAS: _bindgen_ty_6 = _bindgen_ty_6(4);
235/// ABS_BRAKE.
236#[cfg(feature = "api-15")]
237#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
238pub const UI_FOCUS_AXIS_EVENT_ABS_BRAKE: _bindgen_ty_6 = _bindgen_ty_6(5);
239/// ABS_HAT0X.
240#[cfg(feature = "api-15")]
241#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
242pub const UI_FOCUS_AXIS_EVENT_ABS_HAT0X: _bindgen_ty_6 = _bindgen_ty_6(6);
243/// ABS_HAT0Y.
244#[cfg(feature = "api-15")]
245#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
246pub const UI_FOCUS_AXIS_EVENT_ABS_HAT0Y: _bindgen_ty_6 = _bindgen_ty_6(7);
247/// Game controller RX-axis.
248///
249///
250/// Available since API-level: 23
251#[cfg(feature = "api-23")]
252#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
253#[cfg(feature = "api-15")]
254#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
255pub const UI_FOCUS_AXIS_EVENT_ABS_RX: _bindgen_ty_6 = _bindgen_ty_6(8);
256/// Game controller RY-axis.
257///
258///
259/// Available since API-level: 23
260#[cfg(feature = "api-23")]
261#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
262#[cfg(feature = "api-15")]
263#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
264pub const UI_FOCUS_AXIS_EVENT_ABS_RY: _bindgen_ty_6 = _bindgen_ty_6(9);
265/// Game controller THROTTLE-axis.
266///
267///
268/// Available since API-level: 23
269#[cfg(feature = "api-23")]
270#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
271#[cfg(feature = "api-15")]
272#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
273pub const UI_FOCUS_AXIS_EVENT_ABS_THROTTLE: _bindgen_ty_6 = _bindgen_ty_6(10);
274/// Game controller RUDDER-axis.
275///
276///
277/// Available since API-level: 23
278#[cfg(feature = "api-23")]
279#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
280#[cfg(feature = "api-15")]
281#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
282pub const UI_FOCUS_AXIS_EVENT_ABS_RUDDER: _bindgen_ty_6 = _bindgen_ty_6(11);
283/// Game controller WHEEL-axis.
284///
285///
286/// Available since API-level: 23
287#[cfg(feature = "api-23")]
288#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
289#[cfg(feature = "api-15")]
290#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
291pub const UI_FOCUS_AXIS_EVENT_ABS_WHEEL: _bindgen_ty_6 = _bindgen_ty_6(12);
292/// Game controller HAT1X-axis.
293///
294///
295/// Available since API-level: 23
296#[cfg(feature = "api-23")]
297#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
298#[cfg(feature = "api-15")]
299#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
300pub const UI_FOCUS_AXIS_EVENT_ABS_HAT1X: _bindgen_ty_6 = _bindgen_ty_6(13);
301/// Game controller HAT1Y-axis.
302///
303///
304/// Available since API-level: 23
305#[cfg(feature = "api-23")]
306#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
307#[cfg(feature = "api-15")]
308#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
309pub const UI_FOCUS_AXIS_EVENT_ABS_HAT1Y: _bindgen_ty_6 = _bindgen_ty_6(14);
310/// Game controller HAT2X-axis.
311///
312///
313/// Available since API-level: 23
314#[cfg(feature = "api-23")]
315#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
316#[cfg(feature = "api-15")]
317#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
318pub const UI_FOCUS_AXIS_EVENT_ABS_HAT2X: _bindgen_ty_6 = _bindgen_ty_6(15);
319/// Game controller HAT2Y-axis.
320///
321///
322/// Available since API-level: 23
323#[cfg(feature = "api-23")]
324#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
325#[cfg(feature = "api-15")]
326#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
327pub const UI_FOCUS_AXIS_EVENT_ABS_HAT2Y: _bindgen_ty_6 = _bindgen_ty_6(16);
328/// Game controller HAT3X-axis.
329///
330///
331/// Available since API-level: 23
332#[cfg(feature = "api-23")]
333#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
334#[cfg(feature = "api-15")]
335#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
336pub const UI_FOCUS_AXIS_EVENT_ABS_HAT3X: _bindgen_ty_6 = _bindgen_ty_6(17);
337/// Game controller HAT3Y-axis.
338///
339///
340/// Available since API-level: 23
341#[cfg(feature = "api-23")]
342#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
343#[cfg(feature = "api-15")]
344#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
345pub const UI_FOCUS_AXIS_EVENT_ABS_HAT3Y: _bindgen_ty_6 = _bindgen_ty_6(18);
346#[repr(transparent)]
347/// Defines an enum for the axis types for focus axis events.
348///
349///
350/// Available since API-level: 15
351#[cfg(feature = "api-15")]
352#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
353#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
354pub struct _bindgen_ty_6(pub ::core::ffi::c_uint);
355/// Vertical scroll axis.
356#[cfg(feature = "api-22")]
357#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
358pub const UI_AXIS_TYPE_VERTICAL_AXIS: _bindgen_ty_7 = _bindgen_ty_7(0);
359/// Horizontal scroll axis.
360#[cfg(feature = "api-22")]
361#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
362pub const UI_AXIS_TYPE_HORIZONTAL_AXIS: _bindgen_ty_7 = _bindgen_ty_7(1);
363/// Pinch axis.
364#[cfg(feature = "api-22")]
365#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
366pub const UI_AXIS_TYPE_PINCH_AXIS: _bindgen_ty_7 = _bindgen_ty_7(2);
367#[repr(transparent)]
368/// Enumerates the axis types for axis events.
369///
370///
371/// Available since API-level: 22
372#[cfg(feature = "api-22")]
373#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
374#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
375pub struct _bindgen_ty_7(pub ::core::ffi::c_uint);
376#[cfg(feature = "api-15")]
377#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
378impl ArkUI_InteractionHand {
379 /// Unknown.
380 pub const ARKUI_EVENT_HAND_NONE: ArkUI_InteractionHand = ArkUI_InteractionHand(0);
381 /// Left hand.
382 pub const ARKUI_EVENT_HAND_LEFT: ArkUI_InteractionHand = ArkUI_InteractionHand(1);
383 /// Right hand.
384 pub const ARKUI_EVENT_HAND_RIGHT: ArkUI_InteractionHand = ArkUI_InteractionHand(2);
385}
386#[repr(transparent)]
387/// Defines whether the touch event is from the left or right hand.
388///
389///
390/// Available since API-level: 15
391#[cfg(feature = "api-15")]
392#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
393#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
394pub struct ArkUI_InteractionHand(pub ::core::ffi::c_uint);
395/// The axis event is abnormal.
396#[cfg(feature = "api-15")]
397#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
398pub const UI_AXIS_EVENT_ACTION_NONE: _bindgen_ty_8 = _bindgen_ty_8(0);
399/// The axis event begins.
400#[cfg(feature = "api-15")]
401#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
402pub const UI_AXIS_EVENT_ACTION_BEGIN: _bindgen_ty_8 = _bindgen_ty_8(1);
403/// The axis event is updated.
404#[cfg(feature = "api-15")]
405#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
406pub const UI_AXIS_EVENT_ACTION_UPDATE: _bindgen_ty_8 = _bindgen_ty_8(2);
407/// The axis event ends.
408#[cfg(feature = "api-15")]
409#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
410pub const UI_AXIS_EVENT_ACTION_END: _bindgen_ty_8 = _bindgen_ty_8(3);
411/// The axis event is canceled.
412#[cfg(feature = "api-15")]
413#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
414pub const UI_AXIS_EVENT_ACTION_CANCEL: _bindgen_ty_8 = _bindgen_ty_8(4);
415#[repr(transparent)]
416/// Enumerates the action types for axis events.
417///
418///
419/// Available since API-level: 15
420#[cfg(feature = "api-15")]
421#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
422#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
423pub struct _bindgen_ty_8(pub ::core::ffi::c_uint);
424#[cfg(feature = "api-22")]
425#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
426impl ArkUI_TouchTestStrategy {
427 /// Custom dispatch has no effect; the system distributes events based on the hit status of the current node.
428 pub const ARKUI_TOUCH_TEST_STRATEGY_DEFAULT: ArkUI_TouchTestStrategy =
429 ArkUI_TouchTestStrategy(0);
430 /// The specified event is forwarded to a particular child node, and the system determines whether to
431 /// distribute the event to other sibling nodes.
432 pub const ARKUI_TOUCH_TEST_STRATEGY_FORWARD_COMPETITION: ArkUI_TouchTestStrategy =
433 ArkUI_TouchTestStrategy(1);
434 /// The specified event is forwarded to a particular child node, and the system no longer distributes
435 /// the event to other sibling nodes.
436 pub const ARKUI_TOUCH_TEST_STRATEGY_FORWARD: ArkUI_TouchTestStrategy =
437 ArkUI_TouchTestStrategy(2);
438}
439#[repr(transparent)]
440/// Define the touch test strategy.
441///
442///
443/// Available since API-level: 22
444#[cfg(feature = "api-22")]
445#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
446#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
447pub struct ArkUI_TouchTestStrategy(pub ::core::ffi::c_uint);
448extern "C" {
449 /// Obtains the type of a UI input event.
450 ///
451 /// Before accessing an <b>ArkUI_UIInputEvent</b> pointer, use this API to determine the type of the input event.
452 /// This API returns a value from the [`ArkUI_UIInputEvent_Type`] enum. It helps ensure compatibility with subsequent
453 /// accessors. For example, if the event is a touch event,
454 /// which is directional, you can use OH_ArkUI_UIInputEvent_GetXXX or OH_ArkUI_PointerEvent_GetXXX for access.
455 /// Using OH_ArkUI_KeyEvent_GetXXX to access the event may produce undefined behavior.
456 ///
457 /// For unsupported event types, this API returns the default value <b>0</b>.
458 ///
459 /// # Arguments
460 ///
461 /// * `event` - Pointer to the current UI input event.
462 ///
463 /// # Returns
464 ///
465 /// * Returns the type of the current UI input event; returns <b>0</b> if any parameter error occurs.
466 ///
467 /// Available since API-level: 12
468 #[cfg(feature = "api-12")]
469 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
470 pub fn OH_ArkUI_UIInputEvent_GetType(event: *const ArkUI_UIInputEvent) -> i32;
471 /// Obtains the action type of this UI input event.
472 ///
473 /// The action type defines the phase of a basic event (for example, start or end) and characterizes its behavior,
474 /// such as touch down or touch up Action types are specific to the event category:
475 /// UI_TOUCH_EVENT_ACTION_XXX for touch events and UI_MOUSE_EVENT_ACTION_XXX for mouse events.
476 ///
477 ///
478 /// **Note:** 1. For axis events, use [`OH_ArkUI_AxisEvent_GetAxisAction`] to obtain the action type,
479 /// which returns UI_AXIS_EVENT_ACTION_XXX.
480 /// 2. For key events, use [`OH_ArkUI_KeyEvent_GetType`] instead.
481 ///
482 /// # Arguments
483 ///
484 /// * `event` - Pointer to the current UI input event.
485 ///
486 /// # Returns
487 ///
488 /// * Returns the action type of the current UI input event; returns <b>-1</b> if any parameter error occurs.
489 ///
490 /// Available since API-level: 12
491 #[cfg(feature = "api-12")]
492 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
493 pub fn OH_ArkUI_UIInputEvent_GetAction(event: *const ArkUI_UIInputEvent) -> i32;
494 /// Obtains the source type of a UI input event.
495 ///
496 /// The source represents the physical device, such as a touchscreen or mouse device, that generates the event.
497 /// It is defined by the UI_INPUT_EVENT_SOURCE_TYPE_XXX enum.
498 /// This is different from the input tool, which is the device used to interact with the source, for example,
499 /// a finger or stylus. However, in certain cases, the input source and the input tool can be the same.
500 /// For example, a mouse device acts as both the source and tool for click events.
501 ///
502 ///
503 /// **Note:** For key events, obtaining the source type is not supported, and in such cases,
504 /// the API will return an <b>unknown</b> value.
505 ///
506 /// # Arguments
507 ///
508 /// * `event` - Pointer to the current UI input event.
509 ///
510 /// # Returns
511 ///
512 /// * Returns the source type of the current UI input event.
513 ///
514 /// Available since API-level: 12
515 #[cfg(feature = "api-12")]
516 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
517 pub fn OH_ArkUI_UIInputEvent_GetSourceType(event: *const ArkUI_UIInputEvent) -> i32;
518 /// Obtains the tool type of a UI input event.
519 ///
520 /// The input tool is the device used to interact with the input source, such as a finger or stylus.
521 /// It is defined by the UI_INPUT_EVENT_TOOL_TYPE_XXX enum.
522 /// These tools do not produce events directly but drive the input source to generate them.
523 ///
524 ///
525 /// **Note:** For key events, obtaining the tool type is not supported, and in such cases,
526 /// the API will return an <b>unknown</b> value.
527 ///
528 /// # Arguments
529 ///
530 /// * `event` - Pointer to the current UI input event.
531 ///
532 /// # Returns
533 ///
534 /// * Returns the tool type of the current UI input event.
535 ///
536 /// Available since API-level: 12
537 #[cfg(feature = "api-12")]
538 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
539 pub fn OH_ArkUI_UIInputEvent_GetToolType(event: *const ArkUI_UIInputEvent) -> i32;
540 /// Obtains the time when this UI input event occurs.
541 ///
542 /// # Arguments
543 ///
544 /// * `event` - Indicates the pointer to the current UI input event.
545 ///
546 /// # Returns
547 ///
548 /// * Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
549 ///
550 /// Available since API-level: 12
551 #[cfg(feature = "api-12")]
552 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
553 pub fn OH_ArkUI_UIInputEvent_GetEventTime(event: *const ArkUI_UIInputEvent) -> i64;
554 /// Obtains the number of contact points from a pointer event (such as a touch, mouse, or axis event).
555 ///
556 /// Pointer events are typically events that carry position information, such as touch events,
557 /// where the location of the event can be determined.
558 /// Non-pointer events, such as key events, do not have position information and do not involve contact points,
559 /// so this API is not applicable to key events.
560 ///
561 /// For touch events, this API returns the number of active touch points, for example, fingers on the screen.
562 /// For mouse and axis events, this API always returns <b>1</b>, as they are single-pointer interactions.
563 ///
564 /// # Arguments
565 ///
566 /// * `event` - Pointer to the current UI input event.
567 ///
568 /// # Returns
569 ///
570 /// * Number of contact points for the current pointer event.
571 ///
572 /// Available since API-level: 12
573 #[cfg(feature = "api-12")]
574 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
575 pub fn OH_ArkUI_PointerEvent_GetPointerCount(event: *const ArkUI_UIInputEvent) -> u32;
576 /// Obtains the unique ID of a contact point from a pointer event (such as a touch, mouse, or axis event).
577 ///
578 /// The ID distinguishes between multiple contact points from the same input device. The return value itself does not
579 /// have any other meaning beyond identifying the contact point.
580 ///
581 /// # Arguments
582 ///
583 /// * `event` - Pointer to the current UI input event.
584 ///
585 /// * `pointerIndex` - Index of the target contact point in the contact point list.
586 ///
587 /// # Returns
588 ///
589 /// * Unique ID of the specified contact point.
590 ///
591 /// Available since API-level: 12
592 #[cfg(feature = "api-12")]
593 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
594 pub fn OH_ArkUI_PointerEvent_GetPointerId(
595 event: *const ArkUI_UIInputEvent,
596 pointerIndex: u32,
597 ) -> i32;
598 /// Obtains the ID of the touch pointer that triggers the current touch event.
599 ///
600 /// # Arguments
601 ///
602 /// * `event` - Indicates the pointer to the current UI input event.
603 ///
604 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
605 ///
606 /// # Returns
607 ///
608 /// * Returns the result code.
609 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
610 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
611 ///
612 /// Available since API-level: 15
613 #[cfg(feature = "api-15")]
614 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
615 pub fn OH_ArkUI_PointerEvent_GetChangedPointerId(
616 event: *const ArkUI_UIInputEvent,
617 pointerIndex: *mut u32,
618 ) -> i32;
619 /// Obtains the X coordinate relative to the upper left corner of the current component from a directional
620 /// input event (such as a touch event, mouse event, or axis event).
621 ///
622 /// # Arguments
623 ///
624 /// * `event` - Indicates the pointer to the directional input event.
625 ///
626 /// # Returns
627 ///
628 /// * Returns the X coordinate relative to the upper left corner of the current component;
629 /// returns <b>0</b> if any parameter error occurs.
630 ///
631 /// Available since API-level: 12
632 #[cfg(feature = "api-12")]
633 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
634 pub fn OH_ArkUI_PointerEvent_GetX(event: *const ArkUI_UIInputEvent) -> f32;
635 /// Obtains the X coordinate of a specific contact point relative to the upper left corner of the current
636 /// component from a pointer event (such as a touch, mouse, or axis event).
637 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
638 ///
639 /// # Arguments
640 ///
641 /// * `event` - Pointer to the current UI input event.
642 ///
643 /// * `pointerIndex` - Index of the target contact point in the contact point list.
644 ///
645 /// # Returns
646 ///
647 /// * Returns the X coordinate relative to the upper left corner of the current component;
648 /// returns <b>0.0f</b> if any parameter error occurs.
649 ///
650 /// Available since API-level: 12
651 #[cfg(feature = "api-12")]
652 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
653 pub fn OH_ArkUI_PointerEvent_GetXByIndex(
654 event: *const ArkUI_UIInputEvent,
655 pointerIndex: u32,
656 ) -> f32;
657 /// Obtains the Y coordinate relative to the upper left corner of the current component from a directional
658 /// input event (such as a touch event, mouse event, or axis event).
659 ///
660 /// # Arguments
661 ///
662 /// * `event` - Indicates the pointer to the UI input event.
663 ///
664 /// # Returns
665 ///
666 /// * Returns the Y coordinate relative to the upper left corner of the current component;
667 /// returns <b>0.0f</b> if any parameter error occurs.
668 ///
669 /// Available since API-level: 12
670 #[cfg(feature = "api-12")]
671 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
672 pub fn OH_ArkUI_PointerEvent_GetY(event: *const ArkUI_UIInputEvent) -> f32;
673 /// Obtains the Y coordinate of a specific contact point relative to the upper left corner of the current
674 /// component from a pointer event (such as a touch, mouse, or axis event).
675 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
676 ///
677 /// # Arguments
678 ///
679 /// * `event` - Pointer to the current UI input event.
680 ///
681 /// * `pointerIndex` - Index of the target contact point in the contact point list.
682 ///
683 /// # Returns
684 ///
685 /// * Y coordinate relative to the upper left corner of the current component;
686 /// <b>0.0f</b> if any parameter error occurs.
687 ///
688 /// Available since API-level: 12
689 #[cfg(feature = "api-12")]
690 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
691 pub fn OH_ArkUI_PointerEvent_GetYByIndex(
692 event: *const ArkUI_UIInputEvent,
693 pointerIndex: u32,
694 ) -> f32;
695 /// Obtains the X coordinate relative to the upper left corner of the current application window from a
696 /// directional input event (such as a touch event, mouse event, or axis event).
697 ///
698 /// # Arguments
699 ///
700 /// * `event` - Indicates the pointer to the UI input event.
701 ///
702 /// # Returns
703 ///
704 /// * Returns the X coordinate relative to the upper left corner of the current application window;
705 /// returns <b>0.0f</b> if any parameter error occurs.
706 ///
707 /// Available since API-level: 12
708 #[cfg(feature = "api-12")]
709 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
710 pub fn OH_ArkUI_PointerEvent_GetWindowX(event: *const ArkUI_UIInputEvent) -> f32;
711 /// Obtains the X coordinate of a specific contact point relative to the upper left corner of the current
712 /// application window from a pointer event (such as a touch, mouse, or axis event).
713 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
714 ///
715 /// # Arguments
716 ///
717 /// * `event` - Pointer to the current UI input event.
718 ///
719 /// * `pointerIndex` - Index of the target contact point in the contact point list.
720 ///
721 /// # Returns
722 ///
723 /// * X coordinate relative to the upper left corner of the current application window;
724 /// <b>0.0f</b> if any parameter error occurs.
725 ///
726 /// Available since API-level: 12
727 #[cfg(feature = "api-12")]
728 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
729 pub fn OH_ArkUI_PointerEvent_GetWindowXByIndex(
730 event: *const ArkUI_UIInputEvent,
731 pointerIndex: u32,
732 ) -> f32;
733 /// Obtains the Y coordinate relative to the upper left corner of the current application window from a
734 /// directional input event (such as a touch event, mouse event, or axis event).
735 ///
736 /// # Arguments
737 ///
738 /// * `event` - Indicates the pointer to the UI input event.
739 ///
740 /// # Returns
741 ///
742 /// * Returns the Y coordinate relative to the upper left corner of the current application window;
743 /// returns <b>0.0f</b> if any parameter error occurs.
744 ///
745 /// Available since API-level: 12
746 #[cfg(feature = "api-12")]
747 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
748 pub fn OH_ArkUI_PointerEvent_GetWindowY(event: *const ArkUI_UIInputEvent) -> f32;
749 /// Obtains the Y coordinate of a specific contact point relative to the upper left corner of the current
750 /// application window from a pointer event (such as a touch, mouse, or axis event).
751 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
752 ///
753 /// # Arguments
754 ///
755 /// * `event` - Pointer to the current UI input event.
756 ///
757 /// * `pointerIndex` - Index of the target contact point in the contact point list.
758 ///
759 /// # Returns
760 ///
761 /// * Returns the Y coordinate relative to the upper left corner of the current application window;
762 /// returns <b>0.0f</b> if any parameter error occurs.
763 ///
764 /// Available since API-level: 12
765 #[cfg(feature = "api-12")]
766 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
767 pub fn OH_ArkUI_PointerEvent_GetWindowYByIndex(
768 event: *const ArkUI_UIInputEvent,
769 pointerIndex: u32,
770 ) -> f32;
771 /// Obtains the X coordinate relative to the upper left corner of the current screen from a directional input
772 /// event (such as a touch event, mouse event, or axis event).
773 ///
774 /// # Arguments
775 ///
776 /// * `event` - Indicates the pointer to the UI input event.
777 ///
778 /// # Returns
779 ///
780 /// * Returns the X coordinate relative to the upper left corner of the current screen;
781 /// returns <b>0.0f</b> if any parameter error occurs.
782 ///
783 /// Available since API-level: 12
784 #[cfg(feature = "api-12")]
785 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
786 pub fn OH_ArkUI_PointerEvent_GetDisplayX(event: *const ArkUI_UIInputEvent) -> f32;
787 /// Obtains the X coordinate of a specific contact point relative to the upper left corner of the current screen
788 /// from a pointer event (such as a touch, mouse, or axis event).
789 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
790 ///
791 /// # Arguments
792 ///
793 /// * `event` - Pointer to the current UI input event.
794 ///
795 /// * `pointerIndex` - Index of the target contact point in the contact point list.
796 ///
797 /// # Returns
798 ///
799 /// * Returns the X coordinate relative to the upper left corner of the current screen;
800 /// returns <b>0.0f</b> if any parameter error occurs.
801 ///
802 /// Available since API-level: 12
803 #[cfg(feature = "api-12")]
804 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
805 pub fn OH_ArkUI_PointerEvent_GetDisplayXByIndex(
806 event: *const ArkUI_UIInputEvent,
807 pointerIndex: u32,
808 ) -> f32;
809 /// Obtains the Y coordinate relative to the upper left corner of the current screen from a directional input
810 /// event (such as a touch event, mouse event, or axis event).
811 ///
812 /// # Arguments
813 ///
814 /// * `event` - Indicates the pointer to the UI input event.
815 ///
816 /// # Returns
817 ///
818 /// * Returns the Y coordinate relative to the upper left corner of the current screen;
819 /// returns <b>0.0f</b> if any parameter error occurs.
820 ///
821 /// Available since API-level: 12
822 #[cfg(feature = "api-12")]
823 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
824 pub fn OH_ArkUI_PointerEvent_GetDisplayY(event: *const ArkUI_UIInputEvent) -> f32;
825 /// Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current screen
826 /// from a pointer event (such as a touch event, mouse event, or axis event).
827 ///
828 /// # Arguments
829 ///
830 /// * `event` - Pointer to the current UI input event.
831 ///
832 /// * `pointerIndex` - Index of the target contact point in the contact point list.
833 ///
834 /// # Returns
835 ///
836 /// * Returns the Y coordinate relative to the upper left corner of the current screen;
837 /// returns <b>0.0f</b> if any parameter error occurs.
838 ///
839 /// Available since API-level: 12
840 #[cfg(feature = "api-12")]
841 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
842 pub fn OH_ArkUI_PointerEvent_GetDisplayYByIndex(
843 event: *const ArkUI_UIInputEvent,
844 pointerIndex: u32,
845 ) -> f32;
846 /// Obtains the X coordinate relative to global display from a pointer event (such as a touch, mouse,
847 /// or axis event).
848 /// Position information can only be obtained from UI input events.
849 ///
850 /// # Arguments
851 ///
852 /// * `event` - Pointer to the current UI input event.
853 ///
854 /// # Returns
855 ///
856 /// * float X coordinate relative to the global display. <b>0</b> is returned if any parameter error occurs
857 /// (for example, if the event does not contain position information).
858 ///
859 /// Available since API-level: 20
860 #[cfg(feature = "api-20")]
861 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
862 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayX(event: *const ArkUI_UIInputEvent) -> f32;
863 /// Obtains the X coordinate of a specific contact point relative to global display from a pointer event
864 /// (such as a touch, mouse, or axis event).
865 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
866 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
867 ///
868 /// # Arguments
869 ///
870 /// * `event` - Pointer to the current UI input event.
871 ///
872 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
873 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
874 ///
875 /// # Returns
876 ///
877 /// * float X coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
878 ///
879 /// Available since API-level: 20
880 #[cfg(feature = "api-20")]
881 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
882 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(
883 event: *const ArkUI_UIInputEvent,
884 pointerIndex: u32,
885 ) -> f32;
886 /// Obtains the Y coordinate relative to global display from a pointer event (such as a touch, mouse,
887 /// or axis event).
888 /// Position information can only be obtained from pointer-like events.
889 ///
890 /// # Arguments
891 ///
892 /// * `event` - Pointer to the current UI input event.
893 ///
894 /// # Returns
895 ///
896 /// * float Y coordinate relative to the global display; <b>0</b> if any parameter error occurs
897 /// (for example, if the event does not contain position information).
898 ///
899 /// Available since API-level: 20
900 #[cfg(feature = "api-20")]
901 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
902 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayY(event: *const ArkUI_UIInputEvent) -> f32;
903 /// Obtains the Y coordinate of a specific contact point relative to global display from a pointer event
904 /// (such as a touch, mouse, or axis event).
905 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
906 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
907 ///
908 /// # Arguments
909 ///
910 /// * `event` - Pointer to the current UI input event.
911 ///
912 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
913 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
914 ///
915 /// # Returns
916 ///
917 /// * float Y coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
918 ///
919 /// Available since API-level: 20
920 #[cfg(feature = "api-20")]
921 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
922 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(
923 event: *const ArkUI_UIInputEvent,
924 pointerIndex: u32,
925 ) -> f32;
926 /// Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event).
927 ///
928 /// # Arguments
929 ///
930 /// * `event` - Indicates the pointer to the current UI input event.
931 ///
932 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
933 ///
934 /// # Returns
935 ///
936 /// * Returns the pressure applied to the touchscreen; returns <b>0.0f</b> if any parameter error occurs.
937 ///
938 /// Available since API-level: 12
939 #[cfg(feature = "api-12")]
940 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
941 pub fn OH_ArkUI_PointerEvent_GetPressure(
942 event: *const ArkUI_UIInputEvent,
943 pointerIndex: u32,
944 ) -> f32;
945 /// Obtains the tilt angle relative to the YZ plane from a pointer event.
946 /// The value range is [-90, 90], where positive values indicate a rightward tilt.
947 /// This API is applicable only to stylus-based touch events from devices that support tilt angle reporting.
948 ///
949 /// # Arguments
950 ///
951 /// * `event` - Pointer to the current UI input event.
952 ///
953 /// * `pointerIndex` - Index of the target contact point in the contact point list.
954 ///
955 /// # Returns
956 ///
957 /// * Returns the angle relative to the YZ plane.
958 ///
959 /// Available since API-level: 12
960 #[cfg(feature = "api-12")]
961 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
962 pub fn OH_ArkUI_PointerEvent_GetTiltX(
963 event: *const ArkUI_UIInputEvent,
964 pointerIndex: u32,
965 ) -> f32;
966 /// Obtains the tilt angle relative to the XZ plane from a pointer event.
967 /// The value range is [-90, 90], where positive values indicate a rightward tilt.
968 /// This API is applicable only to stylus-based touch events from devices that support tilt angle reporting.
969 ///
970 /// # Arguments
971 ///
972 /// * `event` - Pointer to the current UI input event.
973 ///
974 /// * `pointerIndex` - Index of the target contact point in the contact point list.
975 ///
976 /// # Returns
977 ///
978 /// * Returns the angle relative to the XZ plane.
979 ///
980 /// Available since API-level: 12
981 #[cfg(feature = "api-12")]
982 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
983 pub fn OH_ArkUI_PointerEvent_GetTiltY(
984 event: *const ArkUI_UIInputEvent,
985 pointerIndex: u32,
986 ) -> f32;
987 /// Obtains the rotation angle of the stylus around the z-axis from a UI input event.
988 ///
989 /// # Arguments
990 ///
991 /// * `event` - Pointer to the UI input event.
992 ///
993 /// * `rollAngle` - Rotation angle of the stylus around the z-axis.
994 ///
995 /// # Returns
996 ///
997 /// * Returns the result code.
998 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
999 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1000 ///
1001 /// Available since API-level: 17
1002 #[cfg(feature = "api-17")]
1003 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1004 pub fn OH_ArkUI_PointerEvent_GetRollAngle(
1005 event: *const ArkUI_UIInputEvent,
1006 rollAngle: *mut f64,
1007 ) -> i32;
1008 /// Obtains the width of the contact area for a pointer event. This API is applicable only to finger-based touch
1009 /// events, and the return value typically represents the radius of a circular touch area.
1010 ///
1011 /// # Arguments
1012 ///
1013 /// * `event` - Pointer to the current UI input event.
1014 ///
1015 /// * `pointerIndex` - Index of the target contact point in the contact point list.
1016 ///
1017 /// # Returns
1018 ///
1019 /// * Returns the width of the touch area.
1020 ///
1021 /// Available since API-level: 12
1022 #[cfg(feature = "api-12")]
1023 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1024 pub fn OH_ArkUI_PointerEvent_GetTouchAreaWidth(
1025 event: *const ArkUI_UIInputEvent,
1026 pointerIndex: u32,
1027 ) -> f32;
1028 /// Obtains the height of the contact area for a pointer event. This API is applicable only to finger-based touch
1029 /// events, and the return value typically represents the radius of a circular touch area.
1030 ///
1031 /// # Arguments
1032 ///
1033 /// * `event` - Pointer to the current UI input event.
1034 ///
1035 /// * `pointerIndex` - Index of the target contact point in the contact point list.
1036 ///
1037 /// # Returns
1038 ///
1039 /// * Returns the height of the touch area.
1040 ///
1041 /// Available since API-level: 12
1042 #[cfg(feature = "api-12")]
1043 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1044 pub fn OH_ArkUI_PointerEvent_GetTouchAreaHeight(
1045 event: *const ArkUI_UIInputEvent,
1046 pointerIndex: u32,
1047 ) -> f32;
1048 /// Checks whether an event is triggered by the user's left or right hand.
1049 /// This API is only effective on some touch devices.
1050 ///
1051 ///
1052 /// **Note:** This value cannot be obtained in real time when pressed. Before the
1053 /// system completes result inference, it will return <b>NONE</b> by default. Therefore,
1054 /// please do not over-rely on the results returned by this interface.
1055 ///
1056 /// # Arguments
1057 ///
1058 /// * `event` - Pointer to the current UI input event.
1059 ///
1060 /// * `hand` - Whether the touch point is from the left or right hand.
1061 ///
1062 /// # Returns
1063 ///
1064 /// * Result code.
1065 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1066 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1067 ///
1068 /// Available since API-level: 15
1069 #[cfg(feature = "api-15")]
1070 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1071 pub fn OH_ArkUI_PointerEvent_GetInteractionHand(
1072 event: *const ArkUI_UIInputEvent,
1073 hand: *mut ArkUI_InteractionHand,
1074 ) -> i32;
1075 /// Checks whether an event is triggered by the user's left or right hand.
1076 /// This API is only effective on some touch devices.
1077 ///
1078 ///
1079 /// **Note:** This value cannot be obtained in real time when pressed. Before the
1080 /// system completes result inference, it will return <b>NONE</b> by default. Therefore,
1081 /// please do not over-rely on the results returned by this interface.
1082 ///
1083 /// # Arguments
1084 ///
1085 /// * `event` - Pointer to the current UI input event.
1086 ///
1087 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1088 ///
1089 /// * `hand` - Whether the touch point is from the left or right hand.
1090 ///
1091 /// # Returns
1092 ///
1093 /// * Result code.
1094 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1095 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1096 ///
1097 /// Available since API-level: 15
1098 #[cfg(feature = "api-15")]
1099 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1100 pub fn OH_ArkUI_PointerEvent_GetInteractionHandByIndex(
1101 event: *const ArkUI_UIInputEvent,
1102 pointerIndex: i32,
1103 hand: *mut ArkUI_InteractionHand,
1104 ) -> i32;
1105 /// Obtains the number of historical events from a pointer event (such as a touch event).
1106 /// Historical events are the raw events that occur between the current event and the previous event.
1107 /// This API is applicable only to move events.
1108 ///
1109 /// # Arguments
1110 ///
1111 /// * `event` - Pointer to the current UI input event.
1112 ///
1113 /// # Returns
1114 ///
1115 /// * Returns the number of historical events.
1116 ///
1117 /// Available since API-level: 12
1118 #[cfg(feature = "api-12")]
1119 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1120 pub fn OH_ArkUI_PointerEvent_GetHistorySize(event: *const ArkUI_UIInputEvent) -> u32;
1121 /// Obtains the occurrence time of a historical event from a directional input event (such as a touch event,
1122 /// mouse event, or axis event).
1123 ///
1124 /// # Arguments
1125 ///
1126 /// * `event` - Indicates the pointer to the current UI input event.
1127 ///
1128 /// * `historyIndex` - Indicates the index of the target historical event.
1129 ///
1130 /// # Returns
1131 ///
1132 /// * Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
1133 ///
1134 /// Available since API-level: 12
1135 #[cfg(feature = "api-12")]
1136 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1137 pub fn OH_ArkUI_PointerEvent_GetHistoryEventTime(
1138 event: *const ArkUI_UIInputEvent,
1139 historyIndex: u32,
1140 ) -> i64;
1141 /// Obtains the number of touch points in a specific historical event from a directional input event (such as
1142 /// a touch event, mouse event, or axis event).
1143 ///
1144 /// # Arguments
1145 ///
1146 /// * `event` - Indicates the pointer to the current UI input event.
1147 ///
1148 /// * `historyIndex` - Indicates the index of the target historical event.
1149 ///
1150 /// # Returns
1151 ///
1152 /// * Returns the number of touch points in the specified historical event
1153 ///
1154 /// Available since API-level: 12
1155 #[cfg(feature = "api-12")]
1156 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1157 pub fn OH_ArkUI_PointerEvent_GetHistoryPointerCount(
1158 event: *const ArkUI_UIInputEvent,
1159 historyIndex: u32,
1160 ) -> u32;
1161 /// Obtains the unique ID of a contact point from a historical event of a pointer event (such as a touch event).
1162 ///
1163 /// The ID distinguishes between multiple contact points from the same input device.
1164 /// The return value itself does not have any other meaning beyond identifying the contact point.
1165 ///
1166 /// # Arguments
1167 ///
1168 /// * `event` - Pointer to the current UI input event.
1169 ///
1170 /// * `pointerIndex` - Index of the target contact point in the contact point list.
1171 ///
1172 /// * `historyIndex` - Index of the target historical event.
1173 ///
1174 /// # Returns
1175 ///
1176 /// * Returns the ID of the corresponding touch point in the specified historical event.
1177 ///
1178 /// Available since API-level: 12
1179 #[cfg(feature = "api-12")]
1180 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1181 pub fn OH_ArkUI_PointerEvent_GetHistoryPointerId(
1182 event: *const ArkUI_UIInputEvent,
1183 pointerIndex: u32,
1184 historyIndex: u32,
1185 ) -> i32;
1186 /// Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
1187 /// of the current component from a directional input event (such as a touch event, mouse event, or axis event).
1188 ///
1189 /// # Arguments
1190 ///
1191 /// * `event` - Indicates the pointer to the current UI input event.
1192 ///
1193 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1194 ///
1195 /// * `historyIndex` - Indicates the index of the target historical event.
1196 ///
1197 /// # Returns
1198 ///
1199 /// * Returns the X coordinate relative to the upper left corner of the current component;
1200 /// returns <b>0.0f</b> if any parameter error occurs.
1201 ///
1202 /// Available since API-level: 12
1203 #[cfg(feature = "api-12")]
1204 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1205 pub fn OH_ArkUI_PointerEvent_GetHistoryX(
1206 event: *const ArkUI_UIInputEvent,
1207 pointerIndex: u32,
1208 historyIndex: u32,
1209 ) -> f32;
1210 /// Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
1211 /// of the current component from a directional input event (such as a touch event, mouse event, or axis event).
1212 ///
1213 /// # Arguments
1214 ///
1215 /// * `event` - Indicates the pointer to the current UI input event.
1216 ///
1217 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1218 ///
1219 /// * `historyIndex` - Indicates the index of the target historical event.
1220 ///
1221 /// # Returns
1222 ///
1223 /// * Returns the Y coordinate relative to the upper left corner of the current component;
1224 /// returns <b>0.0f</b> if any parameter error occurs.
1225 ///
1226 /// Available since API-level: 12
1227 #[cfg(feature = "api-12")]
1228 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1229 pub fn OH_ArkUI_PointerEvent_GetHistoryY(
1230 event: *const ArkUI_UIInputEvent,
1231 pointerIndex: u32,
1232 historyIndex: u32,
1233 ) -> f32;
1234 /// Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
1235 /// of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
1236 ///
1237 /// # Arguments
1238 ///
1239 /// * `event` - Indicates the pointer to the current UI input event.
1240 ///
1241 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1242 ///
1243 /// * `historyIndex` - Indicates the index of the target historical event.
1244 ///
1245 /// # Returns
1246 ///
1247 /// * Returns the X coordinate relative to the upper left corner of the current application window;
1248 /// returns <b>0.0f</b> if any parameter error occurs.
1249 ///
1250 /// Available since API-level: 12
1251 #[cfg(feature = "api-12")]
1252 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1253 pub fn OH_ArkUI_PointerEvent_GetHistoryWindowX(
1254 event: *const ArkUI_UIInputEvent,
1255 pointerIndex: u32,
1256 historyIndex: u32,
1257 ) -> f32;
1258 /// Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
1259 /// of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
1260 ///
1261 /// # Arguments
1262 ///
1263 /// * `event` - Indicates the pointer to the current UI input event.
1264 ///
1265 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1266 ///
1267 /// * `historyIndex` - Indicates the index of the target historical event.
1268 ///
1269 /// # Returns
1270 ///
1271 /// * Returns the Y coordinate relative to the upper left corner of the current application window;
1272 /// returns <b>0.0f</b> if any parameter error occurs.
1273 ///
1274 /// Available since API-level: 12
1275 #[cfg(feature = "api-12")]
1276 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1277 pub fn OH_ArkUI_PointerEvent_GetHistoryWindowY(
1278 event: *const ArkUI_UIInputEvent,
1279 pointerIndex: u32,
1280 historyIndex: u32,
1281 ) -> f32;
1282 /// Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
1283 /// of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
1284 ///
1285 /// # Arguments
1286 ///
1287 /// * `event` - Indicates the pointer to the current UI input event.
1288 ///
1289 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1290 ///
1291 /// * `historyIndex` - Indicates the index of the target historical event.
1292 ///
1293 /// # Returns
1294 ///
1295 /// * Returns the X coordinate relative to the upper left corner of the current screen;
1296 /// returns <b>0.0f</b> if any parameter error occurs.
1297 ///
1298 /// Available since API-level: 12
1299 #[cfg(feature = "api-12")]
1300 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1301 pub fn OH_ArkUI_PointerEvent_GetHistoryDisplayX(
1302 event: *const ArkUI_UIInputEvent,
1303 pointerIndex: u32,
1304 historyIndex: u32,
1305 ) -> f32;
1306 /// Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
1307 /// of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
1308 ///
1309 /// # Arguments
1310 ///
1311 /// * `event` - Indicates the pointer to the current UI input event.
1312 ///
1313 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1314 ///
1315 /// * `historyIndex` - Indicates the index of the target historical event.
1316 ///
1317 /// # Returns
1318 ///
1319 /// * Returns the Y coordinate relative to the upper left corner of the current screen;
1320 /// returns <b>0.0f</b> if any parameter error occurs.
1321 ///
1322 /// Available since API-level: 12
1323 #[cfg(feature = "api-12")]
1324 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1325 pub fn OH_ArkUI_PointerEvent_GetHistoryDisplayY(
1326 event: *const ArkUI_UIInputEvent,
1327 pointerIndex: u32,
1328 historyIndex: u32,
1329 ) -> f32;
1330 /// Obtains the X coordinate relative to the global display for a specific touch point from historical events,
1331 /// based on the given pointer index and history index of an input event (such as a touch, mouse, or axis event).
1332 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
1333 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
1334 ///
1335 /// # Arguments
1336 ///
1337 /// * `event` - Pointer to the current UI input event.
1338 ///
1339 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1340 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
1341 ///
1342 /// * `historyIndex` - Index of the historical value to return. It must be less than
1343 /// [`#OH_ArkUI_PointerEvent_GetHistorySize`].
1344 ///
1345 /// # Returns
1346 ///
1347 /// * float X coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
1348 ///
1349 /// Available since API-level: 20
1350 #[cfg(feature = "api-20")]
1351 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1352 pub fn OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX(
1353 event: *const ArkUI_UIInputEvent,
1354 pointerIndex: u32,
1355 historyIndex: u32,
1356 ) -> f32;
1357 /// Obtains the Y coordinate relative to the global display for a specific touch point from historical events,
1358 /// based on the given pointer index and history index of an input event (such as a touch, mouse, or axis event).
1359 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
1360 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
1361 ///
1362 /// # Arguments
1363 ///
1364 /// * `event` - Pointer to the current UI input event.
1365 ///
1366 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1367 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
1368 ///
1369 /// * `historyIndex` - Index of the historical value to return. It must be less than
1370 /// [`#OH_ArkUI_PointerEvent_GetHistorySize`].
1371 ///
1372 /// # Returns
1373 ///
1374 /// * float Y coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
1375 ///
1376 /// Available since API-level: 20
1377 #[cfg(feature = "api-20")]
1378 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1379 pub fn OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY(
1380 event: *const ArkUI_UIInputEvent,
1381 pointerIndex: u32,
1382 historyIndex: u32,
1383 ) -> f32;
1384 /// Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event
1385 /// (for example, a touch event)..
1386 ///
1387 /// # Arguments
1388 ///
1389 /// * `event` - Indicates the pointer to the current UI input event.
1390 ///
1391 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1392 ///
1393 /// * `historyIndex` - Indicates the index of the target historical event.
1394 ///
1395 /// # Returns
1396 ///
1397 /// * Returns the pressure applied to the touchscreen; returns <b>0.0f</b> if any parameter error occurs.
1398 ///
1399 /// Available since API-level: 12
1400 #[cfg(feature = "api-12")]
1401 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1402 pub fn OH_ArkUI_PointerEvent_GetHistoryPressure(
1403 event: *const ArkUI_UIInputEvent,
1404 pointerIndex: u32,
1405 historyIndex: u32,
1406 ) -> f32;
1407 /// Obtains the angle relative to the YZ plane in a specific historical event from a directional input event
1408 /// (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt.
1409 ///
1410 /// # Arguments
1411 ///
1412 /// * `event` - Indicates the pointer to the current UI input event.
1413 ///
1414 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1415 ///
1416 /// * `historyIndex` - Indicates the index of the target historical event.
1417 ///
1418 /// # Returns
1419 ///
1420 /// * Returns the angle relative to the YZ plane.
1421 ///
1422 /// Available since API-level: 12
1423 #[cfg(feature = "api-12")]
1424 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1425 pub fn OH_ArkUI_PointerEvent_GetHistoryTiltX(
1426 event: *const ArkUI_UIInputEvent,
1427 pointerIndex: u32,
1428 historyIndex: u32,
1429 ) -> f32;
1430 /// Obtains the angle relative to the XZ plane in a specific historical event from a directional input event
1431 /// (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt.
1432 ///
1433 /// # Arguments
1434 ///
1435 /// * `event` - Indicates the pointer to the current UI input event.
1436 ///
1437 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1438 ///
1439 /// * `historyIndex` - Indicates the index of the target historical event.
1440 ///
1441 /// # Returns
1442 ///
1443 /// * Returns the angle relative to the XZ plane.
1444 ///
1445 /// Available since API-level: 12
1446 #[cfg(feature = "api-12")]
1447 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1448 pub fn OH_ArkUI_PointerEvent_GetHistoryTiltY(
1449 event: *const ArkUI_UIInputEvent,
1450 pointerIndex: u32,
1451 historyIndex: u32,
1452 ) -> f32;
1453 /// Obtains the width of the touch area in a specific historical event from a directional input event
1454 /// (for example, a touch event).
1455 ///
1456 /// # Arguments
1457 ///
1458 /// * `event` - Indicates the pointer to the current UI input event.
1459 ///
1460 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1461 ///
1462 /// * `historyIndex` - Indicates the index of the target historical event.
1463 ///
1464 /// # Returns
1465 ///
1466 /// * Returns the width of the touch area.
1467 ///
1468 /// Available since API-level: 12
1469 #[cfg(feature = "api-12")]
1470 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1471 pub fn OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(
1472 event: *const ArkUI_UIInputEvent,
1473 pointerIndex: u32,
1474 historyIndex: u32,
1475 ) -> f32;
1476 /// Obtains the height of the touch area in a specific historical event from a directional input event
1477 /// (for example, a touch event).
1478 ///
1479 /// # Arguments
1480 ///
1481 /// * `event` - Indicates the pointer to the current UI input event.
1482 ///
1483 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1484 ///
1485 /// * `historyIndex` - Indicates the index of the target historical event.
1486 ///
1487 /// # Returns
1488 ///
1489 /// * Returns the height of the touch area.
1490 ///
1491 /// Available since API-level: 12
1492 #[cfg(feature = "api-12")]
1493 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1494 pub fn OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(
1495 event: *const ArkUI_UIInputEvent,
1496 pointerIndex: u32,
1497 historyIndex: u32,
1498 ) -> f32;
1499 /// Obtains the value of the vertical scroll axis for this axis event.
1500 /// This value is typically generated by mouse wheel scrolling or two-finger vertical swiping on a touchpad.
1501 ///
1502 /// If the value is generated by mouse wheel scrolling:
1503 /// 1. The reported value is in degrees and represents the incremental angle of a single scroll,
1504 /// not the total scroll amount.
1505 /// 2. The reported value includes the user's scroll step configuration (see [`OH_ArkUI_AxisEvent_GetScrollStep`]).
1506 /// 3. The sign of the value indicates the direction: positive for forward scrolling and negative for backward scrolling.
1507 ///
1508 /// If the value is generated by two-finger vertical swiping on a touchpad:
1509 /// 1. The reported value is in px and represents the incremental scroll amount, not the total scroll amount.
1510 /// 2. The reported value does not include the user's scroll step configuration.
1511 /// 3. The sign of the value indicates the direction: positive for swiping down and negative for swiping up.
1512 /// 4. The direction is affected by the system settings for natural scrolling.
1513 ///
1514 /// Under normal circumstances, vertical scroll axis events only drive vertical swipe gestures. However,
1515 /// if the mouse pointer is over a scrollable area where the scrollable directions are consistent,
1516 /// the vertical scroll axis event can drive the swipe gestures in this scrollable area, even if they are defined
1517 /// as horizontal.
1518 ///
1519 /// # Arguments
1520 ///
1521 /// * `event` - Pointer to the current UI input event.
1522 ///
1523 /// # Returns
1524 ///
1525 /// * Value of the vertical scroll axis of the current axis event; <b>0.0</b> if any parameter error occurs.
1526 ///
1527 /// Available since API-level: 12
1528 #[cfg(feature = "api-12")]
1529 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1530 pub fn OH_ArkUI_AxisEvent_GetVerticalAxisValue(event: *const ArkUI_UIInputEvent) -> f64;
1531 /// Obtains the value of the horizontal scroll axis for this axis event.
1532 /// This value is generated by two-finger horizontal swiping on a touchpad.
1533 ///
1534 ///
1535 /// **Note:** 1. The reported value is in px and represents the incremental scroll amount, not the total scroll amount.
1536 /// 2. The reported value does not include the user's scroll step configuration.
1537 /// 3. The sign of the value indicates the direction: positive for swiping right and negative for swiping left.
1538 /// 4. The direction is affected by the system settings for natural scrolling.
1539 ///
1540 /// # Arguments
1541 ///
1542 /// * `event` - Pointer to the current UI input event.
1543 ///
1544 /// # Returns
1545 ///
1546 /// * Returns the value of the horizontal scroll axis of the current axis event;
1547 /// returns <b>0</b> if any parameter error occurs.
1548 ///
1549 /// Available since API-level: 12
1550 #[cfg(feature = "api-12")]
1551 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1552 pub fn OH_ArkUI_AxisEvent_GetHorizontalAxisValue(event: *const ArkUI_UIInputEvent) -> f64;
1553 /// This value is generated by a two-finger pinch gesture on a touchpad.
1554 /// The reported scale value is relative to the initial state
1555 ///
1556 /// when the system first detects the pinch gesture, with an initial scale value of 1.0.
1557 /// During the pinch operation, the scale value decreases from 1.0 towards 0.0 when the user pinches inward
1558 /// and increases from 1.0 when the user spreads fingers outward.
1559 ///
1560 /// # Arguments
1561 ///
1562 /// * `event` - Pointer to the current UI input event.
1563 ///
1564 /// # Returns
1565 ///
1566 /// * Scale value of the pinch axis of the current axis event; <b>0.0</b> if any parameter error occurs.
1567 ///
1568 /// Available since API-level: 12
1569 #[cfg(feature = "api-12")]
1570 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1571 pub fn OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(event: *const ArkUI_UIInputEvent) -> f64;
1572 /// Obtains the action type of the current axis event.
1573 ///
1574 /// # Arguments
1575 ///
1576 /// * `event` - Indicates the pointer to the current UI input event.
1577 ///
1578 /// # Returns
1579 ///
1580 /// * Returns the action type of the current axis event.
1581 ///
1582 /// Available since API-level: 15
1583 #[cfg(feature = "api-15")]
1584 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1585 pub fn OH_ArkUI_AxisEvent_GetAxisAction(event: *const ArkUI_UIInputEvent) -> i32;
1586 /// Checks whether this axis event contains the specified axis type.
1587 ///
1588 /// # Arguments
1589 ///
1590 /// * `event` - Indicates the pointer to the current UI input event.
1591 ///
1592 /// * `axis` - Axis type of the axis event.
1593 ///
1594 /// # Returns
1595 ///
1596 /// * Whether the current axis event contains the specified axis type.
1597 /// Returns <b>true</b> if the axis event contains the specified axis type, and <b>false</b> otherwise.
1598 ///
1599 /// Available since API-level: 22
1600 #[cfg(feature = "api-22")]
1601 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
1602 pub fn OH_ArkUI_AxisEvent_HasAxis(event: *const ArkUI_UIInputEvent, axis: i32) -> i32;
1603 /// Sets the hit testing mode, that is, how the component behaves during hit testing.
1604 /// This API only applies to scenarios raw input events are received, such as when [`NODE_ON_TOUCH`] is used for
1605 /// touch event handling.
1606 /// It cannot be used with <b>ArkUI_UIInputEvent</b> objects obtained from gesture events through
1607 /// [`OH_ArkUI_GestureEvent_GetRawInputEvent`].
1608 ///
1609 /// # Arguments
1610 ///
1611 /// * `event` - Pointer to the current UI input event.
1612 ///
1613 /// * `mode` - Hit testing mode, of type [`HitTestMode`].
1614 ///
1615 /// # Returns
1616 ///
1617 /// * Result code.
1618 ///
1619 /// Available since API-level: 12
1620 #[cfg(feature = "api-12")]
1621 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1622 pub fn OH_ArkUI_PointerEvent_SetInterceptHitTestMode(
1623 event: *const ArkUI_UIInputEvent,
1624 mode: HitTestMode,
1625 ) -> i32;
1626 /// Get the value of the button type for mouse events.
1627 ///
1628 /// # Arguments
1629 ///
1630 /// * `event` - Represents a pointer to the current UI input event.
1631 ///
1632 /// # Returns
1633 ///
1634 /// * Return to the mouse button type, where <b>1</b> is the left button, <b>2</b> is the right button,
1635 /// <b>3</b> is the middle button, <b>4</b> is the back button, and <b>5</b> is the forward button.
1636 ///
1637 /// Available since API-level: 12
1638 #[cfg(feature = "api-12")]
1639 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1640 pub fn OH_ArkUI_MouseEvent_GetMouseButton(event: *const ArkUI_UIInputEvent) -> i32;
1641 /// Get the value of the mouse action type for mouse events.
1642 ///
1643 /// # Arguments
1644 ///
1645 /// * `event` - Represents a pointer to the current UI input event.
1646 ///
1647 /// # Returns
1648 ///
1649 /// * Returns the type of mouse action, where <b>1</b> represents button pressed,
1650 /// <b>2</b> represents button released, and <b>3</b> represents mouse movement.
1651 ///
1652 /// Available since API-level: 12
1653 #[cfg(feature = "api-12")]
1654 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1655 pub fn OH_ArkUI_MouseEvent_GetMouseAction(event: *const ArkUI_UIInputEvent) -> i32;
1656 /// Sets whether to stop event propagation. This API only applies to scenarios raw input events are received,
1657 /// such as when [`NODE_ON_TOUCH`] is used for touch event handling.
1658 /// It cannot be used with <b>ArkUI_UIInputEvent</b> objects obtained from gesture events
1659 /// through [`OH_ArkUI_GestureEvent_GetRawInputEvent`].
1660 ///
1661 /// # Arguments
1662 ///
1663 /// * `event` - Pointer to the current UI input event.
1664 ///
1665 /// * `stopPropagation` - Whether to stop event propagation.
1666 ///
1667 /// # Returns
1668 ///
1669 /// * Returns the status code of the execution. If 0 is returned, the setting is successful.
1670 /// If 401 is returned, the execution fails.
1671 /// The possible cause of the failure is that the event parameter is abnormal, such as a null pointer.
1672 ///
1673 /// Available since API-level: 12
1674 #[cfg(feature = "api-12")]
1675 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1676 pub fn OH_ArkUI_PointerEvent_SetStopPropagation(
1677 event: *const ArkUI_UIInputEvent,
1678 stopPropagation: bool,
1679 ) -> i32;
1680 /// Obtains the ID of device that triggers UI input event.
1681 ///
1682 /// # Arguments
1683 ///
1684 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1685 ///
1686 /// # Returns
1687 ///
1688 /// * Returns the device ID.
1689 ///
1690 /// Available since API-level: 14
1691 #[cfg(feature = "api-14")]
1692 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
1693 pub fn OH_ArkUI_UIInputEvent_GetDeviceId(event: *const ArkUI_UIInputEvent) -> i32;
1694 /// Obtains all keys that are pressed from UI input event. Only supports key events currently.
1695 ///
1696 /// # Arguments
1697 ///
1698 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1699 ///
1700 /// * `pressedKeyCodes` - Array of all keys that are pressed. You need to allocate the memory space.
1701 ///
1702 /// * `length` - Length of the passed pressedKeyCodes array (when used as an input parameter);
1703 /// number of the keys pressed (when used as an output parameter).
1704 ///
1705 /// # Returns
1706 ///
1707 /// * Returns the result code.
1708 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1709 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH`] if the giving buffer is not enough.
1710 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1711 ///
1712 /// Available since API-level: 14
1713 #[cfg(feature = "api-14")]
1714 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
1715 pub fn OH_ArkUI_UIInputEvent_GetPressedKeys(
1716 event: *const ArkUI_UIInputEvent,
1717 pressedKeyCodes: *mut i32,
1718 length: *mut i32,
1719 ) -> i32;
1720 /// Obtains the axis value of a focus axis event.
1721 ///
1722 /// # Arguments
1723 ///
1724 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1725 ///
1726 /// * `axis` - Axis type of the focus axis event.
1727 ///
1728 /// # Returns
1729 ///
1730 /// * Returns the axis value of the focus axis event; returns <b>0.0</b> if any parameter error occurs.
1731 ///
1732 /// Available since API-level: 15
1733 #[cfg(feature = "api-15")]
1734 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1735 pub fn OH_ArkUI_FocusAxisEvent_GetAxisValue(event: *const ArkUI_UIInputEvent, axis: i32)
1736 -> f64;
1737 /// Sets whether to prevent a focus axis event from bubbling up.
1738 ///
1739 /// # Arguments
1740 ///
1741 /// * `event` - Indicates the pointer to the current UI input event.
1742 ///
1743 /// * `stopPropagation` - Indicates whether to stop event propagation.
1744 ///
1745 /// # Returns
1746 ///
1747 /// * Returns the result code.
1748 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1749 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1750 ///
1751 /// Available since API-level: 15
1752 #[cfg(feature = "api-15")]
1753 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1754 pub fn OH_ArkUI_FocusAxisEvent_SetStopPropagation(
1755 event: *const ArkUI_UIInputEvent,
1756 stopPropagation: bool,
1757 ) -> i32;
1758 /// Obtains the width of the component hit by an event.
1759 ///
1760 /// # Arguments
1761 ///
1762 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1763 ///
1764 /// # Returns
1765 ///
1766 /// * Returns the width of the component hit by the event; returns <b>0.0f</b> if any parameter error occurs.
1767 ///
1768 /// Available since API-level: 17
1769 #[cfg(feature = "api-17")]
1770 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1771 pub fn OH_ArkUI_UIInputEvent_GetEventTargetWidth(event: *const ArkUI_UIInputEvent) -> f32;
1772 /// Obtains the height of the component hit by an event.
1773 ///
1774 /// # Arguments
1775 ///
1776 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1777 ///
1778 /// # Returns
1779 ///
1780 /// * Returns the height of the component hit by the event; returns <b>0.0f</b> if any parameter error occurs.
1781 ///
1782 /// Available since API-level: 17
1783 #[cfg(feature = "api-17")]
1784 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1785 pub fn OH_ArkUI_UIInputEvent_GetEventTargetHeight(event: *const ArkUI_UIInputEvent) -> f32;
1786 /// Obtains the X coordinate of the component hit by an event.
1787 ///
1788 /// # Arguments
1789 ///
1790 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1791 ///
1792 /// # Returns
1793 ///
1794 /// * Returns the X coordinate of the component hit by the event; returns <b>0.0f</b> if any parameter error occurs.
1795 ///
1796 /// Available since API-level: 17
1797 #[cfg(feature = "api-17")]
1798 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1799 pub fn OH_ArkUI_UIInputEvent_GetEventTargetPositionX(event: *const ArkUI_UIInputEvent) -> f32;
1800 /// Obtains the Y coordinate of the component hit by an event.
1801 ///
1802 /// # Arguments
1803 ///
1804 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1805 ///
1806 /// # Returns
1807 ///
1808 /// * Returns the Y coordinate of the component hit by the event;
1809 /// returns <b>0.0f</b> if any parameter error occurs.
1810 ///
1811 /// Available since API-level: 17
1812 #[cfg(feature = "api-17")]
1813 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1814 pub fn OH_ArkUI_UIInputEvent_GetEventTargetPositionY(event: *const ArkUI_UIInputEvent) -> f32;
1815 /// Obtains the global X coordinate of the component hit by an event.
1816 ///
1817 /// # Arguments
1818 ///
1819 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1820 ///
1821 /// # Returns
1822 ///
1823 /// * Returns the global X coordinate of the component hit by the event;
1824 /// returns <b>0.0f</b> if any parameter error occurs.
1825 ///
1826 /// Available since API-level: 17
1827 #[cfg(feature = "api-17")]
1828 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1829 pub fn OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX(
1830 event: *const ArkUI_UIInputEvent,
1831 ) -> f32;
1832 /// Obtains the global Y coordinate of the component hit by an event.
1833 ///
1834 /// # Arguments
1835 ///
1836 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1837 ///
1838 /// # Returns
1839 ///
1840 /// * Returns the global Y coordinate of the component hit by the event;
1841 /// returns <b>0.0f</b> if any parameter error occurs.
1842 ///
1843 /// Available since API-level: 17
1844 #[cfg(feature = "api-17")]
1845 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1846 pub fn OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY(
1847 event: *const ArkUI_UIInputEvent,
1848 ) -> f32;
1849 /// Checks whether the cursor is hovering over this component.
1850 ///
1851 /// # Arguments
1852 ///
1853 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1854 ///
1855 /// # Returns
1856 ///
1857 /// * Returns <b>true</b> if the cursor is hovering over the current component.
1858 /// Returns <b>false</b> if the cursor is not hovering over the current component.
1859 ///
1860 /// Available since API-level: 17
1861 #[cfg(feature = "api-17")]
1862 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1863 pub fn OH_ArkUI_HoverEvent_IsHovered(event: *const ArkUI_UIInputEvent) -> bool;
1864 /// Obtains the modifier key states for a UI input event.
1865 /// This API outputs the state of all modifier keys at the time of the event through the <b>keys</b> parameter.
1866 /// You can determine which keys are pressed by performing bitwise operations with the modifier key types defined
1867 /// in [`ArkUI_ModifierKeyName`].
1868 ///
1869 /// # Arguments
1870 ///
1871 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1872 ///
1873 /// * `keys` - Pointer to a variable where the current combination of pressed modifier keys will be returned.
1874 /// The application can use bitwise operations to determine the state of each modifier key.
1875 ///
1876 /// # Returns
1877 ///
1878 /// * Result code.
1879 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1880 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1881 ///
1882 /// Available since API-level: 17
1883 #[cfg(feature = "api-17")]
1884 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1885 pub fn OH_ArkUI_UIInputEvent_GetModifierKeyStates(
1886 event: *const ArkUI_UIInputEvent,
1887 keys: *mut u64,
1888 ) -> i32;
1889 /// Obtains the press time of a specified touch point. This API is effective only for touch events.
1890 ///
1891 /// # Arguments
1892 ///
1893 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1894 ///
1895 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1896 ///
1897 /// # Returns
1898 ///
1899 /// * Returns the press time of the specific touch point; returns <b>0</b> if any parameter error occurs.
1900 ///
1901 /// Available since API-level: 15
1902 #[cfg(feature = "api-15")]
1903 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1904 pub fn OH_ArkUI_PointerEvent_GetPressedTimeByIndex(
1905 event: *const ArkUI_UIInputEvent,
1906 pointerIndex: u32,
1907 ) -> i64;
1908 /// Obtains the movement increment of the mouse device along the X-axis in a two-dimensional plane.
1909 /// Its value represents the raw movement data from the mouse device, expressed in units of physical
1910 /// distance in the real world. The reported value is determined by the hardware itself and does not
1911 /// correspond to the physical or logical pixels on the screen.
1912 ///
1913 /// # Arguments
1914 ///
1915 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1916 ///
1917 /// # Returns
1918 ///
1919 /// * Returns the x-axis offset of the mouse position relative to the position in the previously reported
1920 /// mouse event; returns <b>0.0f</b> if any parameter error occurs.
1921 ///
1922 /// Available since API-level: 15
1923 #[cfg(feature = "api-15")]
1924 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1925 pub fn OH_ArkUI_MouseEvent_GetRawDeltaX(event: *const ArkUI_UIInputEvent) -> f32;
1926 /// Obtains the movement increment of the mouse device along the Y-axis in a two-dimensional plane.
1927 /// Its value represents the raw movement data from the mouse device, expressed in units of physical
1928 /// distance in the real world. The reported value is determined by the hardware itself and does not
1929 /// correspond to the physical or logical pixels on the screen.
1930 ///
1931 /// # Arguments
1932 ///
1933 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1934 ///
1935 /// # Returns
1936 ///
1937 /// * Returns the y-axis offset of the mouse position relative to the position in the previously reported
1938 /// mouse event; returns <b>0.0f</b> if any parameter error occurs.
1939 ///
1940 /// Available since API-level: 15
1941 #[cfg(feature = "api-15")]
1942 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1943 pub fn OH_ArkUI_MouseEvent_GetRawDeltaY(event: *const ArkUI_UIInputEvent) -> f32;
1944 /// Obtains the pressed buttons from a mouse event.
1945 ///
1946 /// # Arguments
1947 ///
1948 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1949 ///
1950 /// * `pressedButtons` - Array of the pressed buttons. An int array must be created beforehand to store the pressed
1951 /// buttons.
1952 ///
1953 /// * `length` - Length of the passed pressedButtons array (when used as an input parameter);
1954 /// number of the buttons pressed (when used as an output parameter).
1955 ///
1956 /// # Returns
1957 ///
1958 /// * Returns the result code.
1959 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1960 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] if the given buffer size is insufficient.
1961 ///
1962 /// Available since API-level: 15
1963 #[cfg(feature = "api-15")]
1964 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1965 pub fn OH_ArkUI_MouseEvent_GetPressedButtons(
1966 event: *const ArkUI_UIInputEvent,
1967 pressedButtons: *mut i32,
1968 length: *mut i32,
1969 ) -> i32;
1970 /// Obtains the ID of the screen where the UI input event occurs.
1971 ///
1972 /// # Arguments
1973 ///
1974 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1975 ///
1976 /// # Returns
1977 ///
1978 /// * Returns the screen ID; returns <b>0</b> if any parameter error occurs.
1979 ///
1980 /// Available since API-level: 15
1981 #[cfg(feature = "api-15")]
1982 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1983 pub fn OH_ArkUI_UIInputEvent_GetTargetDisplayId(event: *const ArkUI_UIInputEvent) -> i32;
1984 /// Sets whether to enable axis event propagation (bubbling). By default, axis events do not bubble and are
1985 /// only sent to the first component that can respond to axis events. You can enable axis event bubbling
1986 /// to allow the current event to be passed to the next ancestor component in the response chain
1987 /// that can handle axis events.
1988 /// This API cannot be used on axis events obtained from gesture events.
1989 ///
1990 /// # Arguments
1991 ///
1992 /// * `event` - Pointer to the UI input event.
1993 ///
1994 /// * `propagation` - Whether to enable event propagation.
1995 ///
1996 /// # Returns
1997 ///
1998 /// * Result code.
1999 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2000 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2001 ///
2002 /// Available since API-level: 17
2003 #[cfg(feature = "api-17")]
2004 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
2005 pub fn OH_ArkUI_AxisEvent_SetPropagation(
2006 event: *const ArkUI_UIInputEvent,
2007 propagation: bool,
2008 ) -> i32;
2009 /// Obtains the scroll step coefficient for a wheel-based axis event.
2010 /// This API returns the user-configured scroll scale factor factor.
2011 ///
2012 /// # Arguments
2013 ///
2014 /// * `event` - Pointer to the UI input event.
2015 ///
2016 /// # Returns
2017 ///
2018 /// * Scroll step configuration of the mouse wheel axis event.
2019 ///
2020 /// Available since API-level: 17
2021 #[cfg(feature = "api-17")]
2022 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
2023 pub fn OH_ArkUI_AxisEvent_GetScrollStep(event: *const ArkUI_UIInputEvent) -> i32;
2024 /// Creates a cloned event pointer based on an event pointer. This API is effective only for touch events.
2025 ///
2026 /// # Arguments
2027 ///
2028 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2029 ///
2030 /// * `clonedEvent` - Pointer to the cloned <b>ArkUI_UIInputEvent</b> object.
2031 ///
2032 /// # Returns
2033 ///
2034 /// * Result code.
2035 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2036 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2037 ///
2038 /// Available since API-level: 15
2039 #[cfg(feature = "api-15")]
2040 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2041 pub fn OH_ArkUI_PointerEvent_CreateClonedEvent(
2042 event: *const ArkUI_UIInputEvent,
2043 clonedEvent: *mut *mut ArkUI_UIInputEvent,
2044 ) -> i32;
2045 /// Destroys a cloned event pointer.
2046 ///
2047 /// # Arguments
2048 ///
2049 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2050 ///
2051 /// # Returns
2052 ///
2053 /// * Returns the result code.
2054 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2055 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2056 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2057 /// cloned event pointer.
2058 ///
2059 /// Available since API-level: 15
2060 #[cfg(feature = "api-15")]
2061 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2062 pub fn OH_ArkUI_PointerEvent_DestroyClonedEvent(event: *const ArkUI_UIInputEvent) -> i32;
2063 /// Sets the X and Y coordinates of a cloned event relative to the upper left corner of the current component.
2064 ///
2065 /// # Arguments
2066 ///
2067 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2068 ///
2069 /// * `x` - X coordinate of the event relative to the upper left corner of the current component.
2070 ///
2071 /// * `y` - Y coordinate of the event relative to the upper left corner of the current component.
2072 ///
2073 /// # Returns
2074 ///
2075 /// * Returns the result code.
2076 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2077 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2078 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2079 /// cloned event pointer.
2080 ///
2081 /// Available since API-level: 15
2082 #[cfg(feature = "api-15")]
2083 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2084 pub fn OH_ArkUI_PointerEvent_SetClonedEventLocalPosition(
2085 event: *const ArkUI_UIInputEvent,
2086 x: f32,
2087 y: f32,
2088 ) -> i32;
2089 /// Sets the X and Y coordinates of a specific contact point of a cloned event relative to the upper left corner
2090 /// of the current component.
2091 ///
2092 /// # Arguments
2093 ///
2094 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2095 ///
2096 /// * `x` - X coordinate of the event relative to the upper left corner of the current component.
2097 ///
2098 /// * `y` - Y coordinate of the event relative to the upper left corner of the current component.
2099 ///
2100 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
2101 ///
2102 /// # Returns
2103 ///
2104 /// * Returns the result code.
2105 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2106 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2107 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2108 /// cloned event pointer.
2109 ///
2110 /// Available since API-level: 15
2111 #[cfg(feature = "api-15")]
2112 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2113 pub fn OH_ArkUI_PointerEvent_SetClonedEventLocalPositionByIndex(
2114 event: *const ArkUI_UIInputEvent,
2115 x: f32,
2116 y: f32,
2117 pointerIndex: i32,
2118 ) -> i32;
2119 /// Sets the action type of a cloned event.
2120 ///
2121 /// # Arguments
2122 ///
2123 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2124 ///
2125 /// * `actionType` - Action type of the cloned event.
2126 ///
2127 /// # Returns
2128 ///
2129 /// * Returns the result code.
2130 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2131 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2132 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2133 /// cloned event pointer.
2134 ///
2135 /// Available since API-level: 15
2136 #[cfg(feature = "api-15")]
2137 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2138 pub fn OH_ArkUI_PointerEvent_SetClonedEventActionType(
2139 event: *const ArkUI_UIInputEvent,
2140 actionType: i32,
2141 ) -> i32;
2142 /// Sets the touch point ID of a cloned pointer event.
2143 ///
2144 /// # Arguments
2145 ///
2146 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2147 ///
2148 /// * `fingerId` - ID of the touch point that triggers the event.
2149 ///
2150 /// # Returns
2151 ///
2152 /// * Returns the result code.
2153 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2154 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2155 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2156 /// cloned event pointer.
2157 ///
2158 /// Available since API-level: 15
2159 #[cfg(feature = "api-15")]
2160 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2161 pub fn OH_ArkUI_PointerEvent_SetClonedEventChangedFingerId(
2162 event: *const ArkUI_UIInputEvent,
2163 fingerId: i32,
2164 ) -> i32;
2165 /// Sets the touch point ID of a specific contact point of a cloned event.
2166 ///
2167 /// # Arguments
2168 ///
2169 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2170 ///
2171 /// * `fingerId` - Touch point ID of the specific contact point.
2172 ///
2173 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
2174 ///
2175 /// # Returns
2176 ///
2177 /// * Returns the result code.
2178 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2179 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2180 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2181 /// cloned event pointer.
2182 ///
2183 /// Available since API-level: 15
2184 #[cfg(feature = "api-15")]
2185 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2186 pub fn OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex(
2187 event: *const ArkUI_UIInputEvent,
2188 fingerId: i32,
2189 pointerIndex: i32,
2190 ) -> i32;
2191 /// Posts a cloned event to a specific node.
2192 ///
2193 /// # Arguments
2194 ///
2195 /// * `node` - Target node.
2196 ///
2197 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
2198 ///
2199 /// # Returns
2200 ///
2201 /// * Returns the result code.
2202 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2203 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2204 /// Returns [`ARKUI_ERROR_CODE_NOT_CLONED_POINTER_EVENT`] if the input event pointer is not a
2205 /// cloned event pointer.
2206 /// Returns [`ARKUI_ERROR_CODE_POST_CLONED_COMPONENT_STATUS_ABNORMAL`]
2207 /// if the component status abnormal.
2208 /// Returns [`ARKUI_ERROR_CODE_POST_CLONED_NO_COMPONENT_HIT_TO_RESPOND_TO_THE_EVENT`]
2209 /// if no component hit to response to the event.
2210 ///
2211 /// Available since API-level: 15
2212 #[cfg(feature = "api-15")]
2213 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
2214 pub fn OH_ArkUI_PointerEvent_PostClonedEvent(
2215 node: ArkUI_NodeHandle,
2216 event: *const ArkUI_UIInputEvent,
2217 ) -> i32;
2218 /// Use this method to obtain the execution status of the latest UI input related method.
2219 ///
2220 /// In most cases, this method is unnecessary unless you need to determine if the return value indicates an error.
2221 /// Here's an example of usage: For return values like float (where 0.0 doesn't indicate an error), use GetLatestStatus
2222 /// to confirm if an error occurred.
2223 /// float x = OH_ArkUI_PointerEvent_GetX(event);
2224 /// if (ARKUI_ERROR_CODE_NO_ERROR != OH_ArkUI_UIInputEvent_GetLatestStatus()) {
2225 /// // error
2226 /// return;
2227 /// }
2228 /// Note: The system clears the status of the previous function call each time a UIInput-related function is executed,
2229 /// ensuring you always get the latest status.
2230 ///
2231 ///
2232 /// # Returns
2233 ///
2234 /// * Returns the ArkUI_ErrorCode.
2235 ///
2236 /// Available since API-level: 20
2237 #[cfg(feature = "api-20")]
2238 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
2239 pub fn OH_ArkUI_UIInputEvent_GetLatestStatus() -> ArkUiResult;
2240 /// Obtains the coasting axis event from a component event, valid event only can be
2241 /// fetched only when user flings on the touchpad with two fingers and any components register
2242 /// NODE_ON_COASTING_AXIS_EVENT exist under the pointer location.
2243 /// Call this method after the [`ArkUI_UIInputEvent`] object is obtained from the [`ArkUI_NodeEvent`] object.
2244 ///
2245 /// # Arguments
2246 ///
2247 /// * `event` - Indicates the pointer to the UI input event.
2248 ///
2249 /// # Returns
2250 ///
2251 /// * Returns the pointer to the coasting axis event, return null if no any coasting axis event occurs.
2252 ///
2253 /// Available since API-level: 22
2254 #[cfg(feature = "api-22")]
2255 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2256 pub fn OH_ArkUI_UIInputEvent_GetCoastingAxisEvent(
2257 event: *mut ArkUI_UIInputEvent,
2258 ) -> *mut ArkUI_CoastingAxisEvent;
2259 /// Obtains the time when this coasting event occurs.
2260 ///
2261 /// # Arguments
2262 ///
2263 /// * `event` - Indicates the pointer to the coasting axis event.
2264 ///
2265 /// # Returns
2266 ///
2267 /// * Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
2268 ///
2269 ///
2270 /// Available since API-level: 22
2271 #[cfg(feature = "api-22")]
2272 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2273 pub fn OH_ArkUI_CoastingAxisEvent_GetEventTime(event: *mut ArkUI_CoastingAxisEvent) -> i64;
2274 /// Obtains the coasting phase when this coasting event occurs.
2275 ///
2276 /// # Arguments
2277 ///
2278 /// * `event` - Indicates the pointer to the coasting axis event.
2279 ///
2280 /// # Returns
2281 ///
2282 /// * Returns the event phase, see [`ArkUI_CoastingAxisEventPhase`];
2283 /// returns <b>ARKUI_COASTING_AXIS_EVENT_PHASE_NONE</b> if any parameter error occurs.
2284 ///
2285 ///
2286 /// Available since API-level: 22
2287 #[cfg(feature = "api-22")]
2288 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2289 pub fn OH_ArkUI_CoastingAxisEvent_GetPhase(
2290 event: *mut ArkUI_CoastingAxisEvent,
2291 ) -> ArkUI_CoastingAxisEventPhase;
2292 /// Obtains the horizontal delta value.
2293 ///
2294 /// # Arguments
2295 ///
2296 /// * `event` - Indicates the pointer to the coasting axis event.
2297 ///
2298 /// # Returns
2299 ///
2300 /// * Returns delta X value, count in PX; returns <b>0</b> if any parameter error occurs.
2301 ///
2302 ///
2303 /// Available since API-level: 22
2304 #[cfg(feature = "api-22")]
2305 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2306 pub fn OH_ArkUI_CoastingAxisEvent_GetDeltaX(event: *mut ArkUI_CoastingAxisEvent) -> f32;
2307 /// Obtains the vertical delta value.
2308 ///
2309 /// # Arguments
2310 ///
2311 /// * `event` - Indicates the pointer to the coasting axis event.
2312 ///
2313 /// # Returns
2314 ///
2315 /// * Returns delta Y value, count in PX; returns <b>0</b> if any parameter error occurs.
2316 ///
2317 ///
2318 /// Available since API-level: 22
2319 #[cfg(feature = "api-22")]
2320 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2321 pub fn OH_ArkUI_CoastingAxisEvent_GetDeltaY(event: *mut ArkUI_CoastingAxisEvent) -> f32;
2322 /// Sets whether to enable coasting axis event propagation.
2323 ///
2324 /// # Arguments
2325 ///
2326 /// * `event` - Pointer to the coasting axis event.
2327 ///
2328 /// * `propagation` - Whether to enable event propagation.
2329 ///
2330 /// # Returns
2331 ///
2332 /// * Returns the result code.
2333 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
2334 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
2335 ///
2336 /// Available since API-level: 22
2337 #[cfg(feature = "api-22")]
2338 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2339 pub fn OH_ArkUI_CoastingAxisEvent_SetPropagation(
2340 event: *mut ArkUI_CoastingAxisEvent,
2341 propagation: bool,
2342 ) -> i32;
2343 /// Obtains touch test info item list in the touch test info.
2344 ///
2345 /// # Arguments
2346 ///
2347 /// * `info` - Indicates the pointer to a touch test info.
2348 ///
2349 /// * `array` - Indicates the pointer to the array of touch test info list.
2350 ///
2351 /// * `size` - Indicates the size of the array of touch test info list.
2352 ///
2353 /// # Returns
2354 ///
2355 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
2356 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
2357 ///
2358 /// Available since API-level: 22
2359 #[cfg(feature = "api-22")]
2360 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2361 pub fn OH_ArkUI_TouchTestInfo_GetTouchTestInfoList(
2362 info: *mut ArkUI_TouchTestInfo,
2363 array: *mut ArkUI_TouchTestInfoItemArray,
2364 size: *mut i32,
2365 ) -> ArkUiResult;
2366 /// Obtains the X coordinate relative to the upper left corner of the child component from the touch test
2367 /// info item.
2368 ///
2369 /// # Arguments
2370 ///
2371 /// * `info` - Indicates the pointer to the touch test info item.
2372 ///
2373 /// # Returns
2374 ///
2375 /// * Returns the X coordinate relative to the upper left corner of the parent component.
2376 /// returns <b>0</b> if any parameter error occurs.
2377 ///
2378 /// Available since API-level: 22
2379 #[cfg(feature = "api-22")]
2380 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2381 pub fn OH_ArkUI_TouchTestInfoItem_GetX(info: *const ArkUI_TouchTestInfoItem) -> f32;
2382 /// Obtains the Y coordinate relative to the upper left corner of the child component from the touch test
2383 /// info item.
2384 ///
2385 /// # Arguments
2386 ///
2387 /// * `info` - Indicates the pointer to the touch test info item.
2388 ///
2389 /// # Returns
2390 ///
2391 /// * Returns the Y coordinate relative to the upper left corner of the parent component.
2392 /// returns <b>0</b> if any parameter error occurs.
2393 ///
2394 /// Available since API-level: 22
2395 #[cfg(feature = "api-22")]
2396 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2397 pub fn OH_ArkUI_TouchTestInfoItem_GetY(info: *const ArkUI_TouchTestInfoItem) -> f32;
2398 /// Obtains the X coordinate relative to the upper left corner of the current application window from the touch
2399 /// test info item.
2400 ///
2401 /// # Arguments
2402 ///
2403 /// * `info` - Indicates the pointer to the touch test info item.
2404 ///
2405 /// # Returns
2406 ///
2407 /// * Returns the X coordinate relative to the upper left corner of the current application window.
2408 /// returns <b>0.0f</b> if any parameter error occurs.
2409 ///
2410 /// Available since API-level: 22
2411 #[cfg(feature = "api-22")]
2412 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2413 pub fn OH_ArkUI_TouchTestInfoItem_GetWindowX(info: *const ArkUI_TouchTestInfoItem) -> f32;
2414 /// Obtains the Y coordinate relative to the upper left corner of the current application window from the touch
2415 /// test info item.
2416 ///
2417 /// # Arguments
2418 ///
2419 /// * `info` - Indicates the pointer to the touch test info item.
2420 ///
2421 /// # Returns
2422 ///
2423 /// * Returns the Y coordinate relative to the upper left corner of the current application window.
2424 /// returns <b>0.0f</b> if any parameter error occurs.
2425 ///
2426 /// Available since API-level: 22
2427 #[cfg(feature = "api-22")]
2428 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2429 pub fn OH_ArkUI_TouchTestInfoItem_GetWindowY(info: *const ArkUI_TouchTestInfoItem) -> f32;
2430 /// Obtains the X coordinate relative to the upper left corner of the parent component from the touch test
2431 /// info item.
2432 ///
2433 /// # Arguments
2434 ///
2435 /// * `info` - Indicates the pointer to the touch test info item.
2436 ///
2437 /// # Returns
2438 ///
2439 /// * Returns the X coordinate relative to the upper left corner of the parent component.
2440 /// returns <b>0</b> if any parameter error occurs.
2441 ///
2442 /// Available since API-level: 22
2443 #[cfg(feature = "api-22")]
2444 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2445 pub fn OH_ArkUI_TouchTestInfoItem_GetXRelativeToParent(
2446 info: *const ArkUI_TouchTestInfoItem,
2447 ) -> f32;
2448 /// Obtains the Y coordinate relative to the upper left corner of the parent component from the touch test
2449 /// info item.
2450 ///
2451 /// # Arguments
2452 ///
2453 /// * `info` - Indicates the pointer to the touch test info item.
2454 ///
2455 /// # Returns
2456 ///
2457 /// * Returns the Y coordinate relative to the upper left corner of the parent component.
2458 /// returns <b>0</b> if any parameter error occurs.
2459 ///
2460 /// Available since API-level: 22
2461 #[cfg(feature = "api-22")]
2462 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2463 pub fn OH_ArkUI_TouchTestInfoItem_GetYRelativeToParent(
2464 info: *const ArkUI_TouchTestInfoItem,
2465 ) -> f32;
2466 /// Obtains the sub component's frame rect info from the touch test info item.
2467 ///
2468 /// # Arguments
2469 ///
2470 /// * `info` - Indicates the pointer to the touch test info item.
2471 ///
2472 /// * `childRect` - Indicates the pointer to the child frame rect.
2473 ///
2474 /// # Returns
2475 ///
2476 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
2477 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
2478 ///
2479 /// Available since API-level: 22
2480 #[cfg(feature = "api-22")]
2481 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2482 pub fn OH_ArkUI_TouchTestInfoItem_GetChildRect(
2483 info: *const ArkUI_TouchTestInfoItem,
2484 childRect: *mut ArkUI_Rect,
2485 ) -> ArkUiResult;
2486 /// Obtains the sub component's name from the touch test info item.
2487 ///
2488 /// # Arguments
2489 ///
2490 /// * `info` - Indicates the pointer to the touch test info item.
2491 ///
2492 /// * `buffer` - Indicates the buffer.
2493 ///
2494 /// * `bufferSize` - Indicates the buffer size.
2495 ///
2496 /// # Returns
2497 ///
2498 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
2499 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
2500 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH`] if the buffer is not large enough.
2501 ///
2502 /// Available since API-level: 22
2503 #[cfg(feature = "api-22")]
2504 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2505 pub fn OH_ArkUI_TouchTestInfoItem_GetChildId(
2506 info: *const ArkUI_TouchTestInfoItem,
2507 buffer: *mut ::core::ffi::c_char,
2508 bufferSize: i32,
2509 ) -> ArkUiResult;
2510 /// Sets the touch test strategy, that is, how the component and the sub components behave during hit testing.
2511 ///
2512 /// # Arguments
2513 ///
2514 /// {pointer} info Indicates the pointer to a touch test info.
2515 ///
2516 /// {ArkUI_TouchTestStrategy} strategy The touch test strategy.
2517 ///
2518 /// # Returns
2519 ///
2520 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
2521 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
2522 ///
2523 /// Available since API-level: 22
2524 #[cfg(feature = "api-22")]
2525 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2526 pub fn OH_ArkUI_TouchTestInfo_SetTouchResultStrategy(
2527 info: *mut ArkUI_TouchTestInfo,
2528 strategy: ArkUI_TouchTestStrategy,
2529 ) -> ArkUiResult;
2530 /// Sets the sub component's name, that is, which sub components need to be effected during hit testing.
2531 ///
2532 /// # Arguments
2533 ///
2534 /// {pointer} info Indicates the pointer to a touch test info.
2535 ///
2536 /// {pointer} id The sub component's name.
2537 ///
2538 /// # Returns
2539 ///
2540 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
2541 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
2542 ///
2543 /// Available since API-level: 22
2544 #[cfg(feature = "api-22")]
2545 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
2546 pub fn OH_ArkUI_TouchTestInfo_SetTouchResultId(
2547 info: *mut ArkUI_TouchTestInfo,
2548 id: *const ::core::ffi::c_char,
2549 ) -> ArkUiResult;
2550}