diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index e11e7282f86cd8b9c9f0a27b3467c93775ac512b..4320a6c8bfb41d1f144372832950fee287506f8f 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2746,5 +2746,9 @@ { "first_introduced": "16", "name": "OH_ArkUI_UIInputEvent_GetModifierKeyStates" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_GestureInterrupter_GetUserData" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index 1c03c3746bbd8127f4a569001b3cac877454fb23..38d3d7bed9266992b677023348fce56064c2cd5e 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -925,6 +925,41 @@ typedef struct { int32_t countNum, int32_t fingersNum, double distanceThreshold); } ArkUI_NativeGestureAPI_1; +/** + * @brief Defines the gesture APIs. + * + * @since 16 + */ +typedef struct { + /** + * @brief Pointer to the ArkUI_NativeGestureAPI_1 struct. + */ + ArkUI_NativeGestureAPI_1* gestureApi1; + + /** + * @brief Sets the callback for gesture interruption events. + * + * @param node Node for which you want to set a gesture interruption callback. + * @param userData Custom data. + * @param interrupter Gesture interruption callback to set. info indicates the gesture interruption data. + * If interrupter returns GESTURE_INTERRUPT_RESULT_CONTINUE, the gesture recognition process proceeds + * properly. If it returns GESTURE_INTERRUPT_RESULT_REJECT, the gesture recognition process is paused. + * @return Returns 0 if success. + * Returns 401 if a parameter error occurs. + */ + int32_t (*setGestureInterrupterToNode)(ArkUI_NodeHandle node, void* userData, + ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info)); +} ArkUI_NativeGestureAPI_2; + +/** +* @brief Obtains the custom data from a gesture interruption event. +* +* @param event Pointer to the gesture interruption information. +* @return Returns the pointer to the custom data. +* @since 16 +*/ +void* OH_ArkUI_GestureInterrupter_GetUserData(ArkUI_GestureInterruptInfo* event); + #ifdef __cplusplus }; #endif