openharmony 鸿蒙 capi-arkui-nativemodule-arkui-nativegestureapi-2

2026-08-25 浏览 (1)

ArkUI_NativeGestureAPI_2

typedef struct {...} ArkUI_NativeGestureAPI_2

Overview

Defines a collection of gesture APIs.

Since: 18

Related module: ArkUI_NativeModule

Header file: native_gesture.h

Summary

Member Variables

NameDescription
ArkUI_NativeGestureAPI_1* gestureApi1Pointer to the ArkUI_NativeGestureAPI_1 struct.

Member Functions

NameDescription
int32_t (*setGestureInterrupterToNode)(ArkUI_NodeHandle node, void* userData,ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info))Sets the callback for gesture interruption events.

Member Function Description

setGestureInterrupterToNode()

int32_t (*setGestureInterrupterToNode)(ArkUI_NodeHandle node, void* userData, ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info))

Description

Sets the callback for gesture interruption events.

Parameters

NameDescription
ArkUI_NodeHandle nodePointer to the ArkUI node for which you want to set a gesture interruption callback.
void* userDataPointer to user-defined data.
ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info)Gesture interruption callback to set. info returns the gesture interruption data. If interrupter returns GESTURE_INTERRUPT_RESULT_CONTINUE, the gesture recognition process continues. If it returns GESTURE_INTERRUPT_RESULT_REJECT, the gesture recognition process is paused. If this parameter is set to a null pointer, the callback function is unregistered.
Note: After the event interruption callback is registered, it will be available in subsequent single-gesture processing. That is, even if you use the setGestureInterrupterToNode API to reset the gesture interruption callback to undefined or use the dispose API to dispose of the gesture that is about to be triggered, the callback will still respond when the trigger condition is met. If the object used in the callback has been released before the callback is triggered, you need to protect the object.

Return value

TypeDescription
int32_tError code.
Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful.
Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller

openharmony 鸿蒙 errorcode-canvas

openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent

openharmony 鸿蒙 errorcode-bindSheet

openharmony 鸿蒙 js-apis-arkui-uiExtension-sys

openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo

openharmony 鸿蒙 capi-arkui-rendernodeutils

openharmony 鸿蒙 js-apis-arkui-node

openharmony 鸿蒙 capi-native-node-h

openharmony 鸿蒙 capi-arkui-nativemodule-arkui-listitemswipeactionitem

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/NfoCrua6