diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 29a073a02fd05579caba2e466abc7f8782b01d30..48c300a22a9a39a93b97cd81d2971b06fbee9964 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3362,5 +3362,13 @@ { "first_introduced": "20", "name": "OH_ArkUI_DragEvent_IsRemote" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PreventGestureRecognizerBegin" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_SetTouchTestDoneCallback" } ] \ 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 aa4b37c23759e2e08572eee0a3454cc0ba76113f..e553f19116eca4273d469e1501b296b7807b2429 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -867,6 +867,43 @@ ArkUI_ErrorCode OH_ArkUI_PanGesture_SetDistanceMap( */ ArkUI_ErrorCode OH_ArkUI_PanGesture_GetDistanceByToolType( ArkUI_GestureRecognizer* recognizer, int toolType, double* distance); +/** + * @brief Registers a callback to be executed after all gesture recognizers have been collected. + * When the user begins touching the screen, the system performs hit testing and collects gesture + * recognizers based on the touch location. + * Subsequently, before processing any move events, the component can use this API to determine + * the gesture recognizers that will participate in the recognition and compete with each other. + * + * @param node Node to set the callback for gesture collection completion. + * @param userData Indicates the custom data. + * @param recognizerCollected Callback for gesture collection completion. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +ArkUI_ErrorCode OH_ArkUI_SetTouchTestDoneCallback( + ArkUI_NodeHandle node, + void* userData, + void (*touchTestDone)( + ArkUI_GestureEvent* event, + ArkUI_GestureRecognizerHandleArray recognizers, + int32_t count, + void* userData + ) +); + +/** + * @brief Prevents a gesture recognizer from participating in the current gesture recognition + * before all fingers are lifted. If the system has already determined the result of this gesture + * recognizer (whether successful or not), calling this API will have no effect. + * + * @param recognizer Pointer to the gesture recognizer. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +ArkUI_ErrorCode OH_ArkUI_PreventGestureRecognizerBegin(ArkUI_GestureRecognizer* recognizer); /** * @brief Defines the gesture APIs.