From a04846d02181968cd155394d2f9fbdc4f328887f Mon Sep 17 00:00:00 2001 From: sunbees Date: Tue, 15 Jul 2025 23:28:42 +0800 Subject: [PATCH] add OH_ArkUI_GetNodeContentFromAniValue Signed-off-by: sunbees --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_node_ani.h | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 1b30d853b..432a66c2a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3311,6 +3311,10 @@ "first_introduced": "20", "name": "OH_ArkUI_NativeModule_GetContextFromAniValue" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_NativeModule_GetNodeContentFromAniValue" + }, { "first_introduced": "20", "name": "OH_ArkUI_NativeModule_GetNavDestinationAniParam" diff --git a/arkui/ace_engine/native/native_node_ani.h b/arkui/ace_engine/native/native_node_ani.h index 2c57add16..549871cf9 100644 --- a/arkui/ace_engine/native/native_node_ani.h +++ b/arkui/ace_engine/native/native_node_ani.h @@ -74,6 +74,21 @@ int32_t OH_ArkUI_NativeModule_GetNodeHandleFromAniValue(ani_env* env, ani_object */ int32_t OH_ArkUI_NativeModule_GetContextFromAniValue(ani_env* env, ani_object context, ArkUI_ContextHandle* handle); +/** + * @brief Obtains a NodeContent object on the ArkTS side and maps it to an ArkUI_NodeContentHandle + * object on the native side. + * + * @param env Indicates the ANI environment pointer. + * @param nodeContent Indicates the NodeContent object created on the ArkTS side. + * @param content Indicates the pointer to the ArkUI_NodeContentHandle object. + * @return Returns the error 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 + */ +int32_t OH_ArkUI_NativeModule_GetNodeContentFromAniValue( + ani_env *env, ani_object nodeContent, ArkUI_NodeContentHandle *content); + /** * @brief Obtains the parameters of the NavDestination component where the node is located. * @@ -94,4 +109,4 @@ ArkUI_ErrorCode OH_ArkUI_NativeModule_GetNavDestinationAniParam(ArkUI_NodeHandle #endif #endif // ARKUI_NATIVE_NODE_ANI_H -/** @} */ \ No newline at end of file +/** @} */ -- Gitee