arkui_sys/native_gesture/native_gesture_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::*;
7use crate::ui_input_event::ArkUI_UIInputEvent;
8
9#[repr(C)]
10pub struct ArkUI_GestureRecognizer {
11 _unused: [u8; 0],
12}
13#[repr(C)]
14pub struct ArkUI_GestureInterruptInfo {
15 _unused: [u8; 0],
16}
17#[repr(C)]
18pub struct ArkUI_GestureEvent {
19 _unused: [u8; 0],
20}
21#[cfg(feature = "api-12")]
22#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
23impl ArkUI_GestureEventActionType {
24 /// Triggered.
25 pub const GESTURE_EVENT_ACTION_ACCEPT: ArkUI_GestureEventActionType =
26 ArkUI_GestureEventActionType(1);
27}
28#[cfg(feature = "api-12")]
29#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
30impl ArkUI_GestureEventActionType {
31 /// Updated.
32 pub const GESTURE_EVENT_ACTION_UPDATE: ArkUI_GestureEventActionType =
33 ArkUI_GestureEventActionType(2);
34}
35#[cfg(feature = "api-12")]
36#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
37impl ArkUI_GestureEventActionType {
38 /// Ended.
39 pub const GESTURE_EVENT_ACTION_END: ArkUI_GestureEventActionType =
40 ArkUI_GestureEventActionType(4);
41}
42#[cfg(feature = "api-12")]
43#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
44impl ArkUI_GestureEventActionType {
45 /// Canceled.
46 pub const GESTURE_EVENT_ACTION_CANCEL: ArkUI_GestureEventActionType =
47 ArkUI_GestureEventActionType(8);
48}
49#[repr(transparent)]
50/// Enumerates gesture event types.
51///
52///
53/// Available since API-level: 12
54#[cfg(feature = "api-12")]
55#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
56#[derive(Clone, Hash, PartialEq, Eq)]
57pub struct ArkUI_GestureEventActionType(pub ::core::ffi::c_uint);
58/// Defines a set of gesture event types.
59///
60/// Example: ArkUI_GestureEventActionTypeMask actions = GESTURE_EVENT_ACTION_ACCEPT | GESTURE_EVENT_ACTION_UPDATE;
61///
62///
63///
64/// Available since API-level: 12
65#[cfg(feature = "api-12")]
66#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
67pub type ArkUI_GestureEventActionTypeMask = u32;
68#[cfg(feature = "api-12")]
69#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
70impl ArkUI_GesturePriority {
71 /// Normal.
72 pub const NORMAL: ArkUI_GesturePriority = ArkUI_GesturePriority(0);
73}
74#[cfg(feature = "api-12")]
75#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
76impl ArkUI_GesturePriority {
77 /// High-priority.
78 pub const PRIORITY: ArkUI_GesturePriority = ArkUI_GesturePriority(1);
79}
80#[cfg(feature = "api-12")]
81#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
82impl ArkUI_GesturePriority {
83 /// Parallel.
84 pub const PARALLEL: ArkUI_GesturePriority = ArkUI_GesturePriority(2);
85}
86#[repr(transparent)]
87/// Enumerates gesture event modes.
88///
89///
90/// Available since API-level: 12
91#[cfg(feature = "api-12")]
92#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
93#[derive(Clone, Hash, PartialEq, Eq)]
94pub struct ArkUI_GesturePriority(pub ::core::ffi::c_uint);
95#[cfg(feature = "api-12")]
96#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
97impl ArkUI_GroupGestureMode {
98 pub const SEQUENTIAL_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(0);
99}
100#[cfg(feature = "api-12")]
101#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
102impl ArkUI_GroupGestureMode {
103 /// Parallel recognition. Registered gestures are recognized concurrently until all gestures are recognized.
104 /// The recognition result of each gesture does not affect each other.
105 pub const PARALLEL_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(1);
106}
107#[cfg(feature = "api-12")]
108#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
109impl ArkUI_GroupGestureMode {
110 /// Exclusive recognition. Registered gestures are identified concurrently.
111 /// If one gesture is successfully recognized, gesture recognition ends.
112 pub const EXCLUSIVE_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(2);
113}
114#[repr(transparent)]
115/// Enumerates gesture group modes.
116///
117///
118/// Available since API-level: 12
119#[cfg(feature = "api-12")]
120#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
121#[derive(Clone, Hash, PartialEq, Eq)]
122pub struct ArkUI_GroupGestureMode(pub ::core::ffi::c_uint);
123#[cfg(feature = "api-12")]
124#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
125impl ArkUI_GestureDirection {
126 /// All directions.
127 pub const GESTURE_DIRECTION_ALL: ArkUI_GestureDirection = ArkUI_GestureDirection(15);
128}
129#[cfg(feature = "api-12")]
130#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
131impl ArkUI_GestureDirection {
132 /// Horizontal direction.
133 pub const GESTURE_DIRECTION_HORIZONTAL: ArkUI_GestureDirection = ArkUI_GestureDirection(3);
134}
135#[cfg(feature = "api-12")]
136#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
137impl ArkUI_GestureDirection {
138 /// Vertical direction.
139 pub const GESTURE_DIRECTION_VERTICAL: ArkUI_GestureDirection = ArkUI_GestureDirection(12);
140}
141#[cfg(feature = "api-12")]
142#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
143impl ArkUI_GestureDirection {
144 /// Leftward.
145 pub const GESTURE_DIRECTION_LEFT: ArkUI_GestureDirection = ArkUI_GestureDirection(1);
146}
147#[cfg(feature = "api-12")]
148#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
149impl ArkUI_GestureDirection {
150 /// Rightward.
151 pub const GESTURE_DIRECTION_RIGHT: ArkUI_GestureDirection = ArkUI_GestureDirection(2);
152}
153#[cfg(feature = "api-12")]
154#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
155impl ArkUI_GestureDirection {
156 /// Upward.
157 pub const GESTURE_DIRECTION_UP: ArkUI_GestureDirection = ArkUI_GestureDirection(4);
158}
159#[cfg(feature = "api-12")]
160#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
161impl ArkUI_GestureDirection {
162 /// Downward.
163 pub const GESTURE_DIRECTION_DOWN: ArkUI_GestureDirection = ArkUI_GestureDirection(8);
164}
165#[cfg(feature = "api-12")]
166#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
167impl ArkUI_GestureDirection {
168 /// None.
169 pub const GESTURE_DIRECTION_NONE: ArkUI_GestureDirection = ArkUI_GestureDirection(0);
170}
171#[repr(transparent)]
172/// Enumerates gesture directions.
173///
174///
175/// Available since API-level: 12
176#[cfg(feature = "api-12")]
177#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
178#[derive(Clone, Hash, PartialEq, Eq)]
179pub struct ArkUI_GestureDirection(pub ::core::ffi::c_uint);
180/// Defines a set of gesture directions.
181///
182/// Example: ArkUI_GestureDirectionMask directions = GESTURE_DIRECTION_LEFT | GESTURE_DIRECTION_RIGHT
183///
184/// This example indicates that the leftward and rightward directions are supported.
185///
186///
187///
188/// Available since API-level: 12
189#[cfg(feature = "api-12")]
190#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
191pub type ArkUI_GestureDirectionMask = u32;
192#[cfg(feature = "api-12")]
193#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
194impl ArkUI_GestureMask {
195 /// The gestures of child components are enabled and recognized based on the default gesture recognition sequence.
196 pub const NORMAL_GESTURE_MASK: ArkUI_GestureMask = ArkUI_GestureMask(0);
197}
198#[cfg(feature = "api-12")]
199#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
200impl ArkUI_GestureMask {
201 /// The gestures of child components are disabled, including the built-in gestures.
202 pub const IGNORE_INTERNAL_GESTURE_MASK: ArkUI_GestureMask = ArkUI_GestureMask(1);
203}
204#[repr(transparent)]
205/// Enumerates gesture masking modes.
206///
207///
208/// Available since API-level: 12
209#[cfg(feature = "api-12")]
210#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
211#[derive(Clone, Hash, PartialEq, Eq)]
212pub struct ArkUI_GestureMask(pub ::core::ffi::c_uint);
213#[cfg(feature = "api-12")]
214#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
215impl ArkUI_GestureRecognizerType {
216 /// Tap.
217 pub const TAP_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(0);
218}
219#[cfg(feature = "api-12")]
220#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
221impl ArkUI_GestureRecognizerType {
222 /// Long press.
223 pub const LONG_PRESS_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(1);
224}
225#[cfg(feature = "api-12")]
226#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
227impl ArkUI_GestureRecognizerType {
228 /// Pan.
229 pub const PAN_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(2);
230}
231#[cfg(feature = "api-12")]
232#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
233impl ArkUI_GestureRecognizerType {
234 /// Pinch.
235 pub const PINCH_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(3);
236}
237#[cfg(feature = "api-12")]
238#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
239impl ArkUI_GestureRecognizerType {
240 /// Rotate.
241 pub const ROTATION_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(4);
242}
243#[cfg(feature = "api-12")]
244#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
245impl ArkUI_GestureRecognizerType {
246 /// Swipe.
247 pub const SWIPE_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(5);
248}
249#[cfg(feature = "api-12")]
250#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
251impl ArkUI_GestureRecognizerType {
252 /// A group of gestures.
253 pub const GROUP_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(6);
254}
255#[repr(transparent)]
256/// Enumerates gesture types.
257///
258///
259/// Available since API-level: 12
260#[cfg(feature = "api-12")]
261#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
262#[derive(Clone, Hash, PartialEq, Eq)]
263pub struct ArkUI_GestureRecognizerType(pub ::core::ffi::c_uint);
264#[cfg(feature = "api-12")]
265#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
266impl ArkUI_GestureInterruptResult {
267 /// The gesture recognition process continues.
268 pub const GESTURE_INTERRUPT_RESULT_CONTINUE: ArkUI_GestureInterruptResult =
269 ArkUI_GestureInterruptResult(0);
270}
271#[cfg(feature = "api-12")]
272#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
273impl ArkUI_GestureInterruptResult {
274 /// The gesture recognition process is paused.
275 pub const GESTURE_INTERRUPT_RESULT_REJECT: ArkUI_GestureInterruptResult =
276 ArkUI_GestureInterruptResult(1);
277}
278#[repr(transparent)]
279/// Enumerates gesture interruption results.
280///
281///
282/// Available since API-level: 12
283#[cfg(feature = "api-12")]
284#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
285#[derive(Clone, Hash, PartialEq, Eq)]
286pub struct ArkUI_GestureInterruptResult(pub ::core::ffi::c_uint);
287#[cfg(feature = "api-12")]
288#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
289impl ArkUI_GestureRecognizerState {
290 /// Ready.
291 pub const ARKUI_GESTURE_RECOGNIZER_STATE_READY: ArkUI_GestureRecognizerState =
292 ArkUI_GestureRecognizerState(0);
293}
294#[cfg(feature = "api-12")]
295#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
296impl ArkUI_GestureRecognizerState {
297 /// Detecting.
298 pub const ARKUI_GESTURE_RECOGNIZER_STATE_DETECTING: ArkUI_GestureRecognizerState =
299 ArkUI_GestureRecognizerState(1);
300}
301#[cfg(feature = "api-12")]
302#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
303impl ArkUI_GestureRecognizerState {
304 /// Pending.
305 pub const ARKUI_GESTURE_RECOGNIZER_STATE_PENDING: ArkUI_GestureRecognizerState =
306 ArkUI_GestureRecognizerState(2);
307}
308#[cfg(feature = "api-12")]
309#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
310impl ArkUI_GestureRecognizerState {
311 /// Blocked.
312 pub const ARKUI_GESTURE_RECOGNIZER_STATE_BLOCKED: ArkUI_GestureRecognizerState =
313 ArkUI_GestureRecognizerState(3);
314}
315#[cfg(feature = "api-12")]
316#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
317impl ArkUI_GestureRecognizerState {
318 /// Successful.
319 pub const ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL: ArkUI_GestureRecognizerState =
320 ArkUI_GestureRecognizerState(4);
321}
322#[cfg(feature = "api-12")]
323#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
324impl ArkUI_GestureRecognizerState {
325 /// Failed.
326 pub const ARKUI_GESTURE_RECOGNIZER_STATE_FAILED: ArkUI_GestureRecognizerState =
327 ArkUI_GestureRecognizerState(5);
328}
329#[repr(transparent)]
330/// Enumerates the gesture recognizer states.
331///
332///
333/// Available since API-level: 12
334#[cfg(feature = "api-12")]
335#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
336#[derive(Clone, Hash, PartialEq, Eq)]
337pub struct ArkUI_GestureRecognizerState(pub ::core::ffi::c_uint);
338/// Defines the gesture recognizer handle.
339///
340///
341/// Available since API-level: 12
342#[cfg(feature = "api-12")]
343#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
344pub type ArkUI_GestureRecognizerHandle = *mut ArkUI_GestureRecognizer;
345/// Defines the gesture recognizer handle array.
346///
347///
348/// Available since API-level: 12
349#[cfg(feature = "api-12")]
350#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
351pub type ArkUI_GestureRecognizerHandleArray = *mut ArkUI_GestureRecognizerHandle;
352#[repr(C)]
353pub struct ArkUI_GestureEventTargetInfo {
354 _unused: [u8; 0],
355}
356#[repr(C)]
357pub struct ArkUI_ParallelInnerGestureEvent {
358 _unused: [u8; 0],
359}
360/// Defines a callback function for notifying gesture recognizer destruction.
361///
362/// Available since API-level: 12
363#[cfg(feature = "api-12")]
364#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
365pub type ArkUI_GestureRecognizerDisposeNotifyCallback = ::core::option::Option<
366 unsafe extern "C" fn(
367 recognizer: *mut ArkUI_GestureRecognizer,
368 userData: *mut ::core::ffi::c_void,
369 ),
370>;
371/// Defines the gesture APIs.
372///
373///
374/// Available since API-level: 12
375#[cfg(feature = "api-12")]
376#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
377#[repr(C)]
378pub struct ArkUI_NativeGestureAPI_1 {
379 /// The struct version is 1.
380 pub version: i32,
381 /// Creates a tap gesture.
382 ///
383 /// 1. This API is used to trigger a tap gesture with one, two, or more taps.
384 ///
385 /// 2. If multi-tap is configured, the timeout interval between a lift and the next tap is 300 ms.
386 ///
387 /// 3. If the distance between the last tapped position and the current tapped position exceeds 60 vp,
388 /// gesture recognition fails.
389 ///
390 /// 4. If the value is greater than 1, the tap gesture will fail to be recognized when the number of fingers
391 /// touching the screen within 300 ms of the first finger touch is less than the required number,
392 ///
393 /// or when the number of fingers lifted from the screen within 300 ms of the first finger's being lifted
394 /// is less than the required number.
395 ///
396 /// 5. When the number of fingers touching the screen exceeds the set value, the gesture can be recognized.
397 ///
398 ///
399 /// # Arguments
400 ///
401 /// * `countNum` - Indicates the number of consecutive taps. If the value is less than 1 or is not set,
402 /// the default value <b>1</b> is used.
403 ///
404 /// * `fingersNum` - Indicates the number of fingers required to trigger a tap. The value ranges
405 /// from 1 to 10. If the value is less than 1 or is not set, the default value <b>1</b> is used.
406 ///
407 /// # Returns
408 ///
409 /// * Returns the pointer to the created gesture.
410 pub createTapGesture: ::core::option::Option<
411 unsafe extern "C" fn(countNum: i32, fingersNum: i32) -> *mut ArkUI_GestureRecognizer,
412 >,
413 /// Creates a long press gesture.
414 ///
415 /// 1. This API is used to trigger a long press gesture, which requires one or more fingers with a minimum
416 /// The value ranges 500 ms hold-down time.
417 ///
418 /// 2. In components that support drag actions by default, such as <b><Text></b>, <b><TextInput></b>,
419 /// <b><TextArea></b>, <b><Hyperlink></b>, <b><Image></b>, and <b>RichEditor></b>, the long press gesture
420 ///
421 /// may conflict with the drag action. If this occurs, they are handled as follows:
422 ///
423 /// If the minimum duration of the long press gesture is less than 500 ms, the long press gesture receives
424 /// a higher response priority than the drag action.
425 ///
426 /// If the minimum duration of the long press gesture is greater than or equal to 500 ms,
427 /// the drag action receives a higher response priority than the long press gesture.
428 ///
429 /// 3. If a finger moves more than 15 px after being pressed, the gesture recognition fails.
430 ///
431 ///
432 /// # Arguments
433 ///
434 /// * `fingersNum` - Indicates the minimum number of fingers to trigger a long press gesture.
435 /// The value ranges from 1 to 10.
436 ///
437 /// * `repeatResult` - Indicates whether to continuously trigger the event callback.
438 ///
439 /// * `durationNum` - Indicates the minimum hold-down time, in ms.
440 /// If the value is less than or equal to 0, the default value <b>500</b> is used.
441 ///
442 /// # Returns
443 ///
444 /// * Returns the pointer to the created gesture.
445 pub createLongPressGesture: ::core::option::Option<
446 unsafe extern "C" fn(
447 fingersNum: i32,
448 repeatResult: bool,
449 durationNum: i32,
450 ) -> *mut ArkUI_GestureRecognizer,
451 >,
452 /// Creates a pan gesture.
453 ///
454 /// 1. This API is used to trigger a pan gesture when the movement distance of a finger on the screen exceeds
455 /// the minimum value.
456 ///
457 /// 2. If a pan gesture and a tab swipe occur at the same time, set <b>distanceNum</b> to <b>1</b>
458 /// so that the gesture can be more easily recognized.
459 ///
460 ///
461 /// # Arguments
462 ///
463 /// * `fingersNum` - Indicates the minimum number of fingers to trigger a pan gesture. The value ranges from 1 to 10.
464 /// If the value is less than 1 or is not set, the default value <b>1</b> is used.
465 ///
466 /// * `directions` - Indicates the pan direction. The value supports the AND (&) and OR (operations.
467 ///
468 /// * `distanceNum` - Indicates the minimum pan distance to trigger the gesture, in vp. If this parameter is
469 /// set to a value less than or equal to 0, the default value <b>5</b> is used.
470 ///
471 /// # Returns
472 ///
473 /// * Returns the pointer to the created gesture.
474 pub createPanGesture: ::core::option::Option<
475 unsafe extern "C" fn(
476 fingersNum: i32,
477 directions: ArkUI_GestureDirectionMask,
478 distanceNum: f64,
479 ) -> *mut ArkUI_GestureRecognizer,
480 >,
481 /// Creates a pinch gesture.
482 ///
483 /// 1. This API is used to trigger a pinch gesture, which requires two to five fingers with a minimum 5 vp
484 /// distance between the fingers.
485 ///
486 /// 2. While more fingers than the minimum number can be pressed to trigger the gesture, only the first
487 /// fingers of the minimum number participate in gesture calculation.
488 ///
489 ///
490 /// # Arguments
491 ///
492 /// * `fingersNum` - Indicates the minimum number of fingers to trigger a pinch. The value ranges from 2 to 5.
493 /// Default value: <b>2</b>
494 ///
495 /// * `distanceNum` - Indicates the minimum recognition distance, in px. If this parameter is set to a value less
496 /// than or equal to 0, the default value <b>5</b> is used.
497 ///
498 /// # Returns
499 ///
500 /// * Returns the pointer to the created gesture.
501 pub createPinchGesture: ::core::option::Option<
502 unsafe extern "C" fn(fingersNum: i32, distanceNum: f64) -> *mut ArkUI_GestureRecognizer,
503 >,
504 /// Creates a rotation gesture.
505 ///
506 /// 1. This API is used to trigger a rotation gesture, which requires two to five fingers with a
507 /// minimum 1-degree rotation angle.
508 ///
509 /// 2. While more fingers than the minimum number can be pressed to trigger the gesture, only the first
510 /// two fingers participate in gesture calculation.
511 ///
512 ///
513 /// # Arguments
514 ///
515 /// * `fingersNum` - Indicates the minimum number of fingers to trigger a rotation. The value ranges from 2 to 5.
516 /// Default value: <b>2</b>
517 ///
518 /// * `angleNum` - Indicates the minimum degree that can trigger the rotation gesture. Default value: <b>1</b>
519 /// If this parameter is set to a value less than or equal to 0 or greater than 360,
520 /// the default value <b>1</b> is used.
521 ///
522 /// # Returns
523 ///
524 /// * Returns the pointer to the created gesture.
525 pub createRotationGesture: ::core::option::Option<
526 unsafe extern "C" fn(fingersNum: i32, angleNum: f64) -> *mut ArkUI_GestureRecognizer,
527 >,
528 /// Creates a swipe gesture.
529 ///
530 /// This API is used to implement a swipe gesture, which can be recognized when the swipe speed is 100
531 /// vp/s or higher.
532 ///
533 ///
534 /// # Arguments
535 ///
536 /// * `fingersNum` - Indicates the minimum number of fingers to trigger a swipe gesture.
537 /// The value ranges from 1 to 10.
538 ///
539 /// * `directions` - Indicates the swipe direction.
540 ///
541 /// * `speedNum` - Indicates the minimum speed of the swipe gesture, in px/s.
542 /// If this parameter is set to a value less than or equal to 0, the default value <b>100</b> is used.
543 ///
544 /// # Returns
545 ///
546 /// * Returns the pointer to the created gesture.
547 pub createSwipeGesture: ::core::option::Option<
548 unsafe extern "C" fn(
549 fingersNum: i32,
550 directions: ArkUI_GestureDirectionMask,
551 speedNum: f64,
552 ) -> *mut ArkUI_GestureRecognizer,
553 >,
554 /// Creates a gesture group.
555 ///
556 /// # Arguments
557 ///
558 /// * `gestureMode` - Indicates the gesture group mode.
559 ///
560 /// # Returns
561 ///
562 /// * Returns the pointer to the created gesture group.
563 pub createGroupGesture: ::core::option::Option<
564 unsafe extern "C" fn(gestureMode: ArkUI_GroupGestureMode) -> *mut ArkUI_GestureRecognizer,
565 >,
566 /// Disposes a gesture to release resources.
567 ///
568 /// # Arguments
569 ///
570 /// * `recognizer` - Indicates the pointer to the gesture to dispose.
571 pub dispose:
572 ::core::option::Option<unsafe extern "C" fn(recognizer: *mut ArkUI_GestureRecognizer)>,
573 /// Adds a gesture to a gesture group.
574 ///
575 /// # Arguments
576 ///
577 /// * `group` - Indicates the pointer to the gesture group.
578 ///
579 /// * `child` - Indicates the gesture to be added to the gesture group.
580 ///
581 /// # Returns
582 ///
583 /// * Returns <b>0</b> if success.
584 /// Returns <b>401</b> if a parameter exception occurs. Returns 401 if a parameter exception occurs.
585 pub addChildGesture: ::core::option::Option<
586 unsafe extern "C" fn(
587 group: *mut ArkUI_GestureRecognizer,
588 child: *mut ArkUI_GestureRecognizer,
589 ) -> i32,
590 >,
591 /// Removes a gesture to a gesture group.
592 ///
593 /// # Arguments
594 ///
595 /// * `group` - Indicates the pointer to the gesture group.
596 ///
597 /// * `child` - Indicates the gesture to be removed to the gesture group.
598 ///
599 /// # Returns
600 ///
601 /// * Returns <b>0</b> if success.
602 /// Returns <b>401</b> if a parameter exception occurs.
603 pub removeChildGesture: ::core::option::Option<
604 unsafe extern "C" fn(
605 group: *mut ArkUI_GestureRecognizer,
606 child: *mut ArkUI_GestureRecognizer,
607 ) -> i32,
608 >,
609 /// Registers a callback for gestures.
610 ///
611 /// # Arguments
612 ///
613 /// * `recognizer` - Indicates the pointer to the gesture recognizer.
614 ///
615 /// * `actionTypeMask` - Indicates the set of gesture event types. Multiple callbacks can be registered at once,
616 /// with the callback event types distinguished in the callbacks.
617 /// Example: actionTypeMask = GESTURE_EVENT_ACTION_ACCEPT | GESTURE_EVENT_ACTION_UPDATE;
618 ///
619 /// * `extraParams` - Indicates the context passed in the <b>targetReceiver</b> callback.
620 ///
621 /// * `targetReceiver` - Indicates the callback to register for processing the gesture event types.
622 /// <b>event</b> indicates the gesture callback data.
623 ///
624 /// # Returns
625 ///
626 /// * Returns <b>0</b> if success.
627 /// Returns <b>401</b> if a parameter exception occurs.
628 pub setGestureEventTarget: ::core::option::Option<
629 unsafe extern "C" fn(
630 recognizer: *mut ArkUI_GestureRecognizer,
631 actionTypeMask: ArkUI_GestureEventActionTypeMask,
632 extraParams: *mut ::core::ffi::c_void,
633 targetReceiver: ::core::option::Option<
634 unsafe extern "C" fn(
635 event: *mut ArkUI_GestureEvent,
636 extraParams: *mut ::core::ffi::c_void,
637 ),
638 >,
639 ) -> i32,
640 >,
641 /// Adds a gesture to a UI component.
642 ///
643 /// # Arguments
644 ///
645 /// * `node` - Indicates the UI component to which you want to add the gesture.
646 ///
647 /// * `recognizer` - Indicates the gesture to be added to the UI component.
648 ///
649 /// * `mode` - Indicates the gesture event mode. Available options are <b>NORMAL_GESTURE</b>,
650 /// <b>PARALLEL_GESTURE</b>, and <b>PRIORITY_GESTURE</b>.
651 ///
652 /// * `mask` - Indicates the gesture masking mode.
653 ///
654 /// # Returns
655 ///
656 /// * Returns <b>0</b> if success.
657 /// Returns <b>401</b> if a parameter exception occurs.
658 pub addGestureToNode: ::core::option::Option<
659 unsafe extern "C" fn(
660 node: ArkUI_NodeHandle,
661 recognizer: *mut ArkUI_GestureRecognizer,
662 mode: ArkUI_GesturePriority,
663 mask: ArkUI_GestureMask,
664 ) -> i32,
665 >,
666 /// Removes a gesture from a node.
667 ///
668 /// # Arguments
669 ///
670 /// * `node` - Indicates the node from which you want to remove the gesture.
671 ///
672 /// * `recognizer` - Indicates the gesture to be removed.
673 ///
674 /// # Returns
675 ///
676 /// * Returns <b>0</b> if success.
677 /// Returns <b>401</b> if a parameter exception occurs.
678 pub removeGestureFromNode: ::core::option::Option<
679 unsafe extern "C" fn(
680 node: ArkUI_NodeHandle,
681 recognizer: *mut ArkUI_GestureRecognizer,
682 ) -> i32,
683 >,
684 /// Sets a gesture interruption callback for a node.
685 ///
686 /// # Arguments
687 ///
688 /// * `node` - Indicates the node for which you want to set a gesture interruption callback.
689 ///
690 /// * `interrupter` - Indicates the gesture interruption callback to set.
691 /// <b>info</b> indicates the gesture interruption data. If <b>interrupter</b> returns
692 /// <b>GESTURE_INTERRUPT_RESULT_CONTINUE</b>, the gesture recognition process continues. If it returns
693 /// <b>GESTURE_INTERRUPT_RESULT_REJECT</b>, the gesture recognition process is paused.
694 ///
695 /// # Returns
696 ///
697 /// * Returns <b>0</b> if success.
698 /// Returns <b>401</b> if a parameter exception occurs.
699 pub setGestureInterrupterToNode: ::core::option::Option<
700 unsafe extern "C" fn(
701 node: ArkUI_NodeHandle,
702 interrupter: ::core::option::Option<
703 unsafe extern "C" fn(
704 info: *mut ArkUI_GestureInterruptInfo,
705 ) -> ArkUI_GestureInterruptResult,
706 >,
707 ) -> i32,
708 >,
709 /// Obtains the type of a gesture.
710 ///
711 /// # Arguments
712 ///
713 /// * `recognizer` - Indicates the pointer to the gesture.
714 ///
715 /// # Returns
716 ///
717 /// * Returns the gesture type.
718 pub getGestureType: ::core::option::Option<
719 unsafe extern "C" fn(
720 recognizer: *mut ArkUI_GestureRecognizer,
721 ) -> ArkUI_GestureRecognizerType,
722 >,
723 /// Sets the callback function for a parallel internal gesture event.
724 ///
725 /// # Arguments
726 ///
727 /// * `node` - Indicates the ArkUI node for which the callback of a parallel internal gesture event is to be set.
728 ///
729 /// * `userData` - Indicates the custom data.
730 ///
731 /// * `parallelInnerGesture` - Indicates the parallel internal gesture event. <b>event</b> returns the data of the
732 /// parallel internal gesture event; <b>parallelInnerGesture</b> returns the pointer to the gesture recognizer
733 /// that requires parallel recognition.
734 ///
735 /// # Returns
736 ///
737 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
738 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
739 pub setInnerGestureParallelTo: ::core::option::Option<
740 unsafe extern "C" fn(
741 node: ArkUI_NodeHandle,
742 userData: *mut ::core::ffi::c_void,
743 parallelInnerGesture: ::core::option::Option<
744 unsafe extern "C" fn(
745 event: *mut ArkUI_ParallelInnerGestureEvent,
746 ) -> *mut ArkUI_GestureRecognizer,
747 >,
748 ) -> i32,
749 >,
750 /// Creates a tap gesture that is subject to distance restrictions.
751 ///
752 /// 1. This API is used to trigger a tap gesture with one, two, or more taps.
753 ///
754 /// 2. If multi-tap is configured, the timeout interval between a lift and the next tap is 300 ms.
755 ///
756 /// 3. If the distance between the last tapped position and the current tapped position exceeds 60 vp,
757 /// gesture recognition fails.
758 ///
759 /// 4. If the value is greater than 1, the tap gesture will fail to be recognized when the number of fingers
760 /// touching the screen within 300 ms of the first finger touch is less than the required number,
761 /// or when the number of fingers lifted from the screen within 300 ms of the first finger's being lifted
762 /// is less than the required number.
763 ///
764 /// 5. When the number of fingers touching the screen exceeds the set value, the gesture can be recognized.
765 ///
766 /// 6. If the finger moves beyond the preset distance limit, gesture recognition fails.
767 ///
768 ///
769 /// # Arguments
770 ///
771 /// * `countNum` - Indicates the number of consecutive taps. If the value is less than 1 or is not set, the default
772 /// value <b>1</b> is used.
773 ///
774 /// * `fingersNum` - Indicates the number of fingers required to trigger a tap. The value ranges from 1 to 10.
775 /// If the value is less than 1 or is not set, the default value <b>1</b> is used.
776 ///
777 /// * `distanceThreshold` - Indicates the allowed moving distance of a finger.
778 /// If the value is less than 0 or is not set, it will be converted to the default value of infinity.
779 ///
780 /// # Returns
781 ///
782 /// * Returns the pointer to the created gesture.
783 pub createTapGestureWithDistanceThreshold: ::core::option::Option<
784 unsafe extern "C" fn(
785 countNum: i32,
786 fingersNum: i32,
787 distanceThreshold: f64,
788 ) -> *mut ArkUI_GestureRecognizer,
789 >,
790}
791extern "C" {
792 /// Checks whether a gesture is a built-in gesture of the component.
793 ///
794 /// # Arguments
795 ///
796 /// * `event` - Indicates the pointer to the gesture interruption information.
797 ///
798 /// # Returns
799 ///
800 /// * Returns <b>true</b> if the gesture is a built-in gesture; returns <b>false</b> otherwise.
801 ///
802 ///
803 /// Available since API-level: 12
804 #[cfg(feature = "api-12")]
805 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
806 pub fn OH_ArkUI_GestureInterruptInfo_GetSystemFlag(
807 event: *const ArkUI_GestureInterruptInfo,
808 ) -> bool;
809 /// Obtains the pointer to interrupted gesture recognizer.
810 ///
811 /// # Arguments
812 ///
813 /// * `event` - Indicates the pointer to the gesture interruption information.
814 ///
815 /// # Returns
816 ///
817 /// * Returns the pointer to interrupted gesture recognizer.
818 ///
819 /// Available since API-level: 12
820 #[cfg(feature = "api-12")]
821 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
822 pub fn OH_ArkUI_GestureInterruptInfo_GetRecognizer(
823 event: *const ArkUI_GestureInterruptInfo,
824 ) -> *mut ArkUI_GestureRecognizer;
825 /// Obtains the pointer to the interrupted gesture event.
826 ///
827 /// # Arguments
828 ///
829 /// * `event` - Indicates the pointer to the gesture interruption information.
830 ///
831 /// # Returns
832 ///
833 /// * Returns the pointer to the interrupted gesture event.
834 ///
835 /// Available since API-level: 12
836 #[cfg(feature = "api-12")]
837 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
838 pub fn OH_ArkUI_GestureInterruptInfo_GetGestureEvent(
839 event: *const ArkUI_GestureInterruptInfo,
840 ) -> *mut ArkUI_GestureEvent;
841 /// Obtains the type of the system gesture to trigger.
842 ///
843 /// # Arguments
844 ///
845 /// * `event` - Indicates the pointer to the gesture interruption information.
846 ///
847 /// # Returns
848 ///
849 /// * Returns the type of the system gesture to trigger. If the gesture to trigger is not a system gesture,
850 /// <b>-1</b> is returned.
851 ///
852 /// Available since API-level: 12
853 #[cfg(feature = "api-12")]
854 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
855 pub fn OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType(
856 event: *const ArkUI_GestureInterruptInfo,
857 ) -> i32;
858 /// Obtains the gesture event type.
859 ///
860 /// # Arguments
861 ///
862 /// * `event` - Indicates the pointer to the gesture event.
863 ///
864 /// # Returns
865 ///
866 /// * Returns the gesture event type.
867 ///
868 /// Available since API-level: 12
869 #[cfg(feature = "api-12")]
870 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
871 pub fn OH_ArkUI_GestureEvent_GetActionType(
872 event: *const ArkUI_GestureEvent,
873 ) -> ArkUI_GestureEventActionType;
874 /// Obtains gesture input.
875 ///
876 /// # Arguments
877 ///
878 /// * `event` - Indicates the pointer to the gesture event.
879 ///
880 /// # Returns
881 ///
882 /// * Returns the pointer to the input event of the gesture event.
883 ///
884 /// Available since API-level: 12
885 #[cfg(feature = "api-12")]
886 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
887 pub fn OH_ArkUI_GestureEvent_GetRawInputEvent(
888 event: *const ArkUI_GestureEvent,
889 ) -> *const ArkUI_UIInputEvent;
890 /// Obtains the number of times that a long press gesture is triggered periodically.
891 ///
892 /// # Arguments
893 ///
894 /// * `event` - Indicates the pointer to the gesture event.
895 ///
896 /// # Returns
897 ///
898 /// * Returns the number of times that the long press gesture is triggered periodically.
899 ///
900 /// Available since API-level: 12
901 #[cfg(feature = "api-12")]
902 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
903 pub fn OH_ArkUI_LongPress_GetRepeatCount(event: *const ArkUI_GestureEvent) -> i32;
904 /// Obtains the velocity of a pan gesture along the main axis.
905 ///
906 /// # Arguments
907 ///
908 /// * `event` - Indicates the pointer to the gesture event.
909 ///
910 /// # Returns
911 ///
912 /// * Returns the velocity of the pan gesture along the main axis, in px/s.
913 /// The value is the square root of the sum of the squares of the velocity on the x-axis and y-axis.
914 ///
915 /// Available since API-level: 12
916 #[cfg(feature = "api-12")]
917 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
918 pub fn OH_ArkUI_PanGesture_GetVelocity(event: *const ArkUI_GestureEvent) -> f32;
919 /// Obtains the velocity of a pan gesture along the x-axis.
920 ///
921 /// # Arguments
922 ///
923 /// * `event` - Indicates the pointer to the gesture event.
924 ///
925 /// # Returns
926 ///
927 /// * Returns the velocity of the pan gesture along the x-axis, in px/s.
928 ///
929 /// Available since API-level: 12
930 #[cfg(feature = "api-12")]
931 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
932 pub fn OH_ArkUI_PanGesture_GetVelocityX(event: *const ArkUI_GestureEvent) -> f32;
933 /// Obtains the velocity of a pan gesture along the y-axis.
934 ///
935 /// # Arguments
936 ///
937 /// * `event` - Indicates the pointer to the gesture event.
938 ///
939 /// # Returns
940 ///
941 /// * Returns the velocity of the pan gesture along the y-axis, in px/s.
942 ///
943 /// Available since API-level: 12
944 #[cfg(feature = "api-12")]
945 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
946 pub fn OH_ArkUI_PanGesture_GetVelocityY(event: *const ArkUI_GestureEvent) -> f32;
947 /// Obtains the relative offset of a pan gesture along the x-axis.
948 ///
949 /// # Arguments
950 ///
951 /// * `event` - Indicates the pointer to the gesture event.
952 ///
953 /// # Returns
954 ///
955 /// * Returns the relative offset of the gesture along the x-axis, in px.
956 ///
957 /// Available since API-level: 12
958 #[cfg(feature = "api-12")]
959 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
960 pub fn OH_ArkUI_PanGesture_GetOffsetX(event: *const ArkUI_GestureEvent) -> f32;
961 /// Obtains the relative offset of a pan gesture along the y-axis.
962 ///
963 /// # Arguments
964 ///
965 /// * `event` - Indicates the pointer to the gesture event.
966 ///
967 /// # Returns
968 ///
969 /// * Returns the relative offset of the gesture along the y-axis, in px.
970 ///
971 /// Available since API-level: 12
972 #[cfg(feature = "api-12")]
973 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
974 pub fn OH_ArkUI_PanGesture_GetOffsetY(event: *const ArkUI_GestureEvent) -> f32;
975 /// Obtains the angle information of the swipe gesture.
976 ///
977 /// After a swipe gesture is recognized, a line connecting the two fingers is identified as the initial line.
978 /// As the fingers swipe, the line between the fingers rotates.
979 ///
980 /// Based on the coordinates of the initial line's and current line's end points, the arc tangent function is used to
981 /// calculate the respective included angle of the points relative to the horizontal direction
982 ///
983 /// by using the following formula: Rotation angle = arctan2(cy2-cy1,cx2-cx1) - arctan2(y2-y1,x2-x1).
984 ///
985 /// The initial line is used as the coordinate system. Values from 0 to 180 degrees represent clockwise rotation,
986 /// while values from –180 to 0 degrees represent counterclockwise rotation.
987 ///
988 ///
989 /// # Arguments
990 ///
991 /// * `event` - Indicates the pointer to the gesture event.
992 ///
993 /// # Returns
994 ///
995 /// * Returns the angle of the swipe gesture, which is the result obtained based on the aforementioned formula.
996 ///
997 /// Available since API-level: 12
998 #[cfg(feature = "api-12")]
999 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1000 pub fn OH_ArkUI_SwipeGesture_GetAngle(event: *const ArkUI_GestureEvent) -> f32;
1001 /// Obtains the average velocity of all fingers used in the swipe gesture.
1002 ///
1003 /// # Arguments
1004 ///
1005 /// * `event` - Indicates the pointer to the gesture event.
1006 ///
1007 /// # Returns
1008 ///
1009 /// * Returns the average velocity of all fingers used in the swipe gesture, in px/s.
1010 ///
1011 /// Available since API-level: 12
1012 #[cfg(feature = "api-12")]
1013 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1014 pub fn OH_ArkUI_SwipeGesture_GetVelocity(event: *const ArkUI_GestureEvent) -> f32;
1015 /// Obtains the angle information of a rotation gesture.
1016 ///
1017 /// # Arguments
1018 ///
1019 /// * `event` - Indicates the pointer to the gesture event.
1020 ///
1021 /// # Returns
1022 ///
1023 /// * Returns the rotation angle.
1024 ///
1025 /// Available since API-level: 12
1026 #[cfg(feature = "api-12")]
1027 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1028 pub fn OH_ArkUI_RotationGesture_GetAngle(event: *const ArkUI_GestureEvent) -> f32;
1029 /// Obtains the scale ratio of a pinch gesture.
1030 ///
1031 /// # Arguments
1032 ///
1033 /// * `event` - Indicates the pointer to the gesture event.
1034 ///
1035 /// # Returns
1036 ///
1037 /// * Returns the scale ratio.
1038 ///
1039 /// Available since API-level: 12
1040 #[cfg(feature = "api-12")]
1041 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1042 pub fn OH_ArkUI_PinchGesture_GetScale(event: *const ArkUI_GestureEvent) -> f32;
1043 /// Obtains the X coordinate of the center of the pinch gesture, in vp,
1044 /// relative to the upper left corner of the current component.
1045 ///
1046 /// # Arguments
1047 ///
1048 /// * `event` - Indicates the pointer to the gesture event.
1049 ///
1050 /// # Returns
1051 ///
1052 /// * Returns the X coordinate of the center of the pinch gesture, in vp,
1053 /// relative to the upper left corner of the current component.
1054 ///
1055 /// Available since API-level: 12
1056 #[cfg(feature = "api-12")]
1057 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1058 pub fn OH_ArkUI_PinchGesture_GetCenterX(event: *const ArkUI_GestureEvent) -> f32;
1059 /// Obtains the Y coordinate of the center of the pinch gesture, in vp,
1060 /// relative to the upper left corner of the current component.
1061 ///
1062 /// # Arguments
1063 ///
1064 /// * `event` - Indicates the pointer to the gesture event.
1065 ///
1066 /// # Returns
1067 ///
1068 /// * Returns the Y coordinate of the center of the pinch gesture, in vp,
1069 /// relative to the upper left corner of the current component.
1070 ///
1071 /// Available since API-level: 12
1072 #[cfg(feature = "api-12")]
1073 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1074 pub fn OH_ArkUI_PinchGesture_GetCenterY(event: *const ArkUI_GestureEvent) -> f32;
1075 /// Obtains information about a gesture response chain.
1076 ///
1077 /// # Arguments
1078 ///
1079 /// * `event` - Indicates the pointer to the gesture interruption information.
1080 ///
1081 /// * `responseChain` - Indicates the pointer to an array of gesture recognizers on the response chain.
1082 ///
1083 /// * `count` - Indicates the pointer to the number of gesture recognizers on the response chain.
1084 ///
1085 /// # Returns
1086 ///
1087 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1088 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1089 ///
1090 /// Available since API-level: 12
1091 #[cfg(feature = "api-12")]
1092 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1093 pub fn OH_ArkUI_GetResponseRecognizersFromInterruptInfo(
1094 event: *const ArkUI_GestureInterruptInfo,
1095 responseChain: *mut ArkUI_GestureRecognizerHandleArray,
1096 count: *mut i32,
1097 ) -> i32;
1098 /// Sets the enabled state of a gesture recognizer.
1099 ///
1100 /// # Arguments
1101 ///
1102 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1103 ///
1104 /// * `enabled` - Indicates the enabled state.
1105 ///
1106 /// # Returns
1107 ///
1108 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1109 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1110 ///
1111 /// Available since API-level: 12
1112 #[cfg(feature = "api-12")]
1113 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1114 pub fn OH_ArkUI_SetGestureRecognizerEnabled(
1115 recognizer: *mut ArkUI_GestureRecognizer,
1116 enabled: bool,
1117 ) -> i32;
1118 /// Obtains the enabled state of a gesture recognizer.
1119 ///
1120 /// # Arguments
1121 ///
1122 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1123 ///
1124 /// # Returns
1125 ///
1126 /// * Returns <b>true</b> if the gesture recognizer is enabled.
1127 /// Returns <b>false</b> if the gesture recognizer is disabled.
1128 ///
1129 /// Available since API-level: 12
1130 #[cfg(feature = "api-12")]
1131 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1132 pub fn OH_ArkUI_GetGestureRecognizerEnabled(recognizer: *mut ArkUI_GestureRecognizer) -> bool;
1133 /// Obtains the state of a gesture recognizer.
1134 ///
1135 /// # Arguments
1136 ///
1137 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1138 ///
1139 /// * `state` - Indicates the pointer to the state of the gesture recognizer.
1140 ///
1141 /// # Returns
1142 ///
1143 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1144 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1145 ///
1146 /// Available since API-level: 12
1147 #[cfg(feature = "api-12")]
1148 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1149 pub fn OH_ArkUI_GetGestureRecognizerState(
1150 recognizer: *mut ArkUI_GestureRecognizer,
1151 state: *mut ArkUI_GestureRecognizerState,
1152 ) -> i32;
1153 /// Obtains the information about a gesture event target.
1154 ///
1155 /// # Arguments
1156 ///
1157 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1158 ///
1159 /// * `info` - Indicates the information about a gesture event target.
1160 ///
1161 /// # Returns
1162 ///
1163 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1164 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1165 ///
1166 /// Available since API-level: 12
1167 #[cfg(feature = "api-12")]
1168 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1169 pub fn OH_ArkUI_GetGestureEventTargetInfo(
1170 recognizer: *mut ArkUI_GestureRecognizer,
1171 info: *mut *mut ArkUI_GestureEventTargetInfo,
1172 ) -> i32;
1173 /// Obtains whether this scroll container is scrolled to the top.
1174 ///
1175 /// # Arguments
1176 ///
1177 /// * `info` - Indicates the information about a gesture event target.
1178 ///
1179 /// * `ret` - Indicates whether the scroll container is scrolled to the top.
1180 ///
1181 /// # Returns
1182 ///
1183 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1184 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1185 /// Returns [`ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER`] if the component is not a scroll container.
1186 ///
1187 /// Available since API-level: 12
1188 #[cfg(feature = "api-12")]
1189 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1190 pub fn OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(
1191 info: *mut ArkUI_GestureEventTargetInfo,
1192 ret: *mut bool,
1193 ) -> i32;
1194 /// Obtains whether this scroll container is scrolled to the bottom.
1195 ///
1196 /// # Arguments
1197 ///
1198 /// * `info` - Indicates the information about a gesture event target.
1199 ///
1200 /// * `ret` - Indicates whether the scroll container is scrolled to the bottom.
1201 ///
1202 /// # Returns
1203 ///
1204 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1205 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1206 /// Returns [`ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER`] if the component is not a scroll container.
1207 ///
1208 /// Available since API-level: 12
1209 #[cfg(feature = "api-12")]
1210 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1211 pub fn OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(
1212 info: *mut ArkUI_GestureEventTargetInfo,
1213 ret: *mut bool,
1214 ) -> i32;
1215 /// Obtains the direction of a pan gesture.
1216 ///
1217 /// # Arguments
1218 ///
1219 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1220 ///
1221 /// * `directionMask` - Indicates the pan direction.
1222 ///
1223 /// # Returns
1224 ///
1225 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1226 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1227 ///
1228 /// Available since API-level: 12
1229 #[cfg(feature = "api-12")]
1230 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1231 pub fn OH_ArkUI_GetPanGestureDirectionMask(
1232 recognizer: *mut ArkUI_GestureRecognizer,
1233 directionMask: *mut ArkUI_GestureDirectionMask,
1234 ) -> i32;
1235 /// Obtains whether a gesture is a built-in gesture.
1236 ///
1237 /// # Arguments
1238 ///
1239 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1240 ///
1241 /// # Returns
1242 ///
1243 /// * Returns <b>true</b> if the gesture is a built-in gesture; returns <b>false</b> otherwise.
1244 ///
1245 /// Available since API-level: 12
1246 #[cfg(feature = "api-12")]
1247 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1248 pub fn OH_ArkUI_IsBuiltInGesture(recognizer: *mut ArkUI_GestureRecognizer) -> bool;
1249 /// Obtains the tag of a gesture recognizer.
1250 ///
1251 /// # Arguments
1252 ///
1253 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1254 ///
1255 /// * `buffer` - Indicates the buffer.
1256 ///
1257 /// * `bufferSize` - Indicates the buffer size.
1258 ///
1259 /// * `result` - Indicates the length of the string to be written to the buffer.
1260 ///
1261 /// # Returns
1262 ///
1263 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1264 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1265 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH`] if the buffer is not large enough.
1266 ///
1267 /// Available since API-level: 12
1268 #[cfg(feature = "api-12")]
1269 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1270 pub fn OH_ArkUI_GetGestureTag(
1271 recognizer: *mut ArkUI_GestureRecognizer,
1272 buffer: *mut ::core::ffi::c_char,
1273 bufferSize: i32,
1274 result: *mut i32,
1275 ) -> i32;
1276 /// Obtains the ID of the component linked to a gesture recognizer.
1277 ///
1278 /// # Arguments
1279 ///
1280 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1281 ///
1282 /// * `nodeId` - Indicates the component ID.
1283 ///
1284 /// * `size` - Indicates the buffer size.
1285 ///
1286 /// * `result` - Indicates the length of the string to be written to the buffer.
1287 ///
1288 /// # Returns
1289 ///
1290 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1291 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1292 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH`] if the buffer is not large enough.
1293 ///
1294 /// Available since API-level: 12
1295 #[cfg(feature = "api-12")]
1296 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1297 pub fn OH_ArkUI_GetGestureBindNodeId(
1298 recognizer: *mut ArkUI_GestureRecognizer,
1299 nodeId: *mut ::core::ffi::c_char,
1300 size: i32,
1301 result: *mut i32,
1302 ) -> i32;
1303 /// Obtains whether a gesture recognizer is valid.
1304 ///
1305 /// # Arguments
1306 ///
1307 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1308 ///
1309 /// # Returns
1310 ///
1311 /// * Returns <b>true</b> if the gesture recognizer is valid.
1312 /// Returns <b>false</b> if the gesture recognizer is invalid.
1313 ///
1314 /// Available since API-level: 12
1315 #[cfg(feature = "api-12")]
1316 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1317 pub fn OH_ArkUI_IsGestureRecognizerValid(recognizer: *mut ArkUI_GestureRecognizer) -> bool;
1318 /// Obtains custom data in the parallel internal gesture event.
1319 ///
1320 /// # Arguments
1321 ///
1322 /// * `event` - Indicates the pointer to a parallel internal gesture event.
1323 ///
1324 /// # Returns
1325 ///
1326 /// * Returns the pointer to custom data.
1327 ///
1328 /// Available since API-level: 12
1329 #[cfg(feature = "api-12")]
1330 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1331 pub fn OH_ArkUI_ParallelInnerGestureEvent_GetUserData(
1332 event: *mut ArkUI_ParallelInnerGestureEvent,
1333 ) -> *mut ::core::ffi::c_void;
1334 /// Obtains the current gesture recognizer in a parallel internal gesture event.
1335 ///
1336 /// # Arguments
1337 ///
1338 /// * `event` - Indicates the pointer to a parallel internal gesture event.
1339 ///
1340 /// # Returns
1341 ///
1342 /// * Returns the pointer to the current gesture recognizer.
1343 ///
1344 /// Available since API-level: 12
1345 #[cfg(feature = "api-12")]
1346 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1347 pub fn OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer(
1348 event: *mut ArkUI_ParallelInnerGestureEvent,
1349 ) -> *mut ArkUI_GestureRecognizer;
1350 /// Obtains the conflicting gesture recognizers in a parallel internal gesture event.
1351 ///
1352 /// # Arguments
1353 ///
1354 /// * `event` - Indicates the pointer to a parallel internal gesture event.
1355 ///
1356 /// * `array` - Indicates the pointer to the array of conflicting gesture recognizers.
1357 ///
1358 /// * `size` - Indicates the size of the array of conflicting gesture recognizers.
1359 ///
1360 /// # Returns
1361 ///
1362 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1363 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1364 ///
1365 /// Available since API-level: 12
1366 #[cfg(feature = "api-12")]
1367 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1368 pub fn OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(
1369 event: *mut ArkUI_ParallelInnerGestureEvent,
1370 array: *mut ArkUI_GestureRecognizerHandleArray,
1371 size: *mut i32,
1372 ) -> i32;
1373 /// Sets a callback function for notifying gesture recognizer destruction.
1374 ///
1375 /// # Arguments
1376 ///
1377 /// * `recognizer` - Indicates the pointer to a gesture recognizer.
1378 ///
1379 /// * `callback` - Indicates the callback function for notifying gesture recognizer destruction.
1380 ///
1381 /// * `userData` - Indicates the custom data.
1382 ///
1383 /// # Returns
1384 ///
1385 /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if success.
1386 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
1387 ///
1388 /// Available since API-level: 12
1389 #[cfg(feature = "api-12")]
1390 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1391 pub fn OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify(
1392 recognizer: *mut ArkUI_GestureRecognizer,
1393 callback: ArkUI_GestureRecognizerDisposeNotifyCallback,
1394 userData: *mut ::core::ffi::c_void,
1395 ) -> i32;
1396}