From c82b8b86e05f1841aaec4ed277b95f68208b1b37 Mon Sep 17 00:00:00 2001 From: Tintin9529 Date: Thu, 21 Nov 2024 11:06:34 +0800 Subject: [PATCH] feat: checkboxgroup capi Signed-off-by: Tintin9529 Change-Id: Iecae9f5a44f8275033ef54dc77c8135bae149cbc --- arkui/ace_engine/native/native_node.h | 123 +++++++++++++++++++++++++- 1 file changed, 122 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index d57414dcc..0da52628b 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -92,6 +92,8 @@ typedef enum { ARKUI_NODE_RADIO = 18, /** Image animator. */ ARKUI_NODE_IMAGE_ANIMATOR = 19, + /** Check box group. */ + ARKUI_NODE_CHECKBOX_GROUP = 20, /** Stack container. */ ARKUI_NODE_STACK = MAX_NODE_SCOPE_NUM, /** Swiper. */ @@ -3392,6 +3394,32 @@ typedef enum { */ NODE_CHECKBOX_SHAPE, + /** + * @brief Defines the name of the checkbox. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: component name. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: component name. \n + * + */ + NODE_CHECKBOX_NAME, + + /** + * @brief Defines the name of the checkbox. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: component name. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: component name. \n + * + */ + NODE_CHECKBOX_GROUP, + /** * @brief Defines the ID of the component. * This attribute can be set and obtained as required through APIs. @@ -4257,6 +4285,89 @@ typedef enum { */ NODE_IMAGE_ANIMATOR_ITERATION = 19006, + /** + * @brief Defines the name of the checkboxgroup. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .string: component name. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .string: component name. \n + * + */ + NODE_CHECKBOX_GROUP_NAME = MAX_NODE_SCOPE_NUM * ARKUI_NODE_CHECKBOX_GROUP, + + /** + * @brief Defines whether the checkboxgroup is selected. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether the checkboxgroup is selected. + * The value 1 means that the checkboxgroup is selected, and 0 means the opposite. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The value 1 means that the checkboxgroup is selected, and 0 means the opposite. \n + * + */ + NODE_CHECKBOX_GROUP_SELECT_ALL, + + /** + * @brief Defines the color of the checkboxgroup when it is selected. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: color of the checkboxgroup when it is selected, in 0xARGB format, + * for example, 0xFF1122FF. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: color of the checkboxgroup when it is selected, in 0xARGB format, for example, 0xFF1122FF. + * + */ + NODE_CHECKBOX_GROUP_SELECTED_COLOR, + /** + * @brief Defines the border color of the checkboxgroup when it is not selected. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF. + * + */ + NODE_CHECKBOX_GROUP_UNSELECTED_COLOR, + + /** + * @brief Defines the internal icon style of the checkboxgroup. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF.\n + * .value[1]?.f32: size of the internal mark, in vp. Optional.\n + * .value[2]?.f32: stroke width of the internal mark, in vp. Optional. The default value is 2. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: border color, in 0xARGB format, for example, 0xFF1122FF.\n + * .value[1].f32: size of the internal mark, in vp. \n + * .value[2].f32: stroke width of the internal mark, in vp. The default value is 2. \n + * + */ + NODE_CHECKBOX_GROUP_MARK, + + /** + * @brief Defines the shape of the checkboxgroup. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: component shape. The parameter type is {@link ArkUI_CheckboxShape}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: component shape. The parameter type is {@link ArkUI_CheckboxShape}. + * + */ + NODE_CHECKBOX_GROUP_SHAPE, + /** * @brief Defines the alignment mode of the child components in the container. This attribute can be set, reset, * and obtained as required through APIs. @@ -6176,7 +6287,17 @@ typedef enum { * */ NODE_IMAGE_ANIMATOR_EVENT_ON_FINISH = 19004, - + + /** + * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX_GROOUP + * component changes. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * ArkUI_NodeComponentEvent.data[0].i321: selected; 0: not selected.\n + */ + NODE_CHECKBOX_GROUP_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_CHECKBOX_GROUP, + /** * @brief Defines the event triggered when the index of the currently displayed element of this * ARKUI_NODE_SWIPER instance changes. -- Gitee