1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @addtogroup ArkUI_EventModule
18 * @{
19 *
20 * @brief Declares the UI input event capabilities provided by ArkUI on the native side.
21 *
22 * @since 12
23 */
24
25/**
26 * @file ui_input_event.h
27 *
28 * @brief Provides ArkUI event definitions on the native side.
29 *
30 * @library libace_ndk.z.so
31 * @syscap SystemCapability.ArkUI.ArkUI.Full
32 * @kit ArkUI
33 * @since 12
34 */
35
36#ifndef _ARKUI_UI_INPUT_EVENT_H_
37#define _ARKUI_UI_INPUT_EVENT_H_
38
39#include <stdint.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45/**
46 * @brief Defines the UI input event.
47 *
48 * @since 12
49 */
50typedef struct ArkUI_UIInputEvent ArkUI_UIInputEvent;
51
52/**
53 * @brief Enumerates the UI input event types.
54 *
55 * @since 12
56 */
57typedef enum {
58    ARKUI_UIINPUTEVENT_TYPE_UNKNOWN = 0,
59    ARKUI_UIINPUTEVENT_TYPE_TOUCH = 1,
60    ARKUI_UIINPUTEVENT_TYPE_AXIS = 2,
61    /** Mouse event. */
62    ARKUI_UIINPUTEVENT_TYPE_MOUSE = 3,
63} ArkUI_UIInputEvent_Type;
64
65/**
66 * @brief Defines the action code of the input event.
67 *
68 * @since 12
69 */
70enum {
71    /** Cancellation of touch. */
72    UI_TOUCH_EVENT_ACTION_CANCEL = 0,
73    /** Pressing of a touch point. */
74    UI_TOUCH_EVENT_ACTION_DOWN = 1,
75    /** Moving of a touch point. */
76    UI_TOUCH_EVENT_ACTION_MOVE = 2,
77    /** Lifting of a touch point. */
78    UI_TOUCH_EVENT_ACTION_UP = 3,
79};
80
81/**
82 * @brief Defines the tool type of the touch event.
83 *
84 * @since 12
85 */
86enum {
87    /** Unknown tool type. */
88    UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN = 0,
89
90    /** Finger. */
91    UI_INPUT_EVENT_TOOL_TYPE_FINGER = 1,
92
93    /** Pen. */
94    UI_INPUT_EVENT_TOOL_TYPE_PEN = 2,
95
96    /** Mouse. */
97    UI_INPUT_EVENT_TOOL_TYPE_MOUSE = 3,
98
99    /** TouchPad. */
100    UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD = 4,
101
102    /** JoyStick. */
103    UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK = 5,
104};
105
106/**
107 * @brief Defines the source type of the touch event.
108 *
109 * @since 12
110 */
111enum {
112    /** Unknown source type. */
113    UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN = 0,
114    /** Mouse. */
115    UI_INPUT_EVENT_SOURCE_TYPE_MOUSE = 1,
116    /** Touchscreen. */
117    UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN = 2,
118};
119
120/**
121 * @brief Enumerates the hit test modes.
122 *
123 * @since 12
124 */
125typedef enum {
126    /** Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from
127     *  the hit test.
128     */
129    HTM_DEFAULT = 0,
130
131    /** The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit
132     *  test.
133     */
134    HTM_BLOCK,
135
136    /** Both the node and its child node respond to the hit test of a touch event, and its sibling node is also
137     *  considered during the hit test.
138     */
139    HTM_TRANSPARENT,
140
141    /** The node does not respond to the hit test of a touch event, but its child node and sibling node are considered
142     *  during the hit test.
143     */
144    HTM_NONE,
145} HitTestMode;
146
147/**
148 * @brief Define the Action Code for mouse events.
149 *
150 * @since 12
151 */
152enum {
153    /** Invalid. */
154    UI_MOUSE_EVENT_ACTION_UNKNOWN = 0,
155    /** Press. */
156    UI_MOUSE_EVENT_ACTION_PRESS = 1,
157    /** Release. */
158    UI_MOUSE_EVENT_ACTION_RELEASE = 2,
159    /** Move. */
160    UI_MOUSE_EVENT_ACTION_MOVE = 3,
161};
162
163/**
164 * @brief Define the button type for mouse events.
165 *
166 * @since 12
167 */
168enum {
169    /** None. */
170    UI_MOUSE_EVENT_BUTTON_NONE = 0,
171    /** Left. */
172    UI_MOUSE_EVENT_BUTTON_LEFT = 1,
173    /** Right. */
174    UI_MOUSE_EVENT_BUTTON_RIGHT = 2,
175    /** Middle. */
176    UI_MOUSE_EVENT_BUTTON_MIDDLE = 3,
177    /** Back. */
178    UI_MOUSE_EVENT_BUTTON_BACK = 4,
179    /** Forward. */
180    UI_MOUSE_EVENT_BUTTON_FORWARD = 5,
181};
182
183/**
184 * @brief Defines an enum for modifier keys.
185 *
186 * @since 12
187 */
188typedef enum {
189    /** Ctrl. */
190    ARKUI_MODIFIER_KEY_CTRL = 1 << 0,
191    /** Shift. */
192    ARKUI_MODIFIER_KEY_SHIFT = 1 << 1,
193    /** Alt. */
194    ARKUI_MODIFIER_KEY_ALT = 1 << 2,
195    /** Fn. */
196    ARKUI_MODIFIER_KEY_FN = 1 << 3,
197} ArkUI_ModifierKeyName;
198
199/**
200 * @brief Obtains the type of this UI input event.
201 *
202 * @param event Indicates the pointer to the current UI input event.
203 * @return Returns the type of the current UI input event; returns <b>0</b> if any parameter error occurs.
204 * @since 12
205 */
206int32_t OH_ArkUI_UIInputEvent_GetType(const ArkUI_UIInputEvent* event);
207
208/**
209 * @brief Obtains the action type of this UI input event.
210 *
211 * @param event Indicates the pointer to the current UI input event.
212 * @return Returns the action type of the current UI input event; returns <b>0</b> if any parameter error occurs.
213 * @since 12
214 */
215int32_t OH_ArkUI_UIInputEvent_GetAction(const ArkUI_UIInputEvent* event);
216
217/**
218 * @brief Obtains the source type of this UI input event.
219 *
220 * @param event Indicates the pointer to the current UI input event.
221 * @return Returns the source type of the current UI input event.
222 * @since 12
223 */
224int32_t OH_ArkUI_UIInputEvent_GetSourceType(const ArkUI_UIInputEvent* event);
225
226/**
227 * @brief Obtains the tool type of this UI input event.
228 *
229 * @param event Indicates the pointer to the current UI input event.
230 * @return Returns the tool type of the current UI input event.
231 * @since 12
232 */
233int32_t OH_ArkUI_UIInputEvent_GetToolType(const ArkUI_UIInputEvent* event);
234
235/**
236 * @brief Obtains the time when this UI input event occurs.
237 *
238 * @param event Indicates the pointer to the current UI input event.
239 * @return Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
240 * @since 12
241 */
242int64_t OH_ArkUI_UIInputEvent_GetEventTime(const ArkUI_UIInputEvent* event);
243
244/**
245 * @brief Obtains the number of touch points from a directional input event (such as a touch event, mouse event,
246 * or axis event).
247 *
248 * @param event Indicates the pointer to the current UI input event.
249 * @return Returns the number of touch points for the directional input event.
250 * @since 12
251 */
252uint32_t OH_ArkUI_PointerEvent_GetPointerCount(const ArkUI_UIInputEvent* event);
253
254/**
255 * @brief Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event,
256 * or axis event).
257 *
258 * @param event Indicates the pointer to the current UI input event.
259 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
260 * @return Returns the ID of the corresponding touch point.
261 * @since 12
262 */
263int32_t OH_ArkUI_PointerEvent_GetPointerId(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
264
265/**
266 * @brief Obtains the X coordinate relative to the upper left corner of the current component from a directional
267 * input event (such as a touch event, mouse event, or axis event).
268 *
269 * @param event Indicates the pointer to the directional input event.
270 * @return Returns the X coordinate relative to the upper left corner of the current component;
271 * returns <b>0</b> if any parameter error occurs.
272 * @since 12
273 */
274float OH_ArkUI_PointerEvent_GetX(const ArkUI_UIInputEvent* event);
275
276/**
277 * @brief Obtains the X coordinate of a specific touch point relative to the upper left corner of the current component
278 * from a directional input event (such as a touch event, mouse event, or axis event).
279 *
280 * @param event Indicates the pointer to the current UI input event.
281 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
282 * @return Returns the X coordinate relative to the upper left corner of the current component;
283 * returns <b>0.0f</b> if any parameter error occurs.
284 * @since 12
285 */
286float OH_ArkUI_PointerEvent_GetXByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
287
288/**
289 * @brief Obtains the Y coordinate relative to the upper left corner of the current component from a directional
290 * input event (such as a touch event, mouse event, or axis event).
291 *
292 * @param event Indicates the pointer to the UI input event.
293 * @return Returns the Y coordinate relative to the upper left corner of the current component;
294 * returns <b>0</b> if any parameter error occurs.
295 * @since 12
296 */
297float OH_ArkUI_PointerEvent_GetY(const ArkUI_UIInputEvent* event);
298
299/**
300 * @brief Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current component
301 * from a directional input event (such as a touch event, mouse event, or axis event).
302 *
303 * @param event Indicates the pointer to the current UI input event.
304 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
305 * @return Returns the Y coordinate relative to the upper left corner of the current component;
306 * returns <b>0.0f</b> if any parameter error occurs.
307 * @since 12
308 */
309float OH_ArkUI_PointerEvent_GetYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
310
311/**
312 * @brief Obtains the X coordinate relative to the upper left corner of the current application window from a
313 * directional input event (such as a touch event, mouse event, or axis event).
314 *
315 * @param event Indicates the pointer to the UI input event.
316 * @return Returns the X coordinate relative to the upper left corner of the current application window;
317 * returns <b>0</b> if any parameter error occurs.
318 * @since 12
319 */
320float OH_ArkUI_PointerEvent_GetWindowX(const ArkUI_UIInputEvent* event);
321
322/**
323 * @brief Obtains the X coordinate of a specific touch point relative to the upper left corner of the current
324 * application window from a directional input event (such as a touch event, mouse event, or axis event).
325 *
326 * @param event Indicates the pointer to the current UI input event.
327 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
328 * @return Returns the X coordinate relative to the upper left corner of the current application window;
329 * returns <b>0.0f</b> if any parameter error occurs.
330 * @since 12
331 */
332float OH_ArkUI_PointerEvent_GetWindowXByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
333
334/**
335 * @brief Obtains the Y coordinate relative to the upper left corner of the current application window from a
336 * directional input event (such as a touch event, mouse event, or axis event).
337 *
338 * @param event Indicates the pointer to the UI input event.
339 * @return Returns the Y coordinate relative to the upper left corner of the current application window;
340 * returns <b>0</b> if any parameter error occurs.
341 * @since 12
342 */
343float OH_ArkUI_PointerEvent_GetWindowY(const ArkUI_UIInputEvent* event);
344
345/**
346 * @brief Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current
347 * application window from a directional input event (such as a touch event, mouse event, or axis event).
348 *
349 * @param event Indicates the pointer to the current UI input event.
350 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
351 * @return Returns the Y coordinate relative to the upper left corner of the current application window;
352 * returns <b>0.0f</b> if any parameter error occurs.
353 * @since 12
354 */
355float OH_ArkUI_PointerEvent_GetWindowYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
356
357/**
358 * @brief Obtains the X coordinate relative to the upper left corner of the current screen from a directional input
359 * event (such as a touch event, mouse event, or axis event).
360 *
361 * @param event Indicates the pointer to the UI input event.
362 * @return Returns the X coordinate relative to the upper left corner of the current screen;
363 * returns <b>0</b> if any parameter error occurs.
364 * @since 12
365 */
366float OH_ArkUI_PointerEvent_GetDisplayX(const ArkUI_UIInputEvent* event);
367
368/**
369 * @brief Obtains the X coordinate of a specific touch point relative to the upper left corner of the current screen
370 * from a directional input event (such as a touch event, mouse event, or axis event).
371 *
372 * @param event Indicates the pointer to the current UI input event.
373 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
374 * @return Returns the X coordinate relative to the upper left corner of the current screen;
375 * returns <b>0.0f</b> if any parameter error occurs.
376 * @since 12
377 */
378float OH_ArkUI_PointerEvent_GetDisplayXByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
379
380/**
381 * @brief Obtains the Y coordinate relative to the upper left corner of the current screen from a directional input
382 * event (such as a touch event, mouse event, or axis event).
383 *
384 * @param event Indicates the pointer to the UI input event.
385 * @return Returns the Y coordinate relative to the upper left corner of the current screen;
386 * returns <b>0</b> if any parameter error occurs.
387 * @since 12
388 */
389float OH_ArkUI_PointerEvent_GetDisplayY(const ArkUI_UIInputEvent* event);
390
391/**
392 * @brief Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current screen
393 * from a directional input event (such as a touch event, mouse event, or axis event).
394 *
395 * @param event Indicates the pointer to the current UI input event.
396 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
397 * @return Returns the Y coordinate relative to the upper left corner of the current screen;
398 * returns <b>0.0f</b> if any parameter error occurs.
399 * @since 12
400 */
401float OH_ArkUI_PointerEvent_GetDisplayYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
402
403/**
404 * @brief Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event).
405 *
406 * @param event Indicates the pointer to the current UI input event.
407 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
408 * @return Returns the pressure applied to the touchscreen; returns <b>0.0f</b> if any parameter error occurs.
409 * @since 12
410 */
411float OH_ArkUI_PointerEvent_GetPressure(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
412
413/**
414 * @brief Obtains the angle relative to the YZ plane from a directional input event (for example, a touch event).
415 * The value range is [-90, 90]. A positive value indicates a rightward tilt.
416 *
417 * @param event Indicates the pointer to the current UI input event.
418 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
419 * @return Returns the angle relative to the YZ plane.
420 * @since 12
421 */
422float OH_ArkUI_PointerEvent_GetTiltX(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
423
424/**
425 * @brief Obtains the angle relative to the XZ plane from a directional input event (for example, a touch event).
426 * The value range is [-90, 90]. A positive value indicates a downward tilt.
427 *
428 * @param event Indicates the pointer to the current UI input event.
429 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
430 * @return Returns the angle relative to the XZ plane.
431 * @since 12
432 */
433float OH_ArkUI_PointerEvent_GetTiltY(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
434
435/**
436 * @brief Obtains the width of the touch area from a directional input event (for example, a touch event).
437 *
438 * @param event Indicates the pointer to the current UI input event.
439 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
440 * @return Returns the width of the touch area.
441 * @since 12
442 */
443float OH_ArkUI_PointerEvent_GetTouchAreaWidth(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
444
445/**
446 * @brief Obtains the height of the touch area from a directional input event (for example, a touch event).
447 *
448 * @param event Indicates the pointer to the current UI input event.
449 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
450 * @return Returns the height of the touch area.
451 * @since 12
452 */
453float OH_ArkUI_PointerEvent_GetTouchAreaHeight(const ArkUI_UIInputEvent* event, uint32_t pointerIndex);
454
455/**
456 * @brief Obtains the number of historical events from a directional input event (such as a touch event, mouse event,
457 * or axis event).
458 *
459 * @param event Indicates the pointer to the current UI input event.
460 * @return Returns the number of historical events.
461 * @since 12
462 */
463uint32_t OH_ArkUI_PointerEvent_GetHistorySize(const ArkUI_UIInputEvent* event);
464
465/**
466 * @brief Obtains the occurrence time of a historical event from a directional input event (such as a touch event,
467 * mouse event, or axis event).
468 *
469 * @param event Indicates the pointer to the current UI input event.
470 * @param historyIndex Indicates the index of the target historical event.
471 * @return Returns the time when the UI input event occurs; returns <b>0</b> if any parameter error occurs.
472 * @since 12
473 */
474int64_t OH_ArkUI_PointerEvent_GetHistoryEventTime(const ArkUI_UIInputEvent* event, uint32_t historyIndex);
475
476/**
477 * @brief Obtains the number of touch points in a specific historical event from a directional input event (such as
478 * a touch event, mouse event, or axis event).
479 *
480 * @param event Indicates the pointer to the current UI input event.
481 * @param historyIndex Indicates the index of the target historical event.
482 * @return Returns the number of touch points in the specified historical event
483 * @since 12
484 */
485uint32_t OH_ArkUI_PointerEvent_GetHistoryPointerCount(const ArkUI_UIInputEvent* event, uint32_t historyIndex);
486
487/**
488 * @brief Obtains the ID of a touch point in a specific historical event from a directional input event (such as
489 * a touch event, mouse event, or axis event).
490 *
491 * @param event Indicates the pointer to the current UI input event.
492 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
493 * @param historyIndex Indicates the index of the target historical event.
494 * @return Returns the ID of the corresponding touch point in the specified historical event.
495 * @since 12
496 */
497int32_t OH_ArkUI_PointerEvent_GetHistoryPointerId(
498    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
499
500/**
501 * @brief Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
502 * of the current component from a directional input event (such as a touch event, mouse event, or axis event).
503 *
504 * @param event Indicates the pointer to the current UI input event.
505 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
506 * @param historyIndex Indicates the index of the target historical event.
507 * @return Returns the X coordinate relative to the upper left corner of the current component;
508 * returns <b>0.0f</b> if any parameter error occurs.
509 * @since 12
510 */
511float OH_ArkUI_PointerEvent_GetHistoryX(const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
512
513/**
514 * @brief Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
515 * of the current component from a directional input event (such as a touch event, mouse event, or axis event).
516 *
517 * @param event Indicates the pointer to the current UI input event.
518 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
519 * @param historyIndex Indicates the index of the target historical event.
520 * @return Returns the Y coordinate relative to the upper left corner of the current component;
521 * returns <b>0.0f</b> if any parameter error occurs.
522 * @since 12
523 */
524float OH_ArkUI_PointerEvent_GetHistoryY(const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
525
526/**
527 * @brief Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
528 * of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
529 *
530 * @param event Indicates the pointer to the current UI input event.
531 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
532 * @param historyIndex Indicates the index of the target historical event.
533 * @return Returns the X coordinate relative to the upper left corner of the current application window;
534 * returns <b>0.0f</b> if any parameter error occurs.
535 * @since 12
536 */
537float OH_ArkUI_PointerEvent_GetHistoryWindowX(
538    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
539
540/**
541 * @brief Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
542 * of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
543 *
544 * @param event Indicates the pointer to the current UI input event.
545 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
546 * @param historyIndex Indicates the index of the target historical event.
547 * @return Returns the Y coordinate relative to the upper left corner of the current application window;
548 * returns <b>0.0f</b> if any parameter error occurs.
549 * @since 12
550 */
551float OH_ArkUI_PointerEvent_GetHistoryWindowY(
552    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
553
554/**
555 * @brief Obtains the X coordinate of a specific touch point in a historical event relative to the upper left corner
556 * of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
557 *
558 * @param event Indicates the pointer to the current UI input event.
559 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
560 * @param historyIndex Indicates the index of the target historical event.
561 * @return Returns the X coordinate relative to the upper left corner of the current screen;
562 * returns <b>0.0f</b> if any parameter error occurs.
563 * @since 12
564 */
565float OH_ArkUI_PointerEvent_GetHistoryDisplayX(
566    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
567
568/**
569 * @brief Obtains the Y coordinate of a specific touch point in a historical event relative to the upper left corner
570 * of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
571 *
572 * @param event Indicates the pointer to the current UI input event.
573 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
574 * @param historyIndex Indicates the index of the target historical event.
575 * @return Returns the Y coordinate relative to the upper left corner of the current screen;
576 * returns <b>0.0f</b> if any parameter error occurs.
577 * @since 12
578 */
579float OH_ArkUI_PointerEvent_GetHistoryDisplayY(
580    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
581
582/**
583 * @brief Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event
584 * (for example, a touch event)..
585 *
586 * @param event Indicates the pointer to the current UI input event.
587 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
588 * @param historyIndex Indicates the index of the target historical event.
589 * @return Returns the pressure applied to the touchscreen; returns <b>0.0f</b> if any parameter error occurs.
590 * @since 12
591 */
592float OH_ArkUI_PointerEvent_GetHistoryPressure(
593    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
594
595/**
596 * @brief Obtains the angle relative to the YZ plane in a specific historical event from a directional input event
597 * (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt.
598 *
599 * @param event Indicates the pointer to the current UI input event.
600 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
601 * @param historyIndex Indicates the index of the target historical event.
602 * @return Returns the angle relative to the YZ plane.
603 * @since 12
604 */
605float OH_ArkUI_PointerEvent_GetHistoryTiltX(
606    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
607
608/**
609 * @brief Obtains the angle relative to the XZ plane in a specific historical event from a directional input event
610 * (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt.
611 *
612 * @param event Indicates the pointer to the current UI input event.
613 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
614 * @param historyIndex Indicates the index of the target historical event.
615 * @return Returns the angle relative to the XZ plane.
616 * @since 12
617 */
618float OH_ArkUI_PointerEvent_GetHistoryTiltY(
619    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
620
621/**
622 * @brief Obtains the width of the touch area in a specific historical event from a directional input event
623 * (for example, a touch event).
624 *
625 * @param event Indicates the pointer to the current UI input event.
626 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
627 * @param historyIndex Indicates the index of the target historical event.
628 * @return Returns the width of the touch area.
629 * @since 12
630 */
631float OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth(
632    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
633
634/**
635 * @brief Obtains the height of the touch area in a specific historical event from a directional input event
636 * (for example, a touch event).
637 *
638 * @param event Indicates the pointer to the current UI input event.
639 * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list.
640 * @param historyIndex Indicates the index of the target historical event.
641 * @return Returns the height of the touch area.
642 * @since 12
643 */
644float OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight(
645    const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex);
646
647/**
648 * @brief Obtains the value of the vertical scroll axis for this axis event.
649 *
650 * @param event Indicates the pointer to the UI input event.
651 * @return Returns the value of the vertical scroll axis of the current axis event;
652 * returns <b>0</b> if any parameter error occurs.
653 * @since 12
654 */
655double OH_ArkUI_AxisEvent_GetVerticalAxisValue(const ArkUI_UIInputEvent* event);
656
657/**
658 * @brief Obtains the value of the horizontal scroll axis for this axis event.
659 *
660 * @param event Indicates the pointer to the UI input event.
661 * @return Returns the value of the horizontal scroll axis of the current axis event;
662 * returns <b>0</b> if any parameter error occurs.
663 * @since 12
664 */
665double OH_ArkUI_AxisEvent_GetHorizontalAxisValue(const ArkUI_UIInputEvent* event);
666
667/**
668 * @brief Obtains the scale value of the pinch axis for this axis event.
669 *
670 * @param event Indicates the pointer to the UI input event.
671 * @return Returns the scale value of the pinch axis of the current axis event;
672 * returns <b>0</b> if any parameter error occurs.
673 * @since 12
674 */
675double OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(const ArkUI_UIInputEvent* event);
676
677/**
678 * @brief Sets how the component behaves during hit testing.
679 *
680 * @param event Indicates the pointer to the current UI input event.
681 * @param mode Indicates how the component behaves during hit testing. The parameter type is {@link HitTestMode}.
682 * @return Returns the status code of the execution.
683 * @since 12
684 */
685int32_t OH_ArkUI_PointerEvent_SetInterceptHitTestMode(const ArkUI_UIInputEvent* event, HitTestMode mode);
686
687/**
688 * @brief Get the value of the button type for mouse events.
689 *
690 * @param event Represents a pointer to the current UI input event.
691 * @return Return to the mouse button type, where <b>1</b> is the left button, <b>2</b> is the right button,
692 * <b>3</b> is the middle button, <b>4</b> is the back button, and <b>5</b> is the forward button.
693 * @since 12
694 */
695int32_t OH_ArkUI_MouseEvent_GetMouseButton(const ArkUI_UIInputEvent* event);
696
697/**
698 * @brief Get the value of the mouse action type for mouse events.
699 *
700 * @param event Represents a pointer to the current UI input event.
701 * @return Returns the type of mouse action, where <b>1</b> represents button pressed,
702 * <b>2</b> represents button released, and <b>3</b> represents mouse movement.
703 * @since 12
704 */
705int32_t OH_ArkUI_MouseEvent_GetMouseAction(const ArkUI_UIInputEvent* event);
706
707/**
708 * @brief Sets whether to prevent event bubbling.
709 *
710 * @param event Indicates the pointer to the current UI input event.
711 * @param stopPropagation Indicates whether the event is prevented from bubbling.
712 * @return Returns the status code of the execution. If 0 is returned, the setting is successful.
713 *         If 401 is returned, the execution fails.
714 *         The possible cause of the failure is that the event parameter is abnormal, such as a null pointer.
715 * @since 12
716 */
717int32_t OH_ArkUI_PointerEvent_SetStopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation);
718
719#ifdef __cplusplus
720};
721#endif
722
723#endif // _ARKUI_UI_INPUT_EVENT_H_
724/** @} */
725