diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index b96cd551674bb7083825c035265551b122835ea4..19a04658aa12872a98d9391b4b1a3a3b2dbd64f6 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1302,6 +1302,50 @@ "first_introduced": "13", "name": "OH_ArkUI_NodeUtils_RemoveCustomProperty" }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetCustomProperty" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetParentInPageTree" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetActiveChildrenInfo" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetCurrentPageRootNode" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_IsCreatedByNDK" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_NodeUtils_GetNodeType" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_CustomProperty_Destroy" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_CustomProperty_GetStringValue" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ActiveChildrenInfo_Destroy" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex" + }, + { + "first_introduced": "14", + "name": "OH_ArkUI_ActiveChildrenInfo_GetCount" + }, { "first_introduced": "12", "name": "OH_ArkUI_ListChildrenMainSizeOption_Create" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 4bdcc29761cddbdc4b9b869b8e36d4e345998690..d4f8c0f876a724aedc6204c8bd52e73eda9d7770 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -7713,6 +7713,69 @@ void OH_ArkUI_NodeUtils_AddCustomProperty(ArkUI_NodeHandle node, const char* nam */ void OH_ArkUI_NodeUtils_RemoveCustomProperty(ArkUI_NodeHandle node, const char* name); +/** + * @brief Get the value of the custom property of the component. + * + * @param node ArkUI-NodeHandle pointer. + * @param name The name of the custom attribute. + * @param handle The structure of the custom attribute corresponding to the key parameter name obtained. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. + * @since 14 + */ +int32_t OH_ArkUI_NodeUtils_GetCustomProperty(ArkUI_NodeHandle node, const char* name, ArkUI_CustomProperty** handle); + +/** + * @brief Get the parent node to obtain the component nodes created by ArkTs. + * + * @param node Target node object. + * @return Return the pointer of the component. + * @since 14 + */ +ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetParentInPageTree(ArkUI_NodeHandle node); + +/** + * @brief Retrieve all active child nodes of a node. Span and ImageSpan will not be counted in the children. + * + * @param head Pass in the node that needs to be obtained. + * @param handle The structure corresponding to the sub node information of the head node. + * @return Error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} success. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function parameter exception. + * @since 14 + */ +int32_t OH_ArkUI_NodeUtils_GetActiveChildrenInfo(ArkUI_NodeHandle head, ArkUI_ActiveChildrenInfo** handle); + +/** + * @brief Retrieve the root node of the current page. + * + * @param node Target node object. + * @return Return the pointer of the component. + * @since 14 + */ +ArkUI_NodeHandle OH_ArkUI_NodeUtils_GetCurrentPageRootNode(ArkUI_NodeHandle node); + +/** + * @brief Retrieve whether the component is labeled by C-API. + * + * @param node Target node object. + * @return Return whether the node is a Tag created by C-API, + * true represents created by C-API, false represents not created by C-API. + * @since 14 + */ +bool OH_ArkUI_NodeUtils_IsCreatedByNDK(ArkUI_NodeHandle node); + +/** + * @brief Get the type of node. + * + * @param node Target node object. + * @return Return the type of the node. + * For specific open types, refer to {@link ArkUI_NodeType}. For unopened nodes, return -1. + * @since 14 + */ +int32_t OH_ArkUI_NodeUtils_GetNodeType(ArkUI_NodeHandle node); + /** * @brief Collapse the ListItem in its expanded state. * diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 67c89209795b78643cc35ffae12bfcf5ae4b9490..a91274027e61961cc7d4972d3eb075c5869e6753 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -186,6 +186,20 @@ typedef struct ArkUI_AccessibilityState ArkUI_AccessibilityState; */ typedef struct ArkUI_AccessibilityValue ArkUI_AccessibilityValue; +/** + * @brief Define the information of the Custom Property class for custom properties. + * + * @since 14 + */ +typedef struct ArkUI_CustomProperty ArkUI_CustomProperty; + +/** + * @brief Define ActiveChildenInfo class information. + * + * @since 14 + */ +typedef struct ArkUI_ActiveChildrenInfo ArkUI_ActiveChildrenInfo; + /** * @brief Defines the event callback type. * @@ -3878,6 +3892,49 @@ void OH_ArkUI_AccessibilityValue_SetText(ArkUI_AccessibilityValue* value, const * @since 12 */ const char* OH_ArkUI_AccessibilityValue_GetText(ArkUI_AccessibilityValue* value); + +/** + * @brief Destroy the instance of Customs Property. + * + * @param handle The instance of Customs Property to be destroyed. + * @since 14 + */ +void OH_ArkUI_CustomProperty_Destroy(ArkUI_CustomProperty* handle); + +/** + * @brief Get custom attribute value information. + * + * @param handle Custom attribute object pointer. + * @return Customize the value information within the attribute structure. + * @since 14 + */ +const char* OH_ArkUI_CustomProperty_GetStringValue(ArkUI_CustomProperty* handle); + +/** + * @brief Destroy ActiveChildenInfo instance. + * + * @param handle ActiveChild instance to be destroyed. + * @since 14 + */ +void OH_ArkUI_ActiveChildrenInfo_Destroy(ArkUI_ActiveChildrenInfo* handle); + +/** + * @brief Retrieve the child nodes of ActiveChildenInfo with the structure index. + * + * @param handle The ActiveChildenInfo instance for obtaining information. + * @return The child node pointer corresponding to the index. Return nullptr in case of exception. + * @since 14 + */ +ArkUI_NodeHandle OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex(ArkUI_ActiveChildrenInfo* handle, int32_t index); + +/** + * @brief Retrieve the number of nodes within the structure of ActiveChildenInfo. + * + * @param handle The ActiveChildenInfo instance for obtaining information. + * @return Number of child nodes. Default value: 0. + * @since 14 + */ +int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle); #ifdef __cplusplus }; #endif