From 7e8899334c938e80db659b5249349ca068ea5da7 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Sun, 27 Apr 2025 16:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4scope=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_node.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3a129e851..7a835267f 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3318,5 +3318,9 @@ { "first_introduced": "18", "name": "OH_ArkUI_PanGesture_GetDistanceByToolType" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RunTaskInScope" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c1458a02f..1981293f2 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -9255,6 +9255,21 @@ int32_t OH_ArkUI_GetNodeSnapshot(ArkUI_NodeHandle node, ArkUI_SnapshotOptions* s */ int32_t OH_ArkUI_NodeUtils_GetPositionToParent(ArkUI_NodeHandle node, ArkUI_IntOffset* globalOffset); +/** + * @brief Run a custom function inside the UIContext scope. + * + * @param uiContext ArkUI_ContextHandle. + * @param userData Indicates the pointer to the custom data. + * @param callback The custom function. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. + * Returns {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext is invalid. + * Returns {@link ARKUI_ERROR_CODE_CALLBACK_INVALID} if the callback function is invalid. + * @since 20 + */ +int32_t OH_ArkUI_RunTaskInScope(ArkUI_ContextHandle uiContext, void* userData, void(*callback)(void* userData)); + #ifdef __cplusplus }; #endif -- Gitee