harmony 鸿蒙native_gesture.h

  • 2025-06-12
  • 浏览 (4)

native_gesture.h

Overview

Declares the APIs of NativeGesture.

Library: libace_ndk.z.so

File to include:

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 12

Related module: ArkUI_NativeModule

Summary

Structs

Name Description
struct ArkUI_NativeGestureAPI_1 Defines a struct for the gesture APIs.
struct ArkUI_NativeGestureAPI_2 Defines a struct for the gesture APIs.

Types

Name Description
typedef uint32_t ArkUI_GestureEventActionTypeMask Defines a set of gesture event types.
typedef uint32_t ArkUI_GestureDirectionMask Defines a set of gesture directions.
typedef ArkUI_GestureRecognizer * ArkUI_GestureRecognizerHandle Defines the gesture recognizer handle.
typedef ArkUI_GestureRecognizerHandle * ArkUI_GestureRecognizerHandleArray Defines the gesture recognizer handle array.
typedef ArkUI_TouchRecognizer * ArkUI_TouchRecognizerHandle Defines the gesture recognizer handle.
typedef ArkUI_TouchRecognizerHandle * ArkUI_TouchRecognizerHandleArray Defines an array of gesture recognizer handles.
typedef struct ArkUI_GestureEventTargetInfo ArkUI_GestureEventTargetInfo Defines a GestureEventTargetInfo object that provides information about a gesture event target.
typedef struct ArkUI_ParallelInnerGestureEvent ArkUI_ParallelInnerGestureEvent Defines a parallel internal gesture event.
typedef struct ArkUI_GestureInterruptInfo ArkUI_GestureInterruptInfo Obtains the custom data from a gesture interruption event.
typedef void(* ArkUI_GestureRecognizerDestructNotifyCallback) (ArkUI_GestureRecognizer *recognizer, void *userData) Defines a callback function for notifying gesture recognizer destruction.

Enums

Name Description
ArkUI_GestureEventActionType { GESTURE_EVENT_ACTION_ACCEPT = 0x01, GESTURE_EVENT_ACTION_UPDATE = 0x02, GESTURE_EVENT_ACTION_END = 0x04, GESTURE_EVENT_ACTION_CANCEL = 0x08 } Enumerates gesture event types.
ArkUI_GesturePriority { NORMAL = 0, PRIORITY = 1, PARALLEL = 2 } Enumerates gesture event modes.
ArkUI_GroupGestureMode { SEQUENTIAL_GROUP = 0, PARALLEL_GROUP = 1, EXCLUSIVE_GROUP = 2 } Enumerates gesture group modes.
ArkUI_GestureDirection {
GESTURE_DIRECTION_ALL = 0b1111, GESTURE_DIRECTION_HORIZONTAL = 0b0011, GESTURE_DIRECTION_VERTICAL = 0b1100, GESTURE_DIRECTION_LEFT = 0b0001,
GESTURE_DIRECTION_RIGHT = 0b0010, GESTURE_DIRECTION_UP = 0b0100, GESTURE_DIRECTION_DOWN = 0b1000, GESTURE_DIRECTION_NONE = 0
}
Enumerates gesture directions.
ArkUI_GestureMask { NORMAL_GESTURE_MASK = 0, IGNORE_INTERNAL_GESTURE_MASK } Enumerates gesture masking modes.
ArkUI_GestureRecognizerType {
TAP_GESTURE = 0, LONG_PRESS_GESTURE, PAN_GESTURE, PINCH_GESTURE,
ROTATION_GESTURE, SWIPE_GESTURE, GROUP_GESTURE
}
Enumerates gesture recognizer types.
ArkUI_GestureInterruptResult { GESTURE_INTERRUPT_RESULT_CONTINUE = 0, GESTURE_INTERRUPT_RESULT_REJECT } Enumerates gesture interruption results.
ArkUI_GestureRecognizerState {
ARKUI_GESTURE_RECOGNIZER_STATE_REDAY = 0, ARKUI_GESTURE_RECOGNIZER_STATE_DETECTING = 1, ARKUI_GESTURE_RECOGNIZER_STATE_PENDING = 2, ARKUI_GESTURE_RECOGNIZER_STATE_BLOCKED = 3,
ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL = 4, ARKUI_GESTURE_RECOGNIZER_STATE_FAILED = 5
}
Enumerates the gesture recognizer states.

Functions

Name Description
bool OH_ArkUI_GestureInterruptInfo_GetSystemFlag (const ArkUI_GestureInterruptInfo *event) Checks whether a gesture is a built-in gesture of the component.
ArkUI_GestureRecognizer * OH_ArkUI_GestureInterruptInfo_GetRecognizer (const ArkUI_GestureInterruptInfo *event) Returns the pointer to interrupted gesture recognizer.
ArkUI_GestureEvent * OH_ArkUI_GestureInterruptInfo_GetGestureEvent (const ArkUI_GestureInterruptInfo *event) Obtains the pointer to the interrupted gesture event.
int32_t OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType (const ArkUI_GestureInterruptInfo *event) Obtains the type of the system gesture to trigger.
int32_t OH_ArkUI_GestureInterruptInfo_GetTouchRecognizers (const ArkUI_GestureInterruptInfo* info, ArkUI_TouchRecognizerHandleArray* recognizers, int32_t* size) Obtains touch recognizers from gesture interruption information.
int32_t OH_ArkUI_TouchRecognizer_GetNodeHandle (const ArkUI_TouchRecognizerHandle recognizer) Obtains the component handle corresponding to a touch recognizer.
int32_t OH_ArkUI_TouchRecognizer_CancelTouch (ArkUI_TouchRecognizerHandle recognizer, ArkUI_GestureInterruptInfo* info) Sends a cancel touch event to a touch recognizer in a gesture interruption callback.
ArkUI_GestureEventActionType OH_ArkUI_GestureEvent_GetActionType (const ArkUI_GestureEvent *event) Obtains the gesture event type.
ArkUI_NodeHandle OH_ArkUI_GestureEvent_GetResponseNode (ArkUI_GestureEvent *event) Obtains the node that responds to the gesture.
const ArkUI_UIInputEvent * OH_ArkUI_GestureEvent_GetRawInputEvent (const ArkUI_GestureEvent *event) Obtains gesture input.
int32_t OH_ArkUI_LongPress_GetRepeatCount (const ArkUI_GestureEvent *event) Obtains the number of times that a long press gesture is triggered periodically.
float OH_ArkUI_PanGesture_GetVelocity (const ArkUI_GestureEvent *event) Obtains the velocity of a pan gesture along the main axis.
float OH_ArkUI_PanGesture_GetVelocityX (const ArkUI_GestureEvent *event) Obtains the velocity of a pan gesture along the x-axis.
float OH_ArkUI_PanGesture_GetVelocityY (const ArkUI_GestureEvent *event) Obtains the velocity of a pan gesture along the y-axis.
float OH_ArkUI_PanGesture_GetOffsetX (const ArkUI_GestureEvent *event) Obtains the relative offset of a pan gesture along the x-axis.
float OH_ArkUI_PanGesture_GetOffsetY (const ArkUI_GestureEvent *event) Obtains the relative offset of a pan gesture along the y-axis.
float OH_ArkUI_SwipeGesture_GetAngle (const ArkUI_GestureEvent *event) Obtains the angle information of the swipe gesture.
float OH_ArkUI_SwipeGesture_GetVelocity (const ArkUI_GestureEvent *event) Obtains the average velocity of all fingers used in the swipe gesture.
float OH_ArkUI_RotationGesture_GetAngle (const ArkUI_GestureEvent *event) Obtains the angle information of a rotation gesture.
float OH_ArkUI_PinchGesture_GetScale (const ArkUI_GestureEvent *event) Obtains the scale ratio of a pinch gesture.
float OH_ArkUI_PinchGesture_GetCenterX (const ArkUI_GestureEvent *event) Obtains the X coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component.
float OH_ArkUI_PinchGesture_GetCenterY (const ArkUI_GestureEvent *event) Obtains the Y coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component.
ArkUI_NodeHandle OH_ArkUI_GestureEvent_GetNode (const ArkUI_GestureEvent *event) Obtains the ArkUI component to which the gesture is bound.
int32_t OH_ArkUI_GetResponseRecognizersFromInterruptInfo (const ArkUI_GestureInterruptInfo *event, ArkUI_GestureRecognizerHandleArray *responseChain, int32_t *count) Obtains information about a gesture response chain.
int32_t OH_ArkUI_SetGestureRecognizerEnabled (ArkUI_GestureRecognizer *recognizer, bool enabled) Sets the enabled state of a gesture recognizer.
int32_t(* OH_ArkUI_SetGestureRecognizerLimitFingerCount )(ArkUI_GestureRecognizer *recognizer, bool limitFingerCount) Sets whether to check the number of fingers touching the screen.
bool OH_ArkUI_GetGestureRecognizerEnabled (ArkUI_GestureRecognizer *recognizer) Obtains the enabled state of a gesture recognizer.
int32_t OH_ArkUI_GetGestureRecognizerState (ArkUI_GestureRecognizer *recognizer, ArkUI_GestureRecognizerState *state) Obtains the state of a gesture recognizer.
int32_t OH_ArkUI_GetGestureEventTargetInfo (ArkUI_GestureRecognizer *recognizer, ArkUI_GestureEventTargetInfo **info) Obtains the information about a gesture event target.
int32_t OH_ArkUI_GestureEventTargetInfo_IsScrollBegin (ArkUI_GestureEventTargetInfo *info, bool *ret) Obtains whether this scroll container is scrolled to the top.
int32_t OH_ArkUI_GestureEventTargetInfo_IsScrollEnd (ArkUI_GestureEventTargetInfo *info, bool *ret) Obtains whether this scroll container is scrolled to the bottom.
int32_t OH_ArkUI_GetPanGestureDirectionMask (ArkUI_GestureRecognizer *recognizer, ArkUI_GestureDirectionMask *directionMask) Obtains the direction of a pan gesture.
bool OH_ArkUI_IsBuiltInGesture (ArkUI_GestureRecognizer *recognizer) Obtains whether a gesture is a built-in gesture.
int32_t OH_ArkUI_GetGestureTag (ArkUI_GestureRecognizer *recognizer, char *buffer, int32_t bufferSize, int32_t *result) Obtains the tag of a gesture recognizer.
int32_t OH_ArkUI_GetGestureBindNodeId (ArkUI_GestureRecognizer *recognizer, char *nodeId, int32_t size, int32_t *result) Obtains the ID of the component linked to a gesture recognizer.
bool OH_ArkUI_IsGestureRecognizerValid (ArkUI_GestureRecognizer *recognizer) Obtains whether a gesture recognizer is valid.
void * OH_ArkUI_ParallelInnerGestureEvent_GetUserData (ArkUI_ParallelInnerGestureEvent *event) Obtains custom data in the parallel internal gesture event.
void* OH_ArkUI_GestureInterrupter_GetUserData(ArkUI_GestureInterruptInfo* event) Obtains the custom data from a gesture interruption event.
ArkUI_GestureRecognizer * OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer (ArkUI_ParallelInnerGestureEvent *event) Obtains the current gesture recognizer in a parallel internal gesture event.
int32_t OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers (ArkUI_ParallelInnerGestureEvent *event, ArkUI_GestureRecognizerHandleArray *array, int32_t *size) Obtains the conflicting gesture recognizers in a parallel internal gesture event.
int32_t OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify (ArkUI_GestureRecognizer *recognizer, ArkUI_GestureRecognizerDestructNotifyCallback callback, void *userData) Sets a callback function for notifying gesture recognizer destruction.
int32_t OH_ArkUI_GetGestureParam_DirectMask (ArkUI_GestureRecognizer *recognizer, ArkUI_GestureDirectionMask *directMask) Obtains the swipe direction of a gesture recognizer.
int32_t OH_ArkUI_GetGestureParam_FingerCount (ArkUI_GestureRecognizer *recognizer, int *finger) Obtains the number of fingers used by a gesture recognizer.
int32_t OH_ArkUI_GetGestureParam_limitFingerCount (ArkUI_GestureRecognizer *recognizer, bool *isLimited) Checks whether a gesture recognizer has a finger count limit.
int32_t OH_ArkUI_GetGestureParam_repeat (ArkUI_GestureRecognizer *recognizer, bool *isRepeat) Checks whether a gesture recognizer supports repeated event callbacks.
int32_t OH_ArkUI_GetGestureParam_distance (ArkUI_GestureRecognizer *recognizer, double *distance) Obtains the allowed movement distance range for a gesture recognizer.
int32_t OH_ArkUI_GetGestureParam_speed (ArkUI_GestureRecognizer *recognizer, double *speed) Obtains the minimum swipe speed recognized by a gesture recognizer.
int32_t OH_ArkUI_GetGestureParam_duration (ArkUI_GestureRecognizer *recognizer, int *duration) Obtains the minimum duration required to trigger a long press by a gesture recognizer.
int32_t OH_ArkUI_GetGestureParam_angle (ArkUI_GestureRecognizer *recognizer, double *angle) Obtains the minimum angle change required for a rotation gesture to be recognized by a gesture recognizer.
int32_t OH_ArkUI_GetGestureParam_distanceThreshold (ArkUI_GestureRecognizer *recognizer, double *distanceThreshold) Obtains the movement threshold for gestures to be recognized by a gesture recognizer.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

0  赞