From a2b4d9f987ebb8b52f68c8b1e395fe35662e8414 Mon Sep 17 00:00:00 2001 From: earnK Date: Fri, 13 Jun 2025 20:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E8=87=B4=E6=80=A7?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: earnK --- arkui/ace_engine/native/native_node.h | 121 +++++++++++--------------- 1 file changed, 51 insertions(+), 70 deletions(-) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c8cce8123..41b7dbd4d 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -2356,79 +2356,29 @@ typedef enum { NODE_IMMUTABLE_FONT_WEIGHT = 1030, /** - * @brief Defines the text line count attribute, which can only be obtained as required through APIs. - * - * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].i32: line count of the node. - * - * @since 20 - */ - NODE_TEXT_LINE_COUNT = 1031, - - /** - * @brief Sets a linear gradient effect for text. + * @brief Sets whether to optimize the trailing spaces at the end of each line during text layout. * 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].f32: start angle of the linear gradient. - * The setting takes effect only when direction is set to ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM. - * A positive value indicates a clockwise rotation from the origin, (0, 0). The default value is 180. \n - * .value[1].i32: direction of the linear gradient. When a direction other than - * ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM is set, the angle property is ignored. - * The parameter type is {@link ArkUI_LinearGradientDirection}. \n - * .value[2].i32: whether the colors are repeated. The default value is false. - * .object: array of color stops, each of which consists of a color and its stop position. - * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n - * colors: colors of the color stops. \n - * stops: stop positions of the color stops. \n - * size: number of colors. \n + * value[0].i32: whether to optimize trailing spaces at the end of each line during text layout. + * The default value is false. \n * \n * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].f32: start angle of the linear gradient. - * When direction is set to ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, angle at the set value; - * otherwise, it is at default value. \n - * .value[1].i32: direction of the linear gradient. \n - * .value[2].i32: whether the colors are repeated. \n - * .object: array of color stops, each of which consists of a color and its stop position. - * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n \n - * colors: colors of the color stops. \n - * stops: stop positions of the color stops. \n - * size: number of colors. \n + * value[0].i32: whether to optimize trailing spaces at the end of each line during text layout. \n * * @since 20 */ - NODE_TEXT_LINEAR_GRADIENT = 1033, + NODE_TEXT_OPTIMIZE_TRAILING_SPACE = 1032, /** - * @brief Sets a radial gradient effect for text. This attribute can be set, reset, and obtained as required through APIs. + * @brief Defines the text line count attribute, which can only be obtained as required through APIs. * - * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n - * .value[0]?.f32: X-coordinate of the radial gradient center relative to the upper left corner of the text. \n - * .value[1]?.f32: Y-coordinate of the radial gradient center relative to the upper left corner of the text. \n - * .value[2]?.f32: radius of the radial gradient. The default value is 0. \n - * .value[3]?.i32: whether the colors are repeated. - * The value 1 means that the colors are repeated, and 0 means the opposite.\n \n - * .object: array of color stops, each of which consists of a color and its stop position. - * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n - * colors: colors of the color stops. \n - * stops: stop positions of the color stops. \n - * size: number of colors. \n - * \n * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].f32: X-coordinate of the radial gradient center relative to the upper left corner of the text. \n - * .value[1].f32: Y-coordinate of the radial gradient center relative to the upper left corner of the text. \n - * .value[2].f32: radius of the radial gradient. The default value is 0. \n - * .value[3].i32: whether the colors are repeated. - * The value 1 means that the colors are repeated, and 0 means the opposite. \n - * .object: array of color stops, each of which consists of a color and its stop position. - * The parameter type is {@link ArkUI_ColorStop}. Invalid colors are automatically skipped. \n - * colors: colors of the color stops. \n - * stops: stop positions of the color stops. \n - * size: number of colors. \n + * .value[0].i32: line count of the node. * * @since 20 */ - NODE_TEXT_RADIAL_GRADIENT = 1034, + NODE_TEXT_LINE_COUNT = 1031, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. @@ -3197,6 +3147,7 @@ typedef enum { * @since 15 */ NODE_TEXT_INPUT_LETTER_SPACING = 7032, + /** * @brief Sets whether to enable preview text for the TextInput component. * This attribute can be set, reset, and obtained as required through APIs. @@ -3249,16 +3200,16 @@ typedef enum { * @since 20 */ NODE_TEXT_INPUT_ENABLE_FILL_ANIMATION = 7036, - + /** * @brief Set the line height of the input node. * 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: line height value. \n + * .value[0].i32: line height value. * \n * Format of the return value {@link ArkUI_AttributeItem}: \n - * .value[0].i32: line height value. \n + * .value[0].i32: line height value * * @since 20 */ @@ -3547,6 +3498,7 @@ typedef enum { * */ NODE_TEXT_AREA_SHOW_KEYBOARD_ON_FOCUS, + /** * @brief When this property is set, the height of the textArea component is calculated using this property. * @@ -3613,13 +3565,13 @@ typedef enum { NODE_TEXT_AREA_KEYBOARD_APPEARANCE = 8026, /** - * @brief Set the max lines of the node. This attrilbute can be set, reset, and obtained as required through APIs. + * @brief Set the max lines of the node. 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: max lines count. \n + * .value[0].i32: max lines count. * \n * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].i32: max lines count. \n + * .value[0].i32: max lines count.\n * * @since 20 */ @@ -3638,14 +3590,43 @@ typedef enum { */ NODE_TEXT_AREA_LINE_SPACING = 8028, + /** + * @brief Set the min lines of the node. 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: min lines count. + * \n + * Format of the return value {@link ArkUI_AttributeItem}: \n + * .value[0].i32: min line count.\n + * + * @since 20 + * + */ + NODE_TEXT_AREA_MIN_LINES = 8029, + + /** + * @brief Set the max lines of the node with scroll. + * 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: max lines count with scroll. + * \n + * Format of the return value {@link ArkUI_AttributeItem}: \n + * .value[0].i32: max line count with scroll.\n + * + * @since 20 + * + */ + NODE_TEXT_AREA_MAX_LINES_WITH_SCROLL = 8030, + /** * @brief Set the line height of the node. 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: line height value. \n + * .value[0].i32: line height value. * \n * Format of the return value {@link ArkUI_AttributeItem}: \n - * .value[0].i32: line height value. \n + * .value[0].i32: line height value. * * @since 20 */ @@ -6960,11 +6941,11 @@ typedef enum { */ NODE_TEXT_ON_DETECT_RESULT_UPDATE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_TEXT, /** - * @brief Defines the long press event for span + * @brief Defines the long press event for span. * * The event is triggered when the span is long pressed. * When the event callback occurs, the {@link ArkUI_NodeEvent} object can be obtained from the - * {@link ArkUI_UIInputEvent} object.\n + * {@link ArkUI_UIInputEvent} object. \n * @since 20 */ NODE_TEXT_SPAN_ON_LONG_PRESS = 1001, @@ -7212,7 +7193,7 @@ typedef enum { NODE_TEXT_INPUT_ON_CHANGE_WITH_PREVIEW_TEXT = 7013, /** - * @brief Defines the event triggered before content changes. + * @brief Defines the event triggered before content changes * * When the event callback occurs, the union type {@link ArkUI_NodeEvent} is {@link ArkUI_TextChangeEvent}. \n * {@link ArkUI_TextChangeEvent} contains the following parameters: \n @@ -7391,7 +7372,7 @@ typedef enum { NODE_TEXT_AREA_ON_CHANGE_WITH_PREVIEW_TEXT = 8012, /** - * @brief Defines the event triggered before content changes + * @brief Defines the event triggered before content changes. * * When the event callback occurs, the union type {@link ArkUI_NodeEvent} is {@link ArkUI_TextChangeEvent}. \n * {@link ArkUI_TextChangeEvent} contains the following parameters: \n -- Gitee