From 4c00695935fe4bfb11bf50546ba4c58b7a68d1ba Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Mon, 25 Aug 2025 18:05:00 +0800 Subject: [PATCH] TextContentAlign CAPI Signed-off-by: wangxiuxiu96 --- arkui/ace_engine/native/native_node.h | 16 ++++++++++++++++ arkui/ace_engine/native/native_type.h | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 788f8045470..42fc1209568 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2491,6 +2491,22 @@ typedef enum { */ NODE_TEXT_VERTICAL_ALIGN = 1035, + /** + * @brief Sets the content align of the text. + * 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: content align of the text, specified using the {@link ArkUI_TextContentAlign} + * enum. The default value is ARKUI_TEXT_CONTENT_ALIGN_TOP. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: content align of the text, specified using the {@link ArkUI_TextContentAlign} + * enum. \n + * + * @since 21 + */ + NODE_TEXT_CONTENT_ALIGN = 1036, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f7b72cc37d0..94c0735120e 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -405,6 +405,20 @@ typedef enum { ARKUI_TEXT_VERTICAL_ALIGNMENT_TOP, } ArkUI_TextVerticalAlignment; +/** + * @brief Enumerates text content align styles. + * + * @since 21 + */ +typedef enum { + /** Top aligned. */ + ARKUI_TEXT_CONTENT_ALIGN_TOP = 0, + /** Center aligned. */ + ARKUI_TEXT_CONTENT_ALIGN_CENTER, + /** Bottom aligned. */ + ARKUI_TEXT_CONTENT_ALIGN_BOTTOM, +} ArkUI_TextContentAlign; + /** * @brief Enumerates the types of the Enter key for a single-line text box. * -- Gitee