arkui_sys/native_gesture/native_gesture_api12.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
/* automatically generated by rust-bindgen 0.70.1 */
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::native_type::*;
use crate::ui_input_event::ArkUI_UIInputEvent;
#[repr(C)]
pub struct ArkUI_GestureRecognizer {
_unused: [u8; 0],
}
#[repr(C)]
pub struct ArkUI_GestureInterruptInfo {
_unused: [u8; 0],
}
#[repr(C)]
pub struct ArkUI_GestureEvent {
_unused: [u8; 0],
}
impl ArkUI_GestureEventActionType {
/// Triggered.
pub const GESTURE_EVENT_ACTION_ACCEPT: ArkUI_GestureEventActionType =
ArkUI_GestureEventActionType(1);
}
impl ArkUI_GestureEventActionType {
/// Updated.
pub const GESTURE_EVENT_ACTION_UPDATE: ArkUI_GestureEventActionType =
ArkUI_GestureEventActionType(2);
}
impl ArkUI_GestureEventActionType {
/// Ended.
pub const GESTURE_EVENT_ACTION_END: ArkUI_GestureEventActionType =
ArkUI_GestureEventActionType(4);
}
impl ArkUI_GestureEventActionType {
/// Canceled.
pub const GESTURE_EVENT_ACTION_CANCEL: ArkUI_GestureEventActionType =
ArkUI_GestureEventActionType(8);
}
#[repr(transparent)]
/** @brief Enumerates gesture event types.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GestureEventActionType(pub ::core::ffi::c_uint);
/** @brief Defines a set of gesture event types.
Example: ArkUI_GestureEventActionTypeMask actions = GESTURE_EVENT_ACTION_ACCEPT | GESTURE_EVENT_ACTION_UPDATE;\n
@since 12*/
pub type ArkUI_GestureEventActionTypeMask = u32;
impl ArkUI_GesturePriority {
/// Normal.
pub const NORMAL: ArkUI_GesturePriority = ArkUI_GesturePriority(0);
}
impl ArkUI_GesturePriority {
/// High-priority.
pub const PRIORITY: ArkUI_GesturePriority = ArkUI_GesturePriority(1);
}
impl ArkUI_GesturePriority {
/// Parallel.
pub const PARALLEL: ArkUI_GesturePriority = ArkUI_GesturePriority(2);
}
#[repr(transparent)]
/** @brief Enumerates gesture event modes.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GesturePriority(pub ::core::ffi::c_uint);
impl ArkUI_GroupGestureMode {
pub const SEQUENTIAL_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(0);
}
impl ArkUI_GroupGestureMode {
/** Parallel recognition. Registered gestures are recognized concurrently until all gestures are recognized.
The recognition result of each gesture does not affect each other.*/
pub const PARALLEL_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(1);
}
impl ArkUI_GroupGestureMode {
/** Exclusive recognition. Registered gestures are identified concurrently.
If one gesture is successfully recognized, gesture recognition ends.*/
pub const EXCLUSIVE_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(2);
}
#[repr(transparent)]
/** @brief Enumerates gesture group modes.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GroupGestureMode(pub ::core::ffi::c_uint);
impl ArkUI_GestureDirection {
/// All directions.
pub const GESTURE_DIRECTION_ALL: ArkUI_GestureDirection = ArkUI_GestureDirection(15);
}
impl ArkUI_GestureDirection {
/// Horizontal direction.
pub const GESTURE_DIRECTION_HORIZONTAL: ArkUI_GestureDirection = ArkUI_GestureDirection(3);
}
impl ArkUI_GestureDirection {
/// Vertical direction.
pub const GESTURE_DIRECTION_VERTICAL: ArkUI_GestureDirection = ArkUI_GestureDirection(12);
}
impl ArkUI_GestureDirection {
/// Leftward.
pub const GESTURE_DIRECTION_LEFT: ArkUI_GestureDirection = ArkUI_GestureDirection(1);
}
impl ArkUI_GestureDirection {
/// Rightward.
pub const GESTURE_DIRECTION_RIGHT: ArkUI_GestureDirection = ArkUI_GestureDirection(2);
}
impl ArkUI_GestureDirection {
/// Upward.
pub const GESTURE_DIRECTION_UP: ArkUI_GestureDirection = ArkUI_GestureDirection(4);
}
impl ArkUI_GestureDirection {
/// Downward.
pub const GESTURE_DIRECTION_DOWN: ArkUI_GestureDirection = ArkUI_GestureDirection(8);
}
impl ArkUI_GestureDirection {
/// None.
pub const GESTURE_DIRECTION_NONE: ArkUI_GestureDirection = ArkUI_GestureDirection(0);
}
#[repr(transparent)]
/** @brief Enumerates gesture directions.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GestureDirection(pub ::core::ffi::c_uint);
/** @brief Defines a set of gesture directions.
Example: ArkUI_GestureDirectionMask directions = GESTURE_DIRECTION_LEFT | GESTURE_DIRECTION_RIGHT \n
This example indicates that the leftward and rightward directions are supported. \n
@since 12*/
pub type ArkUI_GestureDirectionMask = u32;
impl ArkUI_GestureMask {
/// The gestures of child components are enabled and recognized based on the default gesture recognition sequence.
pub const NORMAL_GESTURE_MASK: ArkUI_GestureMask = ArkUI_GestureMask(0);
}
impl ArkUI_GestureMask {
/// The gestures of child components are disabled, including the built-in gestures.
pub const IGNORE_INTERNAL_GESTURE_MASK: ArkUI_GestureMask = ArkUI_GestureMask(1);
}
#[repr(transparent)]
/** @brief Enumerates gesture masking modes.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GestureMask(pub ::core::ffi::c_uint);
impl ArkUI_GestureRecognizerType {
/// Tap.
pub const TAP_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(0);
}
impl ArkUI_GestureRecognizerType {
/// Long press.
pub const LONG_PRESS_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(1);
}
impl ArkUI_GestureRecognizerType {
/// Pan.
pub const PAN_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(2);
}
impl ArkUI_GestureRecognizerType {
/// Pinch.
pub const PINCH_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(3);
}
impl ArkUI_GestureRecognizerType {
/// Rotate.
pub const ROTATION_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(4);
}
impl ArkUI_GestureRecognizerType {
/// Swipe.
pub const SWIPE_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(5);
}
impl ArkUI_GestureRecognizerType {
/// A group of gestures.
pub const GROUP_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(6);
}
#[repr(transparent)]
/** @brief Enumerates gesture types.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GestureRecognizerType(pub ::core::ffi::c_uint);
impl ArkUI_GestureInterruptResult {
/// The gesture recognition process continues.
pub const GESTURE_INTERRUPT_RESULT_CONTINUE: ArkUI_GestureInterruptResult =
ArkUI_GestureInterruptResult(0);
}
impl ArkUI_GestureInterruptResult {
/// The gesture recognition process is paused.
pub const GESTURE_INTERRUPT_RESULT_REJECT: ArkUI_GestureInterruptResult =
ArkUI_GestureInterruptResult(1);
}
#[repr(transparent)]
/** @brief Enumerates gesture interruption results.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GestureInterruptResult(pub ::core::ffi::c_uint);
impl ArkUI_GestureRecognizerState {
/// Ready.
pub const ARKUI_GESTURE_RECOGNIZER_STATE_READY: ArkUI_GestureRecognizerState =
ArkUI_GestureRecognizerState(0);
}
impl ArkUI_GestureRecognizerState {
/// Detecting.
pub const ARKUI_GESTURE_RECOGNIZER_STATE_DETECTING: ArkUI_GestureRecognizerState =
ArkUI_GestureRecognizerState(1);
}
impl ArkUI_GestureRecognizerState {
/// Pending.
pub const ARKUI_GESTURE_RECOGNIZER_STATE_PENDING: ArkUI_GestureRecognizerState =
ArkUI_GestureRecognizerState(2);
}
impl ArkUI_GestureRecognizerState {
/// Blocked.
pub const ARKUI_GESTURE_RECOGNIZER_STATE_BLOCKED: ArkUI_GestureRecognizerState =
ArkUI_GestureRecognizerState(3);
}
impl ArkUI_GestureRecognizerState {
/// Successful.
pub const ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL: ArkUI_GestureRecognizerState =
ArkUI_GestureRecognizerState(4);
}
impl ArkUI_GestureRecognizerState {
/// Failed.
pub const ARKUI_GESTURE_RECOGNIZER_STATE_FAILED: ArkUI_GestureRecognizerState =
ArkUI_GestureRecognizerState(5);
}
#[repr(transparent)]
/** @brief Enumerates the gesture recognizer states.
@since 12*/
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ArkUI_GestureRecognizerState(pub ::core::ffi::c_uint);
/** @brief Defines the gesture recognizer handle.
@since 12*/
pub type ArkUI_GestureRecognizerHandle = *mut ArkUI_GestureRecognizer;
/** @brief Defines the gesture recognizer handle array.
@since 12*/
pub type ArkUI_GestureRecognizerHandleArray = *mut ArkUI_GestureRecognizerHandle;
#[repr(C)]
pub struct ArkUI_GestureEventTargetInfo {
_unused: [u8; 0],
}
#[repr(C)]
pub struct ArkUI_ParallelInnerGestureEvent {
_unused: [u8; 0],
}
/** @brief Defines a callback function for notifying gesture recognizer destruction.
@since 12*/
pub type ArkUI_GestureRecognizerDisposeNotifyCallback = ::core::option::Option<
unsafe extern "C" fn(
recognizer: *mut ArkUI_GestureRecognizer,
userData: *mut ::core::ffi::c_void,
),
>;
/** @brief Defines the gesture APIs.
@since 12*/
#[repr(C)]
pub struct ArkUI_NativeGestureAPI_1 {
/// The struct version is 1.
pub version: i32,
/** @brief Creates a tap gesture.
1. This API is used to trigger a tap gesture with one, two, or more taps. \n
2. If multi-tap is configured, the timeout interval between a lift and the next tap is 300 ms. \n
3. If the distance between the last tapped position and the current tapped position exceeds 60 vp,
gesture recognition fails. \n
4. If the value is greater than 1, the tap gesture will fail to be recognized when the number of fingers
touching the screen within 300 ms of the first finger touch is less than the required number, \n
or when the number of fingers lifted from the screen within 300 ms of the first finger's being lifted
is less than the required number. \n
5. When the number of fingers touching the screen exceeds the set value, the gesture can be recognized. \n
@param countNum Indicates the number of consecutive taps. If the value is less than 1 or is not set,
the default value <b>1</b> is used.
@param fingersNum Indicates the number of fingers required to trigger a tap. The value ranges
from 1 to 10. If the value is less than 1 or is not set, the default value <b>1</b> is used.
@return Returns the pointer to the created gesture.*/
pub createTapGesture: ::core::option::Option<
unsafe extern "C" fn(countNum: i32, fingersNum: i32) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Creates a long press gesture.
1. This API is used to trigger a long press gesture, which requires one or more fingers with a minimum
The value ranges 500 ms hold-down time. \n
2. In components that support drag actions by default, such as <b><Text></b>, <b><TextInput></b>,
<b><TextArea></b>, <b><Hyperlink></b>, <b><Image></b>, and <b>RichEditor></b>, the long press gesture \n
may conflict with the drag action. If this occurs, they are handled as follows: \n
If the minimum duration of the long press gesture is less than 500 ms, the long press gesture receives
a higher response priority than the drag action. \n
If the minimum duration of the long press gesture is greater than or equal to 500 ms,
the drag action receives a higher response priority than the long press gesture. \n
3. If a finger moves more than 15 px after being pressed, the gesture recognition fails. \n
@param fingersNum Indicates the minimum number of fingers to trigger a long press gesture.
The value ranges from 1 to 10.
@param repeatResult Indicates whether to continuously trigger the event callback.
@param durationNum Indicates the minimum hold-down time, in ms.
If the value is less than or equal to 0, the default value <b>500</b> is used.
@return Returns the pointer to the created gesture.*/
pub createLongPressGesture: ::core::option::Option<
unsafe extern "C" fn(
fingersNum: i32,
repeatResult: bool,
durationNum: i32,
) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Creates a pan gesture.
1. This API is used to trigger a pan gesture when the movement distance of a finger on the screen exceeds
the minimum value. \n
2. If a pan gesture and a tab swipe occur at the same time, set <b>distanceNum</b> to <b>1</b>
so that the gesture can be more easily recognized. \n
@param fingersNum Indicates the minimum number of fingers to trigger a pan gesture. The value ranges from 1 to 10.
If the value is less than 1 or is not set, the default value <b>1</b> is used.
@param directions Indicates the pan direction. The value supports the AND (&) and OR (\|) operations.
@param distanceNum Indicates the minimum pan distance to trigger the gesture, in vp. If this parameter is
set to a value less than or equal to 0, the default value <b>5</b> is used.
@return Returns the pointer to the created gesture.*/
pub createPanGesture: ::core::option::Option<
unsafe extern "C" fn(
fingersNum: i32,
directions: ArkUI_GestureDirectionMask,
distanceNum: f64,
) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Creates a pinch gesture.
1. This API is used to trigger a pinch gesture, which requires two to five fingers with a minimum 5 vp
distance between the fingers. \n
2. While more fingers than the minimum number can be pressed to trigger the gesture, only the first
fingers of the minimum number participate in gesture calculation. \n
@param fingersNum Indicates the minimum number of fingers to trigger a pinch. The value ranges from 2 to 5.
Default value: <b>2</b>
@param distanceNum Indicates the minimum recognition distance, in px. If this parameter is set to a value less
than or equal to 0, the default value <b>5</b> is used.
@return Returns the pointer to the created gesture.*/
pub createPinchGesture: ::core::option::Option<
unsafe extern "C" fn(fingersNum: i32, distanceNum: f64) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Creates a rotation gesture.
1. This API is used to trigger a rotation gesture, which requires two to five fingers with a
minimum 1-degree rotation angle. \n
2. While more fingers than the minimum number can be pressed to trigger the gesture, only the first
two fingers participate in gesture calculation. \n
@param fingersNum Indicates the minimum number of fingers to trigger a rotation. The value ranges from 2 to 5.
Default value: <b>2</b>
@param angleNum Indicates the minimum degree that can trigger the rotation gesture. Default value: <b>1</b>
If this parameter is set to a value less than or equal to 0 or greater than 360,
the default value <b>1</b> is used.
@return Returns the pointer to the created gesture.*/
pub createRotationGesture: ::core::option::Option<
unsafe extern "C" fn(fingersNum: i32, angleNum: f64) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Creates a swipe gesture.
This API is used to implement a swipe gesture, which can be recognized when the swipe speed is 100
vp/s or higher. \n
@param fingersNum Indicates the minimum number of fingers to trigger a swipe gesture.
The value ranges from 1 to 10.
@param directions Indicates the swipe direction.
@param speedNum Indicates the minimum speed of the swipe gesture, in px/s.
If this parameter is set to a value less than or equal to 0, the default value <b>100</b> is used.
@return Returns the pointer to the created gesture.*/
pub createSwipeGesture: ::core::option::Option<
unsafe extern "C" fn(
fingersNum: i32,
directions: ArkUI_GestureDirectionMask,
speedNum: f64,
) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Creates a gesture group.
@param gestureMode Indicates the gesture group mode.
@return Returns the pointer to the created gesture group.*/
pub createGroupGesture: ::core::option::Option<
unsafe extern "C" fn(gestureMode: ArkUI_GroupGestureMode) -> *mut ArkUI_GestureRecognizer,
>,
/** @brief Disposes a gesture to release resources.
@param recognizer Indicates the pointer to the gesture to dispose.*/
pub dispose:
::core::option::Option<unsafe extern "C" fn(recognizer: *mut ArkUI_GestureRecognizer)>,
/** @brief Adds a gesture to a gesture group.
@param group Indicates the pointer to the gesture group.
@param child Indicates the gesture to be added to the gesture group.
@return Returns <b>0</b> if success.
Returns <b>401</b> if a parameter exception occurs. Returns 401 if a parameter exception occurs.*/
pub addChildGesture: ::core::option::Option<
unsafe extern "C" fn(
group: *mut ArkUI_GestureRecognizer,
child: *mut ArkUI_GestureRecognizer,
) -> i32,
>,
/** @brief Removes a gesture to a gesture group.
@param group Indicates the pointer to the gesture group.
@param child Indicates the gesture to be removed to the gesture group.
@return Returns <b>0</b> if success.
Returns <b>401</b> if a parameter exception occurs.*/
pub removeChildGesture: ::core::option::Option<
unsafe extern "C" fn(
group: *mut ArkUI_GestureRecognizer,
child: *mut ArkUI_GestureRecognizer,
) -> i32,
>,
/** @brief Registers a callback for gestures.
@param recognizer Indicates the pointer to the gesture recognizer.
@param actionTypeMask Indicates the set of gesture event types. Multiple callbacks can be registered at once,
with the callback event types distinguished in the callbacks.
Example: actionTypeMask = GESTURE_EVENT_ACTION_ACCEPT | GESTURE_EVENT_ACTION_UPDATE;
@param extraParams Indicates the context passed in the <b>targetReceiver</b> callback.
@param targetReceiver Indicates the callback to register for processing the gesture event types.
<b>event</b> indicates the gesture callback data.
@return Returns <b>0</b> if success.
Returns <b>401</b> if a parameter exception occurs.*/
pub setGestureEventTarget: ::core::option::Option<
unsafe extern "C" fn(
recognizer: *mut ArkUI_GestureRecognizer,
actionTypeMask: ArkUI_GestureEventActionTypeMask,
extraParams: *mut ::core::ffi::c_void,
targetReceiver: ::core::option::Option<
unsafe extern "C" fn(
event: *mut ArkUI_GestureEvent,
extraParams: *mut ::core::ffi::c_void,
),
>,
) -> i32,
>,
/** @brief Adds a gesture to a UI component.
@param node Indicates the UI component to which you want to add the gesture.
@param recognizer Indicates the gesture to be added to the UI component.
@param mode Indicates the gesture event mode. Available options are <b>NORMAL_GESTURE</b>,
<b>PARALLEL_GESTURE</b>, and <b>PRIORITY_GESTURE</b>.
@param mask Indicates the gesture masking mode.
@return Returns <b>0</b> if success.
Returns <b>401</b> if a parameter exception occurs.*/
pub addGestureToNode: ::core::option::Option<
unsafe extern "C" fn(
node: ArkUI_NodeHandle,
recognizer: *mut ArkUI_GestureRecognizer,
mode: ArkUI_GesturePriority,
mask: ArkUI_GestureMask,
) -> i32,
>,
/** @brief Removes a gesture from a node.
@param node Indicates the node from which you want to remove the gesture.
@param recognizer Indicates the gesture to be removed.
@return Returns <b>0</b> if success.
Returns <b>401</b> if a parameter exception occurs.*/
pub removeGestureFromNode: ::core::option::Option<
unsafe extern "C" fn(
node: ArkUI_NodeHandle,
recognizer: *mut ArkUI_GestureRecognizer,
) -> i32,
>,
/** @brief Sets a gesture interruption callback for a node.
@param node Indicates the node for which you want to set a gesture interruption callback.
@param interrupter Indicates the gesture interruption callback to set.
<b>info</b> indicates the gesture interruption data. If <b>interrupter</b> returns
<b>GESTURE_INTERRUPT_RESULT_CONTINUE</b>, the gesture recognition process continues. If it returns
<b>GESTURE_INTERRUPT_RESULT_REJECT</b>, the gesture recognition process is paused.
@return Returns <b>0</b> if success.
Returns <b>401</b> if a parameter exception occurs.*/
pub setGestureInterrupterToNode: ::core::option::Option<
unsafe extern "C" fn(
node: ArkUI_NodeHandle,
interrupter: ::core::option::Option<
unsafe extern "C" fn(
info: *mut ArkUI_GestureInterruptInfo,
) -> ArkUI_GestureInterruptResult,
>,
) -> i32,
>,
/** @brief Obtains the type of a gesture.
@param recognizer Indicates the pointer to the gesture.
@return Returns the gesture type.*/
pub getGestureType: ::core::option::Option<
unsafe extern "C" fn(
recognizer: *mut ArkUI_GestureRecognizer,
) -> ArkUI_GestureRecognizerType,
>,
/** @brief Sets the callback function for a parallel internal gesture event.
@param node Indicates the ArkUI node for which the callback of a parallel internal gesture event is to be set.
@param userData Indicates the custom data.
@param parallelInnerGesture Indicates the parallel internal gesture event. <b>event</b> returns the data of the
parallel internal gesture event; <b>parallelInnerGesture</b> returns the pointer to the gesture recognizer
that requires parallel recognition.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.*/
pub setInnerGestureParallelTo: ::core::option::Option<
unsafe extern "C" fn(
node: ArkUI_NodeHandle,
userData: *mut ::core::ffi::c_void,
parallelInnerGesture: ::core::option::Option<
unsafe extern "C" fn(
event: *mut ArkUI_ParallelInnerGestureEvent,
) -> *mut ArkUI_GestureRecognizer,
>,
) -> i32,
>,
/** @brief Creates a tap gesture that is subject to distance restrictions.
1. This API is used to trigger a tap gesture with one, two, or more taps. \n
2. If multi-tap is configured, the timeout interval between a lift and the next tap is 300 ms. \n
3. If the distance between the last tapped position and the current tapped position exceeds 60 vp,
gesture recognition fails. \n
4. If the value is greater than 1, the tap gesture will fail to be recognized when the number of fingers
touching the screen within 300 ms of the first finger touch is less than the required number,
or when the number of fingers lifted from the screen within 300 ms of the first finger's being lifted
is less than the required number. \n
5. When the number of fingers touching the screen exceeds the set value, the gesture can be recognized. \n
6. If the finger moves beyond the preset distance limit, gesture recognition fails. \n
@param countNum Indicates the number of consecutive taps. If the value is less than 1 or is not set, the default
value <b>1</b> is used.
@param fingersNum Indicates the number of fingers required to trigger a tap. The value ranges from 1 to 10.
If the value is less than 1 or is not set, the default value <b>1</b> is used.
@param distanceThreshold Indicates the allowed moving distance of a finger.
If the value is less than 0 or is not set, it will be converted to the default value of infinity.
@return Returns the pointer to the created gesture.*/
pub createTapGestureWithDistanceThreshold: ::core::option::Option<
unsafe extern "C" fn(
countNum: i32,
fingersNum: i32,
distanceThreshold: f64,
) -> *mut ArkUI_GestureRecognizer,
>,
}
extern "C" {
/** @brief Checks whether a gesture is a built-in gesture of the component.
@param event Indicates the pointer to the gesture interruption information.
@return Returns <b>true</b> if the gesture is a built-in gesture; returns <b>false</b> otherwise.
@since 12*/
pub fn OH_ArkUI_GestureInterruptInfo_GetSystemFlag(
event: *const ArkUI_GestureInterruptInfo,
) -> bool;
/** @brief Obtains the pointer to interrupted gesture recognizer.
@param event Indicates the pointer to the gesture interruption information.
@return Returns the pointer to interrupted gesture recognizer.
@since 12*/
pub fn OH_ArkUI_GestureInterruptInfo_GetRecognizer(
event: *const ArkUI_GestureInterruptInfo,
) -> *mut ArkUI_GestureRecognizer;
/** @brief Obtains the pointer to the interrupted gesture event.
@param event Indicates the pointer to the gesture interruption information.
@return Returns the pointer to the interrupted gesture event.
@since 12*/
pub fn OH_ArkUI_GestureInterruptInfo_GetGestureEvent(
event: *const ArkUI_GestureInterruptInfo,
) -> *mut ArkUI_GestureEvent;
/** @brief Obtains the type of the system gesture to trigger.
@param event Indicates the pointer to the gesture interruption information.
@return Returns the type of the system gesture to trigger. If the gesture to trigger is not a system gesture,
<b>-1</b> is returned.
@since 12*/
pub fn OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType(
event: *const ArkUI_GestureInterruptInfo,
) -> i32;
/** @brief Obtains the gesture event type.
@param event Indicates the pointer to the gesture event.
@return Returns the gesture event type.
@since 12*/
pub fn OH_ArkUI_GestureEvent_GetActionType(
event: *const ArkUI_GestureEvent,
) -> ArkUI_GestureEventActionType;
/** @brief Obtains gesture input.
@param event Indicates the pointer to the gesture event.
@return Returns the pointer to the input event of the gesture event.
@since 12*/
pub fn OH_ArkUI_GestureEvent_GetRawInputEvent(
event: *const ArkUI_GestureEvent,
) -> *const ArkUI_UIInputEvent;
/** @brief Obtains the number of times that a long press gesture is triggered periodically.
@param event Indicates the pointer to the gesture event.
@return Returns the number of times that the long press gesture is triggered periodically.
@since 12*/
pub fn OH_ArkUI_LongPress_GetRepeatCount(event: *const ArkUI_GestureEvent) -> i32;
/** @brief Obtains the velocity of a pan gesture along the main axis.
@param event Indicates the pointer to the gesture event.
@return Returns the velocity of the pan gesture along the main axis, in px/s.
The value is the square root of the sum of the squares of the velocity on the x-axis and y-axis.
@since 12*/
pub fn OH_ArkUI_PanGesture_GetVelocity(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the velocity of a pan gesture along the x-axis.
@param event Indicates the pointer to the gesture event.
@return Returns the velocity of the pan gesture along the x-axis, in px/s.
@since 12*/
pub fn OH_ArkUI_PanGesture_GetVelocityX(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the velocity of a pan gesture along the y-axis.
@param event Indicates the pointer to the gesture event.
@return Returns the velocity of the pan gesture along the y-axis, in px/s.
@since 12*/
pub fn OH_ArkUI_PanGesture_GetVelocityY(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the relative offset of a pan gesture along the x-axis.
@param event Indicates the pointer to the gesture event.
@return Returns the relative offset of the gesture along the x-axis, in px.
@since 12*/
pub fn OH_ArkUI_PanGesture_GetOffsetX(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the relative offset of a pan gesture along the y-axis.
@param event Indicates the pointer to the gesture event.
@return Returns the relative offset of the gesture along the y-axis, in px.
@since 12*/
pub fn OH_ArkUI_PanGesture_GetOffsetY(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the angle information of the swipe gesture.
After a swipe gesture is recognized, a line connecting the two fingers is identified as the initial line.
As the fingers swipe, the line between the fingers rotates. \n
Based on the coordinates of the initial line's and current line's end points, the arc tangent function is used to
calculate the respective included angle of the points relative to the horizontal direction \n
by using the following formula: Rotation angle = arctan2(cy2-cy1,cx2-cx1) - arctan2(y2-y1,x2-x1). \n
The initial line is used as the coordinate system. Values from 0 to 180 degrees represent clockwise rotation,
while values from –180 to 0 degrees represent counterclockwise rotation. \n
@param event Indicates the pointer to the gesture event.
@return Returns the angle of the swipe gesture, which is the result obtained based on the aforementioned formula.
@since 12*/
pub fn OH_ArkUI_SwipeGesture_GetAngle(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the average velocity of all fingers used in the swipe gesture.
@param event Indicates the pointer to the gesture event.
@return Returns the average velocity of all fingers used in the swipe gesture, in px/s.
@since 12*/
pub fn OH_ArkUI_SwipeGesture_GetVelocity(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the angle information of a rotation gesture.
@param event Indicates the pointer to the gesture event.
@return Returns the rotation angle.
@since 12*/
pub fn OH_ArkUI_RotationGesture_GetAngle(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the scale ratio of a pinch gesture.
@param event Indicates the pointer to the gesture event.
@return Returns the scale ratio.
@since 12*/
pub fn OH_ArkUI_PinchGesture_GetScale(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the X coordinate of the center of the pinch gesture, in vp,
relative to the upper left corner of the current component.
@param event Indicates the pointer to the gesture event.
@return Returns the X coordinate of the center of the pinch gesture, in vp,
relative to the upper left corner of the current component.
@since 12*/
pub fn OH_ArkUI_PinchGesture_GetCenterX(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains the Y coordinate of the center of the pinch gesture, in vp,
relative to the upper left corner of the current component.
@param event Indicates the pointer to the gesture event.
@return Returns the Y coordinate of the center of the pinch gesture, in vp,
relative to the upper left corner of the current component.
@since 12*/
pub fn OH_ArkUI_PinchGesture_GetCenterY(event: *const ArkUI_GestureEvent) -> f32;
/** @brief Obtains information about a gesture response chain.
@param event Indicates the pointer to the gesture interruption information.
@param responseChain Indicates the pointer to an array of gesture recognizers on the response chain.
@param count Indicates the pointer to the number of gesture recognizers on the response chain.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
@since 12*/
pub fn OH_ArkUI_GetResponseRecognizersFromInterruptInfo(
event: *const ArkUI_GestureInterruptInfo,
responseChain: *mut ArkUI_GestureRecognizerHandleArray,
count: *mut i32,
) -> i32;
/** @brief Sets the enabled state of a gesture recognizer.
@param recognizer Indicates the pointer to a gesture recognizer.
@param enabled Indicates the enabled state.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
@since 12*/
pub fn OH_ArkUI_SetGestureRecognizerEnabled(
recognizer: *mut ArkUI_GestureRecognizer,
enabled: bool,
) -> i32;
/** @brief Obtains the enabled state of a gesture recognizer.
@param recognizer Indicates the pointer to a gesture recognizer.
@return Returns <b>true</b> if the gesture recognizer is enabled.
Returns <b>false</b> if the gesture recognizer is disabled.
@since 12*/
pub fn OH_ArkUI_GetGestureRecognizerEnabled(recognizer: *mut ArkUI_GestureRecognizer) -> bool;
/** @brief Obtains the state of a gesture recognizer.
@param recognizer Indicates the pointer to a gesture recognizer.
@param state Indicates the pointer to the state of the gesture recognizer.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
@since 12*/
pub fn OH_ArkUI_GetGestureRecognizerState(
recognizer: *mut ArkUI_GestureRecognizer,
state: *mut ArkUI_GestureRecognizerState,
) -> i32;
/** @brief Obtains the information about a gesture event target.
@param recognizer Indicates the pointer to a gesture recognizer.
@param info Indicates the information about a gesture event target.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
@since 12*/
pub fn OH_ArkUI_GetGestureEventTargetInfo(
recognizer: *mut ArkUI_GestureRecognizer,
info: *mut *mut ArkUI_GestureEventTargetInfo,
) -> i32;
/** @brief Obtains whether this scroll container is scrolled to the top.
@param info Indicates the information about a gesture event target.
@param ret Indicates whether the scroll container is scrolled to the top.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
Returns {@link ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER} if the component is not a scroll container.
@since 12*/
pub fn OH_ArkUI_GestureEventTargetInfo_IsScrollBegin(
info: *mut ArkUI_GestureEventTargetInfo,
ret: *mut bool,
) -> i32;
/** @brief Obtains whether this scroll container is scrolled to the bottom.
@param info Indicates the information about a gesture event target.
@param ret Indicates whether the scroll container is scrolled to the bottom.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
Returns {@link ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER} if the component is not a scroll container.
@since 12*/
pub fn OH_ArkUI_GestureEventTargetInfo_IsScrollEnd(
info: *mut ArkUI_GestureEventTargetInfo,
ret: *mut bool,
) -> i32;
/** @brief Obtains the direction of a pan gesture.
@param recognizer Indicates the pointer to a gesture recognizer.
@param directionMask Indicates the pan direction.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
@since 12*/
pub fn OH_ArkUI_GetPanGestureDirectionMask(
recognizer: *mut ArkUI_GestureRecognizer,
directionMask: *mut ArkUI_GestureDirectionMask,
) -> i32;
/** @brief Obtains whether a gesture is a built-in gesture.
@param recognizer Indicates the pointer to a gesture recognizer.
@return Returns <b>true</b> if the gesture is a built-in gesture; returns <b>false</b> otherwise.
@since 12*/
pub fn OH_ArkUI_IsBuiltInGesture(recognizer: *mut ArkUI_GestureRecognizer) -> bool;
/** @brief Obtains the tag of a gesture recognizer.
@param recognizer Indicates the pointer to a gesture recognizer.
@param buffer Indicates the buffer.
@param bufferSize Indicates the buffer size.
@param result Indicates the length of the string to be written to the buffer.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the buffer is not large enough.
@since 12*/
pub fn OH_ArkUI_GetGestureTag(
recognizer: *mut ArkUI_GestureRecognizer,
buffer: *mut ::core::ffi::c_char,
bufferSize: i32,
result: *mut i32,
) -> i32;
/** @brief Obtains the ID of the component linked to a gesture recognizer.
@param recognizer Indicates the pointer to a gesture recognizer.
@param nodeId Indicates the component ID.
@param size Indicates the buffer size.
@param result Indicates the length of the string to be written to the buffer.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the buffer is not large enough.
@since 12*/
pub fn OH_ArkUI_GetGestureBindNodeId(
recognizer: *mut ArkUI_GestureRecognizer,
nodeId: *mut ::core::ffi::c_char,
size: i32,
result: *mut i32,
) -> i32;
/** @brief Obtains whether a gesture recognizer is valid.
@param recognizer Indicates the pointer to a gesture recognizer.
@return Returns <b>true</b> if the gesture recognizer is valid.
Returns <b>false</b> if the gesture recognizer is invalid.
@since 12*/
pub fn OH_ArkUI_IsGestureRecognizerValid(recognizer: *mut ArkUI_GestureRecognizer) -> bool;
/** @brief Obtains custom data in the parallel internal gesture event.
@param event Indicates the pointer to a parallel internal gesture event.
@return Returns the pointer to custom data.
@since 12*/
pub fn OH_ArkUI_ParallelInnerGestureEvent_GetUserData(
event: *mut ArkUI_ParallelInnerGestureEvent,
) -> *mut ::core::ffi::c_void;
/** @brief Obtains the current gesture recognizer in a parallel internal gesture event.
@param event Indicates the pointer to a parallel internal gesture event.
@return Returns the pointer to the current gesture recognizer.
@since 12*/
pub fn OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer(
event: *mut ArkUI_ParallelInnerGestureEvent,
) -> *mut ArkUI_GestureRecognizer;
/** @brief Obtains the conflicting gesture recognizers in a parallel internal gesture event.
@param event Indicates the pointer to a parallel internal gesture event.
@param array Indicates the pointer to the array of conflicting gesture recognizers.
@param size Indicates the size of the array of conflicting gesture recognizers.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
@since 12*/
pub fn OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(
event: *mut ArkUI_ParallelInnerGestureEvent,
array: *mut ArkUI_GestureRecognizerHandleArray,
size: *mut i32,
) -> i32;
/** @brief Sets a callback function for notifying gesture recognizer destruction.
@param recognizer Indicates the pointer to a gesture recognizer.
@param callback Indicates the callback function for notifying gesture recognizer destruction.
@param userData Indicates the custom data.
@return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success.
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.*/
pub fn OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify(
recognizer: *mut ArkUI_GestureRecognizer,
callback: ArkUI_GestureRecognizerDisposeNotifyCallback,
userData: *mut ::core::ffi::c_void,
) -> i32;
}