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#[cfg(feature = "api-12")]
19#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
20impl ArkUI_UIInputEvent_Type {
21 pub const ARKUI_UIINPUTEVENT_TYPE_UNKNOWN: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(0);
22 pub const ARKUI_UIINPUTEVENT_TYPE_TOUCH: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(1);
23 pub const ARKUI_UIINPUTEVENT_TYPE_AXIS: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(2);
24 /// Mouse event.
25 pub const ARKUI_UIINPUTEVENT_TYPE_MOUSE: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(3);
26 /// key event.
27 ///
28 ///
29 /// Available since API-level: 20
30 #[cfg(feature = "api-20")]
31 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
32 pub const ARKUI_UIINPUTEVENT_TYPE_KEY: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(4);
33}
34#[repr(transparent)]
35/// Enumerates the UI input event types.
36///
37///
38/// Available since API-level: 12
39#[cfg(feature = "api-12")]
40#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
41#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
42pub struct ArkUI_UIInputEvent_Type(pub ::core::ffi::c_uint);
43#[cfg(feature = "api-12")]
44#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
45impl HitTestMode {
46 /// Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from
47 /// the hit test.
48 pub const HTM_DEFAULT: HitTestMode = HitTestMode(0);
49 /// The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit
50 /// test.
51 pub const HTM_BLOCK: HitTestMode = HitTestMode(1);
52 /// Both the node and its child node respond to the hit test of a touch event, and its sibling node is also
53 /// considered during the hit test.
54 pub const HTM_TRANSPARENT: HitTestMode = HitTestMode(2);
55 /// The node does not respond to the hit test of a touch event, but its child node and sibling node are considered
56 /// during the hit test.
57 pub const HTM_NONE: HitTestMode = HitTestMode(3);
58 /// The node and its child nodes participate in hit tests, while blocking hit tests for all sibling nodes and parent
59 /// nodes with lower priority.
60 ///
61 ///
62 /// Available since API-level: 20
63 #[cfg(feature = "api-20")]
64 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
65 pub const HTM_BLOCK_HIERARCHY: HitTestMode = HitTestMode(4);
66 /// The node does not respond to hit tests, and none of its descendants (including children and grandchildren)
67 /// participate in hit tests either.
68 ///
69 ///
70 /// Available since API-level: 20
71 #[cfg(feature = "api-20")]
72 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
73 pub const HTM_BLOCK_DESCENDANTS: HitTestMode = HitTestMode(5);
74}
75#[repr(transparent)]
76/// Enumerates the hit test modes.
77///
78///
79/// Available since API-level: 12
80#[cfg(feature = "api-12")]
81#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
82#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
83pub struct HitTestMode(pub ::core::ffi::c_uint);
84#[cfg(feature = "api-12")]
85#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
86impl ::core::ops::BitOr<ArkUI_ModifierKeyName> for ArkUI_ModifierKeyName {
87 type Output = Self;
88 #[inline]
89 fn bitor(self, other: Self) -> Self {
90 ArkUI_ModifierKeyName(self.0 | other.0)
91 }
92}
93#[cfg(feature = "api-12")]
94#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
95impl ::core::ops::BitOrAssign for ArkUI_ModifierKeyName {
96 #[inline]
97 fn bitor_assign(&mut self, rhs: ArkUI_ModifierKeyName) {
98 self.0 |= rhs.0;
99 }
100}
101#[cfg(feature = "api-12")]
102#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
103impl ::core::ops::BitAnd<ArkUI_ModifierKeyName> for ArkUI_ModifierKeyName {
104 type Output = Self;
105 #[inline]
106 fn bitand(self, other: Self) -> Self {
107 ArkUI_ModifierKeyName(self.0 & other.0)
108 }
109}
110#[cfg(feature = "api-12")]
111#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
112impl ::core::ops::BitAndAssign for ArkUI_ModifierKeyName {
113 #[inline]
114 fn bitand_assign(&mut self, rhs: ArkUI_ModifierKeyName) {
115 self.0 &= rhs.0;
116 }
117}
118#[cfg(feature = "api-12")]
119#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
120impl ArkUI_ModifierKeyName {
121 /// Ctrl.
122 pub const ARKUI_MODIFIER_KEY_CTRL: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(1);
123 /// Shift.
124 pub const ARKUI_MODIFIER_KEY_SHIFT: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(2);
125 /// Alt.
126 pub const ARKUI_MODIFIER_KEY_ALT: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(4);
127 /// Fn.
128 pub const ARKUI_MODIFIER_KEY_FN: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(8);
129}
130#[repr(transparent)]
131/// Defines an enum for modifier keys.
132///
133///
134/// Available since API-level: 12
135#[cfg(feature = "api-12")]
136#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
137#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
138pub struct ArkUI_ModifierKeyName(pub ::core::ffi::c_uint);
139/// ABS_X.
140#[cfg(feature = "api-15")]
141#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
142pub const UI_FOCUS_AXIS_EVENT_ABS_X: _bindgen_ty_6 = _bindgen_ty_6(0);
143/// ABS_Y.
144#[cfg(feature = "api-15")]
145#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
146pub const UI_FOCUS_AXIS_EVENT_ABS_Y: _bindgen_ty_6 = _bindgen_ty_6(1);
147/// ABS_Z.
148#[cfg(feature = "api-15")]
149#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
150pub const UI_FOCUS_AXIS_EVENT_ABS_Z: _bindgen_ty_6 = _bindgen_ty_6(2);
151/// ABS_RZ.
152#[cfg(feature = "api-15")]
153#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
154pub const UI_FOCUS_AXIS_EVENT_ABS_RZ: _bindgen_ty_6 = _bindgen_ty_6(3);
155/// ABS_GAS.
156#[cfg(feature = "api-15")]
157#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
158pub const UI_FOCUS_AXIS_EVENT_ABS_GAS: _bindgen_ty_6 = _bindgen_ty_6(4);
159/// ABS_BRAKE.
160#[cfg(feature = "api-15")]
161#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
162pub const UI_FOCUS_AXIS_EVENT_ABS_BRAKE: _bindgen_ty_6 = _bindgen_ty_6(5);
163/// ABS_HAT0X.
164#[cfg(feature = "api-15")]
165#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
166pub const UI_FOCUS_AXIS_EVENT_ABS_HAT0X: _bindgen_ty_6 = _bindgen_ty_6(6);
167/// ABS_HAT0Y.
168#[cfg(feature = "api-15")]
169#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
170pub const UI_FOCUS_AXIS_EVENT_ABS_HAT0Y: _bindgen_ty_6 = _bindgen_ty_6(7);
171#[repr(transparent)]
172/// Defines an enum for the axis types for focus axis events.
173///
174///
175/// Available since API-level: 15
176#[cfg(feature = "api-15")]
177#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
178#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
179pub struct _bindgen_ty_6(pub ::core::ffi::c_uint);
180#[cfg(feature = "api-15")]
181#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
182impl ArkUI_InteractionHand {
183 /// Unknown.
184 pub const ARKUI_EVENT_HAND_NONE: ArkUI_InteractionHand = ArkUI_InteractionHand(0);
185 /// Left hand.
186 pub const ARKUI_EVENT_HAND_LEFT: ArkUI_InteractionHand = ArkUI_InteractionHand(1);
187 /// Right hand.
188 pub const ARKUI_EVENT_HAND_RIGHT: ArkUI_InteractionHand = ArkUI_InteractionHand(2);
189}
190#[repr(transparent)]
191/// Defines whether the touch event is from the left or right hand.
192///
193///
194/// Available since API-level: 15
195#[cfg(feature = "api-15")]
196#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
197#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
198pub struct ArkUI_InteractionHand(pub ::core::ffi::c_uint);
199/// The axis event is abnormal.
200#[cfg(feature = "api-15")]
201#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
202pub const UI_AXIS_EVENT_ACTION_NONE: _bindgen_ty_7 = _bindgen_ty_7(0);
203/// The axis event begins.
204#[cfg(feature = "api-15")]
205#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
206pub const UI_AXIS_EVENT_ACTION_BEGIN: _bindgen_ty_7 = _bindgen_ty_7(1);
207/// The axis event is updated.
208#[cfg(feature = "api-15")]
209#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
210pub const UI_AXIS_EVENT_ACTION_UPDATE: _bindgen_ty_7 = _bindgen_ty_7(2);
211/// The axis event ends.
212#[cfg(feature = "api-15")]
213#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
214pub const UI_AXIS_EVENT_ACTION_END: _bindgen_ty_7 = _bindgen_ty_7(3);
215/// The axis event is canceled.
216#[cfg(feature = "api-15")]
217#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
218pub const UI_AXIS_EVENT_ACTION_CANCEL: _bindgen_ty_7 = _bindgen_ty_7(4);
219#[repr(transparent)]
220/// Enumerates the action types for axis events.
221///
222///
223/// Available since API-level: 15
224#[cfg(feature = "api-15")]
225#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
226#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
227pub struct _bindgen_ty_7(pub ::core::ffi::c_uint);
228extern "C" {
229 /// Obtains the type of a UI input event.
230 ///
231 /// Before accessing an <b>ArkUI_UIInputEvent</b> pointer, use this API to determine the type of the input event.
232 /// This API returns a value from the [`ArkUI_UIInputEvent_Type`] enum. It helps ensure compatibility with subsequent
233 /// accessors. For example, if the event is a touch event,
234 /// which is directional, you can use OH_ArkUI_UIInputEvent_GetXXX or OH_ArkUI_PointerEvent_GetXXX for access.
235 /// Using OH_ArkUI_KeyEvent_GetXXX to access the event may produce undefined behavior.
236 ///
237 /// For unsupported event types, this API returns the default value <b>0</b>.
238 ///
239 /// # Arguments
240 ///
241 /// * `event` - Pointer to the current UI input event.
242 ///
243 /// # Returns
244 ///
245 /// * Returns the type of the current UI input event; returns <b>0</b> if any parameter error occurs.
246 ///
247 /// Available since API-level: 12
248 #[cfg(feature = "api-12")]
249 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
250 pub fn OH_ArkUI_UIInputEvent_GetType(event: *const ArkUI_UIInputEvent) -> i32;
251 /// Obtains the action type of this UI input event.
252 ///
253 /// The action type defines the phase of a basic event (for example, start or end) and characterizes its behavior,
254 /// such as touch down or touch up Action types are specific to the event category:
255 /// UI_TOUCH_EVENT_ACTION_XXX for touch events and UI_MOUSE_EVENT_ACTION_XXX for mouse events.
256 ///
257 ///
258 /// **Note:** 1. For axis events, use [`OH_ArkUI_AxisEvent_GetAxisAction`] to obtain the action type,
259 /// which returns UI_AXIS_EVENT_ACTION_XXX.
260 /// 2. For key events, use [`OH_ArkUI_KeyEvent_GetType`] instead.
261 ///
262 /// # Arguments
263 ///
264 /// * `event` - Pointer to the current UI input event.
265 ///
266 /// # Returns
267 ///
268 /// * Returns the action type of the current UI input event; returns <b>-1</b> if any parameter error occurs.
269 ///
270 /// Available since API-level: 12
271 #[cfg(feature = "api-12")]
272 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
273 pub fn OH_ArkUI_UIInputEvent_GetAction(event: *const ArkUI_UIInputEvent) -> i32;
274 /// Obtains the source type of a UI input event.
275 ///
276 /// The source represents the physical device, such as a touchscreen or mouse device, that generates the event.
277 /// It is defined by the UI_INPUT_EVENT_SOURCE_TYPE_XXX enum.
278 /// This is different from the input tool, which is the device used to interact with the source, for example,
279 /// a finger or stylus. However, in certain cases, the input source and the input tool can be the same.
280 /// For example, a mouse device acts as both the source and tool for click events.
281 ///
282 ///
283 /// **Note:** For key events, obtaining the source type is not supported, and in such cases,
284 /// the API will return an <b>unknown</b> value.
285 ///
286 /// # Arguments
287 ///
288 /// * `event` - Pointer to the current UI input event.
289 ///
290 /// # Returns
291 ///
292 /// * Returns the source type of the current UI input event.
293 ///
294 /// Available since API-level: 12
295 #[cfg(feature = "api-12")]
296 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
297 pub fn OH_ArkUI_UIInputEvent_GetSourceType(event: *const ArkUI_UIInputEvent) -> i32;
298 /// Obtains the tool type of a UI input event.
299 ///
300 /// The input tool is the device used to interact with the input source, such as a finger or stylus.
301 /// It is defined by the UI_INPUT_EVENT_TOOL_TYPE_XXX enum.
302 /// These tools do not produce events directly but drive the input source to generate them.
303 ///
304 ///
305 /// **Note:** For key events, obtaining the tool type is not supported, and in such cases,
306 /// the API will return an <b>unknown</b> value.
307 ///
308 /// # Arguments
309 ///
310 /// * `event` - Pointer to the current UI input event.
311 ///
312 /// # Returns
313 ///
314 /// * Returns the tool type of the current UI input event.
315 ///
316 /// Available since API-level: 12
317 #[cfg(feature = "api-12")]
318 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
319 pub fn OH_ArkUI_UIInputEvent_GetToolType(event: *const ArkUI_UIInputEvent) -> i32;
320 /// Obtains the time when this UI input event occurs.
321 ///
322 /// # Arguments
323 ///
324 /// * `event` - Indicates the pointer to the current UI input event.
325 ///
326 /// # Returns
327 ///
328 /// * Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
329 ///
330 /// Available since API-level: 12
331 #[cfg(feature = "api-12")]
332 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
333 pub fn OH_ArkUI_UIInputEvent_GetEventTime(event: *const ArkUI_UIInputEvent) -> i64;
334 /// Obtains the number of contact points from a pointer event (such as a touch, mouse, or axis event).
335 ///
336 /// Pointer events are typically events that carry position information, such as touch events,
337 /// where the location of the event can be determined.
338 /// Non-pointer events, such as key events, do not have position information and do not involve contact points,
339 /// so this API is not applicable to key events.
340 ///
341 /// For touch events, this API returns the number of active touch points, for example, fingers on the screen.
342 /// For mouse and axis events, this API always returns <b>1</b>, as they are single-pointer interactions.
343 ///
344 /// # Arguments
345 ///
346 /// * `event` - Pointer to the current UI input event.
347 ///
348 /// # Returns
349 ///
350 /// * Number of contact points for the current pointer event.
351 ///
352 /// Available since API-level: 12
353 #[cfg(feature = "api-12")]
354 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
355 pub fn OH_ArkUI_PointerEvent_GetPointerCount(event: *const ArkUI_UIInputEvent) -> u32;
356 /// Obtains the unique ID of a contact point from a pointer event (such as a touch, mouse, or axis event).
357 ///
358 /// The ID distinguishes between multiple contact points from the same input device. The return value itself does not
359 /// have any other meaning beyond identifying the contact point.
360 ///
361 /// # Arguments
362 ///
363 /// * `event` - Pointer to the current UI input event.
364 ///
365 /// * `pointerIndex` - Index of the target contact point in the contact point list.
366 ///
367 /// # Returns
368 ///
369 /// * Unique ID of the specified contact point.
370 ///
371 /// Available since API-level: 12
372 #[cfg(feature = "api-12")]
373 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
374 pub fn OH_ArkUI_PointerEvent_GetPointerId(
375 event: *const ArkUI_UIInputEvent,
376 pointerIndex: u32,
377 ) -> i32;
378 /// Obtains the ID of the touch pointer that triggers the current touch event.
379 ///
380 /// # Arguments
381 ///
382 /// * `event` - Indicates the pointer to the current UI input event.
383 ///
384 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
385 ///
386 /// # Returns
387 ///
388 /// * Returns the result code.
389 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
390 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
391 ///
392 /// Available since API-level: 15
393 #[cfg(feature = "api-15")]
394 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
395 pub fn OH_ArkUI_PointerEvent_GetChangedPointerId(
396 event: *const ArkUI_UIInputEvent,
397 pointerIndex: *mut u32,
398 ) -> i32;
399 /// Obtains the X coordinate relative to the upper left corner of the current component from a directional
400 /// input event (such as a touch event, mouse event, or axis event).
401 ///
402 /// # Arguments
403 ///
404 /// * `event` - Indicates the pointer to the directional input event.
405 ///
406 /// # Returns
407 ///
408 /// * Returns the X coordinate relative to the upper left corner of the current component;
409 /// returns <b>0</b> if any parameter error occurs.
410 ///
411 /// Available since API-level: 12
412 #[cfg(feature = "api-12")]
413 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
414 pub fn OH_ArkUI_PointerEvent_GetX(event: *const ArkUI_UIInputEvent) -> f32;
415 /// Obtains the X coordinate of a specific contact point relative to the upper left corner of the current
416 /// component from a pointer event (such as a touch, mouse, or axis event).
417 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
418 ///
419 /// # Arguments
420 ///
421 /// * `event` - Pointer to the current UI input event.
422 ///
423 /// * `pointerIndex` - Index of the target contact point in the contact point list.
424 ///
425 /// # Returns
426 ///
427 /// * Returns the X coordinate relative to the upper left corner of the current component;
428 /// returns <b>0.0f</b> if any parameter error occurs.
429 ///
430 /// Available since API-level: 12
431 #[cfg(feature = "api-12")]
432 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
433 pub fn OH_ArkUI_PointerEvent_GetXByIndex(
434 event: *const ArkUI_UIInputEvent,
435 pointerIndex: u32,
436 ) -> f32;
437 /// Obtains the Y coordinate relative to the upper left corner of the current component from a directional
438 /// input event (such as a touch event, mouse event, or axis event).
439 ///
440 /// # Arguments
441 ///
442 /// * `event` - Indicates the pointer to the UI input event.
443 ///
444 /// # Returns
445 ///
446 /// * Returns the Y coordinate relative to the upper left corner of the current component;
447 /// returns <b>0.0f</b> if any parameter error occurs.
448 ///
449 /// Available since API-level: 12
450 #[cfg(feature = "api-12")]
451 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
452 pub fn OH_ArkUI_PointerEvent_GetY(event: *const ArkUI_UIInputEvent) -> f32;
453 /// Obtains the Y coordinate of a specific contact point relative to the upper left corner of the current
454 /// component from a pointer event (such as a touch, mouse, or axis event).
455 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
456 ///
457 /// # Arguments
458 ///
459 /// * `event` - Pointer to the current UI input event.
460 ///
461 /// * `pointerIndex` - Index of the target contact point in the contact point list.
462 ///
463 /// # Returns
464 ///
465 /// * Y coordinate relative to the upper left corner of the current component;
466 /// <b>0.0f</b> if any parameter error occurs.
467 ///
468 /// Available since API-level: 12
469 #[cfg(feature = "api-12")]
470 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
471 pub fn OH_ArkUI_PointerEvent_GetYByIndex(
472 event: *const ArkUI_UIInputEvent,
473 pointerIndex: u32,
474 ) -> f32;
475 /// Obtains the X coordinate relative to the upper left corner of the current application window from a
476 /// directional input event (such as a touch event, mouse event, or axis event).
477 ///
478 /// # Arguments
479 ///
480 /// * `event` - Indicates the pointer to the UI input event.
481 ///
482 /// # Returns
483 ///
484 /// * Returns the X coordinate relative to the upper left corner of the current application window;
485 /// returns <b>0.0f</b> if any parameter error occurs.
486 ///
487 /// Available since API-level: 12
488 #[cfg(feature = "api-12")]
489 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
490 pub fn OH_ArkUI_PointerEvent_GetWindowX(event: *const ArkUI_UIInputEvent) -> f32;
491 /// Obtains the X coordinate of a specific contact point relative to the upper left corner of the current
492 /// application window from a pointer event (such as a touch, mouse, or axis event).
493 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
494 ///
495 /// # Arguments
496 ///
497 /// * `event` - Pointer to the current UI input event.
498 ///
499 /// * `pointerIndex` - Index of the target contact point in the contact point list.
500 ///
501 /// # Returns
502 ///
503 /// * X coordinate relative to the upper left corner of the current application window;
504 /// <b>0.0f</b> if any parameter error occurs.
505 ///
506 /// Available since API-level: 12
507 #[cfg(feature = "api-12")]
508 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
509 pub fn OH_ArkUI_PointerEvent_GetWindowXByIndex(
510 event: *const ArkUI_UIInputEvent,
511 pointerIndex: u32,
512 ) -> f32;
513 /// Obtains the Y coordinate relative to the upper left corner of the current application window from a
514 /// directional input event (such as a touch event, mouse event, or axis event).
515 ///
516 /// # Arguments
517 ///
518 /// * `event` - Indicates the pointer to the UI input event.
519 ///
520 /// # Returns
521 ///
522 /// * Returns the Y coordinate relative to the upper left corner of the current application window;
523 /// returns <b>0.0f</b> if any parameter error occurs.
524 ///
525 /// Available since API-level: 12
526 #[cfg(feature = "api-12")]
527 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
528 pub fn OH_ArkUI_PointerEvent_GetWindowY(event: *const ArkUI_UIInputEvent) -> f32;
529 /// Obtains the Y coordinate of a specific contact point relative to the upper left corner of the current
530 /// application window from a pointer event (such as a touch, mouse, or axis event).
531 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
532 ///
533 /// # Arguments
534 ///
535 /// * `event` - Pointer to the current UI input event.
536 ///
537 /// * `pointerIndex` - Index of the target contact point in the contact point list.
538 ///
539 /// # Returns
540 ///
541 /// * Returns the Y coordinate relative to the upper left corner of the current application window;
542 /// returns <b>0.0f</b> if any parameter error occurs.
543 ///
544 /// Available since API-level: 12
545 #[cfg(feature = "api-12")]
546 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
547 pub fn OH_ArkUI_PointerEvent_GetWindowYByIndex(
548 event: *const ArkUI_UIInputEvent,
549 pointerIndex: u32,
550 ) -> f32;
551 /// Obtains the X coordinate relative to the upper left corner of the current screen from a directional input
552 /// event (such as a touch event, mouse event, or axis event).
553 ///
554 /// # Arguments
555 ///
556 /// * `event` - Indicates the pointer to the UI input event.
557 ///
558 /// # Returns
559 ///
560 /// * Returns the X coordinate relative to the upper left corner of the current screen;
561 /// returns <b>0.0f</b> if any parameter error occurs.
562 ///
563 /// Available since API-level: 12
564 #[cfg(feature = "api-12")]
565 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
566 pub fn OH_ArkUI_PointerEvent_GetDisplayX(event: *const ArkUI_UIInputEvent) -> f32;
567 /// Obtains the X coordinate of a specific contact point relative to the upper left corner of the current screen
568 /// from a pointer event (such as a touch, mouse, or axis event).
569 /// For mouse and axis events, this API returns the default value of <b>0.0f</b> if the given index is greater than 0.
570 ///
571 /// # Arguments
572 ///
573 /// * `event` - Pointer to the current UI input event.
574 ///
575 /// * `pointerIndex` - Index of the target contact point in the contact point list.
576 ///
577 /// # Returns
578 ///
579 /// * Returns the X coordinate relative to the upper left corner of the current screen;
580 /// returns <b>0.0f</b> if any parameter error occurs.
581 ///
582 /// Available since API-level: 12
583 #[cfg(feature = "api-12")]
584 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
585 pub fn OH_ArkUI_PointerEvent_GetDisplayXByIndex(
586 event: *const ArkUI_UIInputEvent,
587 pointerIndex: u32,
588 ) -> f32;
589 /// Obtains the Y coordinate relative to the upper left corner of the current screen from a directional input
590 /// event (such as a touch event, mouse event, or axis event).
591 ///
592 /// # Arguments
593 ///
594 /// * `event` - Indicates the pointer to the UI input event.
595 ///
596 /// # Returns
597 ///
598 /// * Returns the Y coordinate relative to the upper left corner of the current screen;
599 /// returns <b>0.0f</b> if any parameter error occurs.
600 ///
601 /// Available since API-level: 12
602 #[cfg(feature = "api-12")]
603 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
604 pub fn OH_ArkUI_PointerEvent_GetDisplayY(event: *const ArkUI_UIInputEvent) -> f32;
605 /// Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current screen
606 /// from a pointer event (such as a touch event, mouse event, or axis event).
607 ///
608 /// # Arguments
609 ///
610 /// * `event` - Pointer to the current UI input event.
611 ///
612 /// * `pointerIndex` - Index of the target contact point in the contact point list.
613 ///
614 /// # Returns
615 ///
616 /// * Returns the Y coordinate relative to the upper left corner of the current screen;
617 /// returns <b>0.0f</b> if any parameter error occurs.
618 ///
619 /// Available since API-level: 12
620 #[cfg(feature = "api-12")]
621 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
622 pub fn OH_ArkUI_PointerEvent_GetDisplayYByIndex(
623 event: *const ArkUI_UIInputEvent,
624 pointerIndex: u32,
625 ) -> f32;
626 /// Obtains the X coordinate relative to global display from a pointer event (such as a touch, mouse,
627 /// or axis event).
628 /// Position information can only be obtained from UI input events.
629 ///
630 /// # Arguments
631 ///
632 /// * `event` - Pointer to the current UI input event.
633 ///
634 /// # Returns
635 ///
636 /// * float X coordinate relative to the global display. <b>0</b> is returned if any parameter error occurs
637 /// (for example, if the event does not contain position information).
638 ///
639 /// Available since API-level: 20
640 #[cfg(feature = "api-20")]
641 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
642 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayX(event: *const ArkUI_UIInputEvent) -> f32;
643 /// Obtains the X coordinate of a specific contact point relative to global display from a pointer event
644 /// (such as a touch, mouse, or axis event).
645 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
646 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
647 ///
648 /// # Arguments
649 ///
650 /// * `event` - Pointer to the current UI input event.
651 ///
652 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
653 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
654 ///
655 /// # Returns
656 ///
657 /// * float X coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
658 ///
659 /// Available since API-level: 20
660 #[cfg(feature = "api-20")]
661 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
662 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(
663 event: *const ArkUI_UIInputEvent,
664 pointerIndex: u32,
665 ) -> f32;
666 /// Obtains the Y coordinate relative to global display from a pointer event (such as a touch, mouse,
667 /// or axis event).
668 /// Position information can only be obtained from pointer-like events.
669 ///
670 /// # Arguments
671 ///
672 /// * `event` - Pointer to the current UI input event.
673 ///
674 /// # Returns
675 ///
676 /// * float Y coordinate relative to the global display; <b>0</b> if any parameter error occurs
677 /// (for example, if the event does not contain position information).
678 ///
679 /// Available since API-level: 20
680 #[cfg(feature = "api-20")]
681 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
682 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayY(event: *const ArkUI_UIInputEvent) -> f32;
683 /// Obtains the Y coordinate of a specific contact point relative to global display from a pointer event
684 /// (such as a touch, mouse, or axis event).
685 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
686 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
687 ///
688 /// # Arguments
689 ///
690 /// * `event` - Pointer to the current UI input event.
691 ///
692 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
693 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
694 ///
695 /// # Returns
696 ///
697 /// * float Y coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
698 ///
699 /// Available since API-level: 20
700 #[cfg(feature = "api-20")]
701 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
702 pub fn OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(
703 event: *const ArkUI_UIInputEvent,
704 pointerIndex: u32,
705 ) -> f32;
706 /// Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event).
707 ///
708 /// # Arguments
709 ///
710 /// * `event` - Indicates the pointer to the current UI input event.
711 ///
712 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
713 ///
714 /// # Returns
715 ///
716 /// * Returns the pressure applied to the touchscreen; returns <b>0.0f</b> if any parameter error occurs.
717 ///
718 /// Available since API-level: 12
719 #[cfg(feature = "api-12")]
720 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
721 pub fn OH_ArkUI_PointerEvent_GetPressure(
722 event: *const ArkUI_UIInputEvent,
723 pointerIndex: u32,
724 ) -> f32;
725 /// Obtains the tilt angle relative to the YZ plane from a pointer event.
726 /// The value range is [-90, 90], where positive values indicate a rightward tilt.
727 /// This API is applicable only to stylus-based touch events from devices that support tilt angle reporting.
728 ///
729 /// # Arguments
730 ///
731 /// * `event` - Pointer to the current UI input event.
732 ///
733 /// * `pointerIndex` - Index of the target contact point in the contact point list.
734 ///
735 /// # Returns
736 ///
737 /// * Returns the angle relative to the YZ plane.
738 ///
739 /// Available since API-level: 12
740 #[cfg(feature = "api-12")]
741 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
742 pub fn OH_ArkUI_PointerEvent_GetTiltX(
743 event: *const ArkUI_UIInputEvent,
744 pointerIndex: u32,
745 ) -> f32;
746 /// Obtains the tilt angle relative to the XZ plane from a pointer event.
747 /// The value range is [-90, 90], where positive values indicate a rightward tilt.
748 /// This API is applicable only to stylus-based touch events from devices that support tilt angle reporting.
749 ///
750 /// # Arguments
751 ///
752 /// * `event` - Pointer to the current UI input event.
753 ///
754 /// * `pointerIndex` - Index of the target contact point in the contact point list.
755 ///
756 /// # Returns
757 ///
758 /// * Returns the angle relative to the XZ plane.
759 ///
760 /// Available since API-level: 12
761 #[cfg(feature = "api-12")]
762 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
763 pub fn OH_ArkUI_PointerEvent_GetTiltY(
764 event: *const ArkUI_UIInputEvent,
765 pointerIndex: u32,
766 ) -> f32;
767 /// Obtains the rotation angle of the stylus around the z-axis from a UI input event.
768 ///
769 /// # Arguments
770 ///
771 /// * `event` - Pointer to the UI input event.
772 ///
773 /// * `rollAngle` - Rotation angle of the stylus around the z-axis.
774 ///
775 /// # Returns
776 ///
777 /// * Returns the result code.
778 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
779 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
780 ///
781 /// Available since API-level: 17
782 #[cfg(feature = "api-17")]
783 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
784 pub fn OH_ArkUI_PointerEvent_GetRollAngle(
785 event: *const ArkUI_UIInputEvent,
786 rollAngle: *mut f64,
787 ) -> i32;
788 /// Obtains the width of the contact area for a pointer event. This API is applicable only to finger-based touch
789 /// events, and the return value typically represents the radius of a circular touch area.
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 width of the touch area.
800 ///
801 /// Available since API-level: 12
802 #[cfg(feature = "api-12")]
803 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
804 pub fn OH_ArkUI_PointerEvent_GetTouchAreaWidth(
805 event: *const ArkUI_UIInputEvent,
806 pointerIndex: u32,
807 ) -> f32;
808 /// Obtains the height of the contact area for a pointer event. This API is applicable only to finger-based touch
809 /// events, and the return value typically represents the radius of a circular touch area.
810 ///
811 /// # Arguments
812 ///
813 /// * `event` - Pointer to the current UI input event.
814 ///
815 /// * `pointerIndex` - Index of the target contact point in the contact point list.
816 ///
817 /// # Returns
818 ///
819 /// * Returns the height of the touch area.
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_GetTouchAreaHeight(
825 event: *const ArkUI_UIInputEvent,
826 pointerIndex: u32,
827 ) -> f32;
828 /// Checks whether an event is triggered by the user's left or right hand.
829 /// This API is only effective on some touch devices.
830 ///
831 ///
832 /// **Note:** This value cannot be obtained in real time when pressed. Before the
833 /// system completes result inference, it will return <b>NONE</b> by default. Therefore,
834 /// please do not over-rely on the results returned by this interface.
835 ///
836 /// # Arguments
837 ///
838 /// * `event` - Pointer to the current UI input event.
839 ///
840 /// * `hand` - Whether the touch point is from the left or right hand.
841 ///
842 /// # Returns
843 ///
844 /// * Result code.
845 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
846 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
847 ///
848 /// Available since API-level: 15
849 #[cfg(feature = "api-15")]
850 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
851 pub fn OH_ArkUI_PointerEvent_GetInteractionHand(
852 event: *const ArkUI_UIInputEvent,
853 hand: *mut ArkUI_InteractionHand,
854 ) -> i32;
855 /// Checks whether an event is triggered by the user's left or right hand.
856 /// This API is only effective on some touch devices.
857 ///
858 ///
859 /// **Note:** This value cannot be obtained in real time when pressed. Before the
860 /// system completes result inference, it will return <b>NONE</b> by default. Therefore,
861 /// please do not over-rely on the results returned by this interface.
862 ///
863 /// # Arguments
864 ///
865 /// * `event` - Pointer to the current UI input event.
866 ///
867 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
868 ///
869 /// * `hand` - Whether the touch point is from the left or right hand.
870 ///
871 /// # Returns
872 ///
873 /// * Result code.
874 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
875 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
876 ///
877 /// Available since API-level: 15
878 #[cfg(feature = "api-15")]
879 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
880 pub fn OH_ArkUI_PointerEvent_GetInteractionHandByIndex(
881 event: *const ArkUI_UIInputEvent,
882 pointerIndex: i32,
883 hand: *mut ArkUI_InteractionHand,
884 ) -> i32;
885 /// Obtains the number of historical events from a pointer event (such as a touch event).
886 /// Historical events are the raw events that occur between the current event and the previous event.
887 /// This API is applicable only to move events.
888 ///
889 /// # Arguments
890 ///
891 /// * `event` - Pointer to the current UI input event.
892 ///
893 /// # Returns
894 ///
895 /// * Returns the number of historical events.
896 ///
897 /// Available since API-level: 12
898 #[cfg(feature = "api-12")]
899 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
900 pub fn OH_ArkUI_PointerEvent_GetHistorySize(event: *const ArkUI_UIInputEvent) -> u32;
901 /// Obtains the occurrence time of a historical event from a directional input event (such as a touch event,
902 /// mouse event, or axis event).
903 ///
904 /// # Arguments
905 ///
906 /// * `event` - Indicates the pointer to the current UI input event.
907 ///
908 /// * `historyIndex` - Indicates the index of the target historical event.
909 ///
910 /// # Returns
911 ///
912 /// * Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
913 ///
914 /// Available since API-level: 12
915 #[cfg(feature = "api-12")]
916 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
917 pub fn OH_ArkUI_PointerEvent_GetHistoryEventTime(
918 event: *const ArkUI_UIInputEvent,
919 historyIndex: u32,
920 ) -> i64;
921 /// Obtains the number of touch points in a specific historical event from a directional input event (such as
922 /// a touch event, mouse event, or axis event).
923 ///
924 /// # Arguments
925 ///
926 /// * `event` - Indicates the pointer to the current UI input event.
927 ///
928 /// * `historyIndex` - Indicates the index of the target historical event.
929 ///
930 /// # Returns
931 ///
932 /// * Returns the number of touch points in the specified historical event
933 ///
934 /// Available since API-level: 12
935 #[cfg(feature = "api-12")]
936 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
937 pub fn OH_ArkUI_PointerEvent_GetHistoryPointerCount(
938 event: *const ArkUI_UIInputEvent,
939 historyIndex: u32,
940 ) -> u32;
941 /// Obtains the unique ID of a contact point from a historical event of a pointer event (such as a touch event).
942 ///
943 /// The ID distinguishes between multiple contact points from the same input device.
944 /// The return value itself does not have any other meaning beyond identifying the contact point.
945 ///
946 /// # Arguments
947 ///
948 /// * `event` - Pointer to the current UI input event.
949 ///
950 /// * `pointerIndex` - Index of the target contact point in the contact point list.
951 ///
952 /// * `historyIndex` - Index of the target historical event.
953 ///
954 /// # Returns
955 ///
956 /// * Returns the ID of the corresponding touch point in the specified historical event.
957 ///
958 /// Available since API-level: 12
959 #[cfg(feature = "api-12")]
960 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
961 pub fn OH_ArkUI_PointerEvent_GetHistoryPointerId(
962 event: *const ArkUI_UIInputEvent,
963 pointerIndex: u32,
964 historyIndex: u32,
965 ) -> i32;
966 /// Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
967 /// of the current component from a directional input event (such as a touch event, mouse event, or axis event).
968 ///
969 /// # Arguments
970 ///
971 /// * `event` - Indicates the pointer to the current UI input event.
972 ///
973 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
974 ///
975 /// * `historyIndex` - Indicates the index of the target historical event.
976 ///
977 /// # Returns
978 ///
979 /// * Returns the X coordinate relative to the upper left corner of the current component;
980 /// returns <b>0.0f</b> if any parameter error occurs.
981 ///
982 /// Available since API-level: 12
983 #[cfg(feature = "api-12")]
984 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
985 pub fn OH_ArkUI_PointerEvent_GetHistoryX(
986 event: *const ArkUI_UIInputEvent,
987 pointerIndex: u32,
988 historyIndex: u32,
989 ) -> f32;
990 /// Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
991 /// of the current component from a directional input event (such as a touch event, mouse event, or axis event).
992 ///
993 /// # Arguments
994 ///
995 /// * `event` - Indicates the pointer to the current UI input event.
996 ///
997 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
998 ///
999 /// * `historyIndex` - Indicates the index of the target historical event.
1000 ///
1001 /// # Returns
1002 ///
1003 /// * Returns the Y coordinate relative to the upper left corner of the current component;
1004 /// returns <b>0.0f</b> if any parameter error occurs.
1005 ///
1006 /// Available since API-level: 12
1007 #[cfg(feature = "api-12")]
1008 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1009 pub fn OH_ArkUI_PointerEvent_GetHistoryY(
1010 event: *const ArkUI_UIInputEvent,
1011 pointerIndex: u32,
1012 historyIndex: u32,
1013 ) -> f32;
1014 /// Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
1015 /// of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
1016 ///
1017 /// # Arguments
1018 ///
1019 /// * `event` - Indicates the pointer to the current UI input event.
1020 ///
1021 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1022 ///
1023 /// * `historyIndex` - Indicates the index of the target historical event.
1024 ///
1025 /// # Returns
1026 ///
1027 /// * Returns the X coordinate relative to the upper left corner of the current application window;
1028 /// returns <b>0.0f</b> if any parameter error occurs.
1029 ///
1030 /// Available since API-level: 12
1031 #[cfg(feature = "api-12")]
1032 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1033 pub fn OH_ArkUI_PointerEvent_GetHistoryWindowX(
1034 event: *const ArkUI_UIInputEvent,
1035 pointerIndex: u32,
1036 historyIndex: u32,
1037 ) -> f32;
1038 /// Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
1039 /// of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
1040 ///
1041 /// # Arguments
1042 ///
1043 /// * `event` - Indicates the pointer to the current UI input event.
1044 ///
1045 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1046 ///
1047 /// * `historyIndex` - Indicates the index of the target historical event.
1048 ///
1049 /// # Returns
1050 ///
1051 /// * Returns the Y coordinate relative to the upper left corner of the current application window;
1052 /// returns <b>0.0f</b> if any parameter error occurs.
1053 ///
1054 /// Available since API-level: 12
1055 #[cfg(feature = "api-12")]
1056 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1057 pub fn OH_ArkUI_PointerEvent_GetHistoryWindowY(
1058 event: *const ArkUI_UIInputEvent,
1059 pointerIndex: u32,
1060 historyIndex: u32,
1061 ) -> f32;
1062 /// Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
1063 /// of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
1064 ///
1065 /// # Arguments
1066 ///
1067 /// * `event` - Indicates the pointer to the current UI input event.
1068 ///
1069 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1070 ///
1071 /// * `historyIndex` - Indicates the index of the target historical event.
1072 ///
1073 /// # Returns
1074 ///
1075 /// * Returns the X coordinate relative to the upper left corner of the current screen;
1076 /// returns <b>0.0f</b> if any parameter error occurs.
1077 ///
1078 /// Available since API-level: 12
1079 #[cfg(feature = "api-12")]
1080 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1081 pub fn OH_ArkUI_PointerEvent_GetHistoryDisplayX(
1082 event: *const ArkUI_UIInputEvent,
1083 pointerIndex: u32,
1084 historyIndex: u32,
1085 ) -> f32;
1086 /// Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
1087 /// of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
1088 ///
1089 /// # Arguments
1090 ///
1091 /// * `event` - Indicates the pointer to the current UI input event.
1092 ///
1093 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1094 ///
1095 /// * `historyIndex` - Indicates the index of the target historical event.
1096 ///
1097 /// # Returns
1098 ///
1099 /// * Returns the Y coordinate relative to the upper left corner of the current screen;
1100 /// returns <b>0.0f</b> if any parameter error occurs.
1101 ///
1102 /// Available since API-level: 12
1103 #[cfg(feature = "api-12")]
1104 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1105 pub fn OH_ArkUI_PointerEvent_GetHistoryDisplayY(
1106 event: *const ArkUI_UIInputEvent,
1107 pointerIndex: u32,
1108 historyIndex: u32,
1109 ) -> f32;
1110 /// Obtains the X coordinate relative to the global display for a specific touch point from historical events,
1111 /// based on the given pointer index and history index of an input event (such as a touch, mouse, or axis event).
1112 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
1113 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
1114 ///
1115 /// # Arguments
1116 ///
1117 /// * `event` - Pointer to the current UI input event.
1118 ///
1119 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1120 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
1121 ///
1122 /// * `historyIndex` - Index of the historical value to return. It must be less than
1123 /// [`#OH_ArkUI_PointerEvent_GetHistorySize`].
1124 ///
1125 /// # Returns
1126 ///
1127 /// * float X coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
1128 ///
1129 /// Available since API-level: 20
1130 #[cfg(feature = "api-20")]
1131 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1132 pub fn OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX(
1133 event: *const ArkUI_UIInputEvent,
1134 pointerIndex: u32,
1135 historyIndex: u32,
1136 ) -> f32;
1137 /// Obtains the Y coordinate relative to the global display for a specific touch point from historical events,
1138 /// based on the given pointer index and history index of an input event (such as a touch, mouse, or axis event).
1139 /// Position information can only be obtained from UI input events. For mouse and axis events, if the provided
1140 /// <b>pointerIndex</b> is greater than 0, this API always returns the default value <b>0.0f</b>.
1141 ///
1142 /// # Arguments
1143 ///
1144 /// * `event` - Pointer to the current UI input event.
1145 ///
1146 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1147 /// Value range: [0, OH_ArkUI_PointerEvent_GetPointerCount() - 1]
1148 ///
1149 /// * `historyIndex` - Index of the historical value to return. It must be less than
1150 /// [`#OH_ArkUI_PointerEvent_GetHistorySize`].
1151 ///
1152 /// # Returns
1153 ///
1154 /// * float Y coordinate relative to the global display; <b>0.0f</b> if any parameter error occurs.
1155 ///
1156 /// Available since API-level: 20
1157 #[cfg(feature = "api-20")]
1158 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1159 pub fn OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY(
1160 event: *const ArkUI_UIInputEvent,
1161 pointerIndex: u32,
1162 historyIndex: u32,
1163 ) -> f32;
1164 /// Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event
1165 /// (for example, a touch event)..
1166 ///
1167 /// # Arguments
1168 ///
1169 /// * `event` - Indicates the pointer to the current UI input event.
1170 ///
1171 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1172 ///
1173 /// * `historyIndex` - Indicates the index of the target historical event.
1174 ///
1175 /// # Returns
1176 ///
1177 /// * Returns the pressure applied to the touchscreen; returns <b>0.0f</b> if any parameter error occurs.
1178 ///
1179 /// Available since API-level: 12
1180 #[cfg(feature = "api-12")]
1181 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1182 pub fn OH_ArkUI_PointerEvent_GetHistoryPressure(
1183 event: *const ArkUI_UIInputEvent,
1184 pointerIndex: u32,
1185 historyIndex: u32,
1186 ) -> f32;
1187 /// Obtains the angle relative to the YZ plane in a specific historical event from a directional input event
1188 /// (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt.
1189 ///
1190 /// # Arguments
1191 ///
1192 /// * `event` - Indicates the pointer to the current UI input event.
1193 ///
1194 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1195 ///
1196 /// * `historyIndex` - Indicates the index of the target historical event.
1197 ///
1198 /// # Returns
1199 ///
1200 /// * Returns the angle relative to the YZ plane.
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_GetHistoryTiltX(
1206 event: *const ArkUI_UIInputEvent,
1207 pointerIndex: u32,
1208 historyIndex: u32,
1209 ) -> f32;
1210 /// Obtains the angle relative to the XZ plane in a specific historical event from a directional input event
1211 /// (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt.
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 angle relative to the XZ plane.
1224 ///
1225 /// Available since API-level: 12
1226 #[cfg(feature = "api-12")]
1227 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1228 pub fn OH_ArkUI_PointerEvent_GetHistoryTiltY(
1229 event: *const ArkUI_UIInputEvent,
1230 pointerIndex: u32,
1231 historyIndex: u32,
1232 ) -> f32;
1233 /// Obtains the width of the touch area in a specific historical event from a directional input event
1234 /// (for example, a touch event).
1235 ///
1236 /// # Arguments
1237 ///
1238 /// * `event` - Indicates the pointer to the current UI input event.
1239 ///
1240 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1241 ///
1242 /// * `historyIndex` - Indicates the index of the target historical event.
1243 ///
1244 /// # Returns
1245 ///
1246 /// * Returns the width of the touch area.
1247 ///
1248 /// Available since API-level: 12
1249 #[cfg(feature = "api-12")]
1250 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1251 pub fn OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(
1252 event: *const ArkUI_UIInputEvent,
1253 pointerIndex: u32,
1254 historyIndex: u32,
1255 ) -> f32;
1256 /// Obtains the height of the touch area in a specific historical event from a directional input event
1257 /// (for example, a touch event).
1258 ///
1259 /// # Arguments
1260 ///
1261 /// * `event` - Indicates the pointer to the current UI input event.
1262 ///
1263 /// * `pointerIndex` - Indicates the index of the target touch point in the multi-touch data list.
1264 ///
1265 /// * `historyIndex` - Indicates the index of the target historical event.
1266 ///
1267 /// # Returns
1268 ///
1269 /// * Returns the height of the touch area.
1270 ///
1271 /// Available since API-level: 12
1272 #[cfg(feature = "api-12")]
1273 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1274 pub fn OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(
1275 event: *const ArkUI_UIInputEvent,
1276 pointerIndex: u32,
1277 historyIndex: u32,
1278 ) -> f32;
1279 /// Obtains the value of the vertical scroll axis for this axis event.
1280 /// This value is typically generated by mouse wheel scrolling or two-finger vertical swiping on a touchpad.
1281 ///
1282 /// If the value is generated by mouse wheel scrolling:
1283 /// 1. The reported value is in degrees and represents the incremental angle of a single scroll,
1284 /// not the total scroll amount.
1285 /// 2. The reported value includes the user's scroll step configuration (see [`OH_ArkUI_AxisEvent_GetScrollStep`]).
1286 /// 3. The sign of the value indicates the direction: positive for forward scrolling and negative for backward scrolling.
1287 ///
1288 /// If the value is generated by two-finger vertical swiping on a touchpad:
1289 /// 1. The reported value is in px and represents the incremental scroll amount, not the total scroll amount.
1290 /// 2. The reported value does not include the user's scroll step configuration.
1291 /// 3. The sign of the value indicates the direction: positive for swiping down and negative for swiping up.
1292 /// 4. The direction is affected by the system settings for natural scrolling.
1293 ///
1294 /// Under normal circumstances, vertical scroll axis events only drive vertical swipe gestures. However,
1295 /// if the mouse pointer is over a scrollable area where the scrollable directions are consistent,
1296 /// the vertical scroll axis event can drive the swipe gestures in this scrollable area, even if they are defined
1297 /// as horizontal.
1298 ///
1299 /// # Arguments
1300 ///
1301 /// * `event` - Pointer to the current UI input event.
1302 ///
1303 /// # Returns
1304 ///
1305 /// * Value of the vertical scroll axis of the current axis event; <b>0.0</b> if any parameter error occurs.
1306 ///
1307 /// Available since API-level: 12
1308 #[cfg(feature = "api-12")]
1309 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1310 pub fn OH_ArkUI_AxisEvent_GetVerticalAxisValue(event: *const ArkUI_UIInputEvent) -> f64;
1311 /// Obtains the value of the horizontal scroll axis for this axis event.
1312 /// This value is generated by two-finger horizontal swiping on a touchpad.
1313 ///
1314 ///
1315 /// **Note:** 1. The reported value is in px and represents the incremental scroll amount, not the total scroll amount.
1316 /// 2. The reported value does not include the user's scroll step configuration.
1317 /// 3. The sign of the value indicates the direction: positive for swiping right and negative for swiping left.
1318 /// 4. The direction is affected by the system settings for natural scrolling.
1319 ///
1320 /// # Arguments
1321 ///
1322 /// * `event` - Pointer to the current UI input event.
1323 ///
1324 /// # Returns
1325 ///
1326 /// * Returns the value of the horizontal scroll axis of the current axis event;
1327 /// returns <b>0</b> if any parameter error occurs.
1328 ///
1329 /// Available since API-level: 12
1330 #[cfg(feature = "api-12")]
1331 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1332 pub fn OH_ArkUI_AxisEvent_GetHorizontalAxisValue(event: *const ArkUI_UIInputEvent) -> f64;
1333 /// This value is generated by a two-finger pinch gesture on a touchpad.
1334 /// The reported scale value is relative to the initial state
1335 ///
1336 /// when the system first detects the pinch gesture, with an initial scale value of 1.0.
1337 /// During the pinch operation, the scale value decreases from 1.0 towards 0.0 when the user pinches inward
1338 /// and increases from 1.0 when the user spreads fingers outward.
1339 ///
1340 /// # Arguments
1341 ///
1342 /// * `event` - Pointer to the current UI input event.
1343 ///
1344 /// # Returns
1345 ///
1346 /// * Scale value of the pinch axis of the current axis event; <b>0.0</b> if any parameter error occurs.
1347 ///
1348 /// Available since API-level: 12
1349 #[cfg(feature = "api-12")]
1350 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1351 pub fn OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(event: *const ArkUI_UIInputEvent) -> f64;
1352 /// Obtains the action type of the current axis event.
1353 ///
1354 /// # Arguments
1355 ///
1356 /// * `event` - Indicates the pointer to the current UI input event.
1357 ///
1358 /// # Returns
1359 ///
1360 /// * Returns the action type of the current axis event.
1361 ///
1362 /// Available since API-level: 15
1363 #[cfg(feature = "api-15")]
1364 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1365 pub fn OH_ArkUI_AxisEvent_GetAxisAction(event: *const ArkUI_UIInputEvent) -> i32;
1366 /// Sets the hit testing mode, that is, how the component behaves during hit testing.
1367 /// This API only applies to scenarios raw input events are received, such as when [`NODE_ON_TOUCH`] is used for
1368 /// touch event handling.
1369 /// It cannot be used with <b>ArkUI_UIInputEvent</b> objects obtained from gesture events through
1370 /// [`OH_ArkUI_GestureEvent_GetRawInputEvent`].
1371 ///
1372 /// # Arguments
1373 ///
1374 /// * `event` - Pointer to the current UI input event.
1375 ///
1376 /// * `mode` - Hit testing mode, of type [`HitTestMode`].
1377 ///
1378 /// # Returns
1379 ///
1380 /// * Result code.
1381 ///
1382 /// Available since API-level: 12
1383 #[cfg(feature = "api-12")]
1384 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1385 pub fn OH_ArkUI_PointerEvent_SetInterceptHitTestMode(
1386 event: *const ArkUI_UIInputEvent,
1387 mode: HitTestMode,
1388 ) -> i32;
1389 /// Get the value of the button type for mouse events.
1390 ///
1391 /// # Arguments
1392 ///
1393 /// * `event` - Represents a pointer to the current UI input event.
1394 ///
1395 /// # Returns
1396 ///
1397 /// * Return to the mouse button type, where <b>1</b> is the left button, <b>2</b> is the right button,
1398 /// <b>3</b> is the middle button, <b>4</b> is the back button, and <b>5</b> is the forward button.
1399 ///
1400 /// Available since API-level: 12
1401 #[cfg(feature = "api-12")]
1402 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1403 pub fn OH_ArkUI_MouseEvent_GetMouseButton(event: *const ArkUI_UIInputEvent) -> i32;
1404 /// Get the value of the mouse action type for mouse events.
1405 ///
1406 /// # Arguments
1407 ///
1408 /// * `event` - Represents a pointer to the current UI input event.
1409 ///
1410 /// # Returns
1411 ///
1412 /// * Returns the type of mouse action, where <b>1</b> represents button pressed,
1413 /// <b>2</b> represents button released, and <b>3</b> represents mouse movement.
1414 ///
1415 /// Available since API-level: 12
1416 #[cfg(feature = "api-12")]
1417 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1418 pub fn OH_ArkUI_MouseEvent_GetMouseAction(event: *const ArkUI_UIInputEvent) -> i32;
1419 /// Sets whether to stop event propagation. This API only applies to scenarios raw input events are received,
1420 /// such as when [`NODE_ON_TOUCH`] is used for touch event handling.
1421 /// It cannot be used with <b>ArkUI_UIInputEvent</b> objects obtained from gesture events
1422 /// through [`OH_ArkUI_GestureEvent_GetRawInputEvent`].
1423 ///
1424 /// # Arguments
1425 ///
1426 /// * `event` - Pointer to the current UI input event.
1427 ///
1428 /// * `stopPropagation` - Whether to stop event propagation.
1429 ///
1430 /// # Returns
1431 ///
1432 /// * Returns the status code of the execution. If 0 is returned, the setting is successful.
1433 /// If 401 is returned, the execution fails.
1434 /// The possible cause of the failure is that the event parameter is abnormal, such as a null pointer.
1435 ///
1436 /// Available since API-level: 12
1437 #[cfg(feature = "api-12")]
1438 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1439 pub fn OH_ArkUI_PointerEvent_SetStopPropagation(
1440 event: *const ArkUI_UIInputEvent,
1441 stopPropagation: bool,
1442 ) -> i32;
1443 /// Obtains the ID of device that triggers UI input event.
1444 ///
1445 /// # Arguments
1446 ///
1447 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1448 ///
1449 /// # Returns
1450 ///
1451 /// * Returns the device ID.
1452 ///
1453 /// Available since API-level: 14
1454 #[cfg(feature = "api-14")]
1455 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
1456 pub fn OH_ArkUI_UIInputEvent_GetDeviceId(event: *const ArkUI_UIInputEvent) -> i32;
1457 /// Obtains all keys that are pressed from UI input event. Only supports key events currently.
1458 ///
1459 /// # Arguments
1460 ///
1461 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1462 ///
1463 /// * `pressedKeyCodes` - Array of all keys that are pressed. You need to allocate the memory space.
1464 ///
1465 /// * `length` - Length of the passed pressedKeyCodes array (when used as an input parameter);
1466 /// number of the keys pressed (when used as an output parameter).
1467 ///
1468 /// # Returns
1469 ///
1470 /// * Returns the result code.
1471 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1472 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH`] if the giving buffer is not enough.
1473 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1474 ///
1475 /// Available since API-level: 14
1476 #[cfg(feature = "api-14")]
1477 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
1478 pub fn OH_ArkUI_UIInputEvent_GetPressedKeys(
1479 event: *const ArkUI_UIInputEvent,
1480 pressedKeyCodes: *mut i32,
1481 length: *mut i32,
1482 ) -> i32;
1483 /// Obtains the axis value of a focus axis event.
1484 ///
1485 /// # Arguments
1486 ///
1487 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1488 ///
1489 /// * `axis` - Axis type of the focus axis event.
1490 ///
1491 /// # Returns
1492 ///
1493 /// * Returns the axis value of the focus axis event; returns <b>0.0</b> if any parameter error occurs.
1494 ///
1495 /// Available since API-level: 15
1496 #[cfg(feature = "api-15")]
1497 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1498 pub fn OH_ArkUI_FocusAxisEvent_GetAxisValue(event: *const ArkUI_UIInputEvent, axis: i32)
1499 -> f64;
1500 /// Sets whether to prevent a focus axis event from bubbling up.
1501 ///
1502 /// # Arguments
1503 ///
1504 /// * `event` - Indicates the pointer to the current UI input event.
1505 ///
1506 /// * `stopPropagation` - Indicates whether to stop event propagation.
1507 ///
1508 /// # Returns
1509 ///
1510 /// * Returns the result code.
1511 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1512 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1513 ///
1514 /// Available since API-level: 15
1515 #[cfg(feature = "api-15")]
1516 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1517 pub fn OH_ArkUI_FocusAxisEvent_SetStopPropagation(
1518 event: *const ArkUI_UIInputEvent,
1519 stopPropagation: bool,
1520 ) -> i32;
1521 /// Obtains the width of the component hit by an event.
1522 ///
1523 /// # Arguments
1524 ///
1525 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1526 ///
1527 /// # Returns
1528 ///
1529 /// * Returns the width of the component hit by the event; returns <b>0.0f</b> if any parameter error occurs.
1530 ///
1531 /// Available since API-level: 17
1532 #[cfg(feature = "api-17")]
1533 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1534 pub fn OH_ArkUI_UIInputEvent_GetEventTargetWidth(event: *const ArkUI_UIInputEvent) -> f32;
1535 /// Obtains the height of the component hit by an event.
1536 ///
1537 /// # Arguments
1538 ///
1539 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1540 ///
1541 /// # Returns
1542 ///
1543 /// * Returns the height of the component hit by the event; returns <b>0.0f</b> if any parameter error occurs.
1544 ///
1545 /// Available since API-level: 17
1546 #[cfg(feature = "api-17")]
1547 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1548 pub fn OH_ArkUI_UIInputEvent_GetEventTargetHeight(event: *const ArkUI_UIInputEvent) -> f32;
1549 /// Obtains the X coordinate of the component hit by an event.
1550 ///
1551 /// # Arguments
1552 ///
1553 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1554 ///
1555 /// # Returns
1556 ///
1557 /// * Returns the X coordinate of the component hit by the event; returns <b>0.0f</b> if any parameter error occurs.
1558 ///
1559 /// Available since API-level: 17
1560 #[cfg(feature = "api-17")]
1561 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1562 pub fn OH_ArkUI_UIInputEvent_GetEventTargetPositionX(event: *const ArkUI_UIInputEvent) -> f32;
1563 /// Obtains the Y coordinate of the component hit by an event.
1564 ///
1565 /// # Arguments
1566 ///
1567 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1568 ///
1569 /// # Returns
1570 ///
1571 /// * Returns the Y coordinate of the component hit by the event;
1572 /// returns <b>0.0f</b> if any parameter error occurs.
1573 ///
1574 /// Available since API-level: 17
1575 #[cfg(feature = "api-17")]
1576 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1577 pub fn OH_ArkUI_UIInputEvent_GetEventTargetPositionY(event: *const ArkUI_UIInputEvent) -> f32;
1578 /// Obtains the global X coordinate of the component hit by an event.
1579 ///
1580 /// # Arguments
1581 ///
1582 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1583 ///
1584 /// # Returns
1585 ///
1586 /// * Returns the global X coordinate of the component hit by the event;
1587 /// returns <b>0.0f</b> if any parameter error occurs.
1588 ///
1589 /// Available since API-level: 17
1590 #[cfg(feature = "api-17")]
1591 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1592 pub fn OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionX(
1593 event: *const ArkUI_UIInputEvent,
1594 ) -> f32;
1595 /// Obtains the global Y coordinate of the component hit by an event.
1596 ///
1597 /// # Arguments
1598 ///
1599 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1600 ///
1601 /// # Returns
1602 ///
1603 /// * Returns the global Y coordinate of the component hit by the event;
1604 /// returns <b>0.0f</b> if any parameter error occurs.
1605 ///
1606 /// Available since API-level: 17
1607 #[cfg(feature = "api-17")]
1608 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1609 pub fn OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionY(
1610 event: *const ArkUI_UIInputEvent,
1611 ) -> f32;
1612 /// Checks whether the cursor is hovering over this component.
1613 ///
1614 /// # Arguments
1615 ///
1616 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1617 ///
1618 /// # Returns
1619 ///
1620 /// * Returns <b>true</b> if the cursor is hovering over the current component.
1621 /// Returns <b>false</b> if the cursor is not hovering over the current component.
1622 ///
1623 /// Available since API-level: 17
1624 #[cfg(feature = "api-17")]
1625 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1626 pub fn OH_ArkUI_HoverEvent_IsHovered(event: *const ArkUI_UIInputEvent) -> bool;
1627 /// Obtains the modifier key states for a UI input event.
1628 /// This API outputs the state of all modifier keys at the time of the event through the <b>keys</b> parameter.
1629 /// You can determine which keys are pressed by performing bitwise operations with the modifier key types defined
1630 /// in [`ArkUI_ModifierKeyName`].
1631 ///
1632 /// # Arguments
1633 ///
1634 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1635 ///
1636 /// * `keys` - Pointer to a variable where the current combination of pressed modifier keys will be returned.
1637 /// The application can use bitwise operations to determine the state of each modifier key.
1638 ///
1639 /// # Returns
1640 ///
1641 /// * Result code.
1642 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1643 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1644 ///
1645 /// Available since API-level: 17
1646 #[cfg(feature = "api-17")]
1647 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1648 pub fn OH_ArkUI_UIInputEvent_GetModifierKeyStates(
1649 event: *const ArkUI_UIInputEvent,
1650 keys: *mut u64,
1651 ) -> i32;
1652 /// Obtains the press time of a specified touch point. This API is effective only for touch events.
1653 ///
1654 /// # Arguments
1655 ///
1656 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1657 ///
1658 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1659 ///
1660 /// # Returns
1661 ///
1662 /// * Returns the press time of the specific touch point; returns <b>0</b> if any parameter error occurs.
1663 ///
1664 /// Available since API-level: 15
1665 #[cfg(feature = "api-15")]
1666 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1667 pub fn OH_ArkUI_PointerEvent_GetPressedTimeByIndex(
1668 event: *const ArkUI_UIInputEvent,
1669 pointerIndex: u32,
1670 ) -> i64;
1671 /// Obtains the x-axis offset of the mouse pointer position relative to the position in the previously reported
1672 /// mouse event. This value may be less than the difference between the two reported X coordinates when the mouse pointer
1673 /// is near the screen edge.
1674 /// # Arguments
1675 ///
1676 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1677 ///
1678 /// # Returns
1679 ///
1680 /// * Returns the x-axis offset of the mouse pointer position relative to the position in the previously reported
1681 /// mouse event; returns <b>0.0f</b> if any parameter error occurs.
1682 ///
1683 /// Available since API-level: 15
1684 #[cfg(feature = "api-15")]
1685 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1686 pub fn OH_ArkUI_MouseEvent_GetRawDeltaX(event: *const ArkUI_UIInputEvent) -> f32;
1687 /// Obtains the y-axis offset of the mouse pointer position relative to the position in the previously reported
1688 /// mouse event. This value may be less than the difference between the two reported Y coordinates when the mouse pointer
1689 /// is near the screen edge.
1690 /// # Arguments
1691 ///
1692 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1693 ///
1694 /// # Returns
1695 ///
1696 /// * Returns the y-axis offset of the mouse pointer position relative to the position in the previously reported
1697 /// mouse event; returns <b>0.0f</b> if any parameter error occurs.
1698 ///
1699 /// Available since API-level: 15
1700 #[cfg(feature = "api-15")]
1701 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1702 pub fn OH_ArkUI_MouseEvent_GetRawDeltaY(event: *const ArkUI_UIInputEvent) -> f32;
1703 /// Obtains the pressed buttons from a mouse event.
1704 ///
1705 /// # Arguments
1706 ///
1707 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1708 ///
1709 /// * `pressedButtons` - Array of the pressed buttons. An int array must be created beforehand to store the pressed
1710 /// buttons.
1711 ///
1712 /// * `length` - Length of the passed pressedButtons array (when used as an input parameter);
1713 /// number of the buttons pressed (when used as an output parameter).
1714 ///
1715 /// # Returns
1716 ///
1717 /// * Returns the result code.
1718 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1719 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] if the given buffer size is insufficient.
1720 ///
1721 /// Available since API-level: 15
1722 #[cfg(feature = "api-15")]
1723 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1724 pub fn OH_ArkUI_MouseEvent_GetPressedButtons(
1725 event: *const ArkUI_UIInputEvent,
1726 pressedButtons: *mut i32,
1727 length: *mut i32,
1728 ) -> i32;
1729 /// Obtains the ID of the screen where the UI input event occurs.
1730 ///
1731 /// # Arguments
1732 ///
1733 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1734 ///
1735 /// # Returns
1736 ///
1737 /// * Returns the screen ID; returns <b>0</b> if any parameter error occurs.
1738 ///
1739 /// Available since API-level: 15
1740 #[cfg(feature = "api-15")]
1741 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1742 pub fn OH_ArkUI_UIInputEvent_GetTargetDisplayId(event: *const ArkUI_UIInputEvent) -> i32;
1743 /// Sets whether to enable axis event propagation (bubbling). By default, axis events do not bubble and are
1744 /// only sent to the first component that can respond to axis events. You can enable axis event bubbling
1745 /// to allow the current event to be passed to the next ancestor component in the response chain
1746 /// that can handle axis events.
1747 /// This API cannot be used on axis events obtained from gesture events.
1748 ///
1749 /// # Arguments
1750 ///
1751 /// * `event` - Pointer to the UI input event.
1752 ///
1753 /// * `propagation` - Whether to enable event propagation.
1754 ///
1755 /// # Returns
1756 ///
1757 /// * Result code.
1758 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1759 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1760 ///
1761 /// Available since API-level: 17
1762 #[cfg(feature = "api-17")]
1763 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1764 pub fn OH_ArkUI_AxisEvent_SetPropagation(
1765 event: *const ArkUI_UIInputEvent,
1766 propagation: bool,
1767 ) -> i32;
1768 /// Obtains the scroll step coefficient for a wheel-based axis event.
1769 /// This API returns the user-configured scroll scale factor factor.
1770 ///
1771 /// # Arguments
1772 ///
1773 /// * `event` - Pointer to the UI input event.
1774 ///
1775 /// # Returns
1776 ///
1777 /// * Scroll step configuration of the mouse wheel axis event.
1778 ///
1779 /// Available since API-level: 17
1780 #[cfg(feature = "api-17")]
1781 #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
1782 pub fn OH_ArkUI_AxisEvent_GetScrollStep(event: *const ArkUI_UIInputEvent) -> i32;
1783 /// Creates a cloned event pointer based on an event pointer. This API is effective only for touch events.
1784 ///
1785 /// # Arguments
1786 ///
1787 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1788 ///
1789 /// * `clonedEvent` - Pointer to the cloned <b>ArkUI_UIInputEvent</b> object.
1790 ///
1791 /// # Returns
1792 ///
1793 /// * Result code.
1794 /// [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1795 /// [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1796 ///
1797 /// Available since API-level: 15
1798 #[cfg(feature = "api-15")]
1799 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1800 pub fn OH_ArkUI_PointerEvent_CreateClonedEvent(
1801 event: *const ArkUI_UIInputEvent,
1802 clonedEvent: *mut *mut ArkUI_UIInputEvent,
1803 ) -> i32;
1804 /// Destroys a cloned event pointer.
1805 ///
1806 /// # Arguments
1807 ///
1808 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1809 ///
1810 /// # Returns
1811 ///
1812 /// * Returns the result code.
1813 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1814 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1815 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1816 /// cloned event pointer.
1817 ///
1818 /// Available since API-level: 15
1819 #[cfg(feature = "api-15")]
1820 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1821 pub fn OH_ArkUI_PointerEvent_DestroyClonedEvent(event: *const ArkUI_UIInputEvent) -> i32;
1822 /// Sets the X and Y coordinates of a cloned event relative to the upper left corner of the current component.
1823 ///
1824 /// # Arguments
1825 ///
1826 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1827 ///
1828 /// * `x` - X coordinate of the event relative to the upper left corner of the current component.
1829 ///
1830 /// * `y` - Y coordinate of the event relative to the upper left corner of the current component.
1831 ///
1832 /// # Returns
1833 ///
1834 /// * Returns the result code.
1835 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1836 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1837 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1838 /// cloned event pointer.
1839 ///
1840 /// Available since API-level: 15
1841 #[cfg(feature = "api-15")]
1842 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1843 pub fn OH_ArkUI_PointerEvent_SetClonedEventLocalPosition(
1844 event: *const ArkUI_UIInputEvent,
1845 x: f32,
1846 y: f32,
1847 ) -> i32;
1848 /// Sets the X and Y coordinates of a specific contact point of a cloned event relative to the upper left corner
1849 /// of the current component.
1850 ///
1851 /// # Arguments
1852 ///
1853 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1854 ///
1855 /// * `x` - X coordinate of the event relative to the upper left corner of the current component.
1856 ///
1857 /// * `y` - Y coordinate of the event relative to the upper left corner of the current component.
1858 ///
1859 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1860 ///
1861 /// # Returns
1862 ///
1863 /// * Returns the result code.
1864 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1865 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1866 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1867 /// cloned event pointer.
1868 ///
1869 /// Available since API-level: 15
1870 #[cfg(feature = "api-15")]
1871 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1872 pub fn OH_ArkUI_PointerEvent_SetClonedEventLocalPositionByIndex(
1873 event: *const ArkUI_UIInputEvent,
1874 x: f32,
1875 y: f32,
1876 pointerIndex: i32,
1877 ) -> i32;
1878 /// Sets the action type of a cloned event.
1879 ///
1880 /// # Arguments
1881 ///
1882 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1883 ///
1884 /// * `actionType` - Action type of the cloned event.
1885 ///
1886 /// # Returns
1887 ///
1888 /// * Returns the result code.
1889 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1890 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1891 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1892 /// cloned event pointer.
1893 ///
1894 /// Available since API-level: 15
1895 #[cfg(feature = "api-15")]
1896 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1897 pub fn OH_ArkUI_PointerEvent_SetClonedEventActionType(
1898 event: *const ArkUI_UIInputEvent,
1899 actionType: i32,
1900 ) -> i32;
1901 /// Sets the touch point ID of a cloned pointer event.
1902 ///
1903 /// # Arguments
1904 ///
1905 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1906 ///
1907 /// * `fingerId` - ID of the touch point that triggers the event.
1908 ///
1909 /// # Returns
1910 ///
1911 /// * Returns the result code.
1912 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1913 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1914 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1915 /// cloned event pointer.
1916 ///
1917 /// Available since API-level: 15
1918 #[cfg(feature = "api-15")]
1919 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1920 pub fn OH_ArkUI_PointerEvent_SetClonedEventChangedFingerId(
1921 event: *const ArkUI_UIInputEvent,
1922 fingerId: i32,
1923 ) -> i32;
1924 /// Sets the touch point ID of a specific contact point of a cloned event.
1925 ///
1926 /// # Arguments
1927 ///
1928 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1929 ///
1930 /// * `fingerId` - Touch point ID of the specific contact point.
1931 ///
1932 /// * `pointerIndex` - Index of the target touch point in the multi-touch data list.
1933 ///
1934 /// # Returns
1935 ///
1936 /// * Returns the result code.
1937 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1938 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1939 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1940 /// cloned event pointer.
1941 ///
1942 /// Available since API-level: 15
1943 #[cfg(feature = "api-15")]
1944 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1945 pub fn OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex(
1946 event: *const ArkUI_UIInputEvent,
1947 fingerId: i32,
1948 pointerIndex: i32,
1949 ) -> i32;
1950 /// Posts a cloned event to a specific node.
1951 ///
1952 /// # Arguments
1953 ///
1954 /// * `node` - Target node.
1955 ///
1956 /// * `event` - Pointer to an <b>ArkUI_UIInputEvent</b> object.
1957 ///
1958 /// # Returns
1959 ///
1960 /// * Returns the result code.
1961 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1962 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1963 /// Returns [`ARKUI_ERROR_CODE_NON_CLONED_POINTER_EVENT`] if the input event pointer is not a
1964 /// cloned event pointer.
1965 /// Returns [`ARKUI_ERROR_CODE_POST_CLONED_COMPONENT_STATUS_ABNORMAL`]
1966 /// if the component status abnormal.
1967 /// Returns [`ARKUI_ERROR_CODE_POST_CLONED_NO_COMPONENT_HIT_TO_RESPOND_TO_THE_EVENT`]
1968 /// if no component hit to response to the event.
1969 ///
1970 /// Available since API-level: 15
1971 #[cfg(feature = "api-15")]
1972 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
1973 pub fn OH_ArkUI_PointerEvent_PostClonedEvent(
1974 node: ArkUI_NodeHandle,
1975 event: *const ArkUI_UIInputEvent,
1976 ) -> i32;
1977 /// Use this method to obtain the execution status of the latest UI input related method.
1978 ///
1979 /// In most cases, this method is unnecessary unless you need to determine if the return value indicates an error.
1980 /// Here's an example of usage: For return values like float (where 0.0 doesn't indicate an error), use GetLatestStatus
1981 /// to confirm if an error occurred.
1982 /// float x = OH_ArkUI_PointerEvent_GetX(event);
1983 /// if (ARKUI_ERROR_CODE_NO_ERROR != OH_ArkUI_UIInputEvent_GetLatestStatus()) {
1984 /// // error
1985 /// return;
1986 /// }
1987 /// Note: The system clears the status of the previous function call each time a UIInput-related function is executed,
1988 /// ensuring you always get the latest status.
1989 ///
1990 ///
1991 /// # Returns
1992 ///
1993 /// * Returns the ArkUI_ErrorCode.
1994 ///
1995 /// Available since API-level: 20
1996 #[cfg(feature = "api-20")]
1997 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1998 pub fn OH_ArkUI_UIInputEvent_GetLatestStatus() -> ArkUiResult;
1999}