X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Ftext-controls%2Ftext-label-devel.h;h=d60c205a7855055eabb27ed14936b122c232527b;hp=f1406fb777b74b2a8e8b287c05b872895413b766;hb=a70d28d882e56f123f8eec322b4ca9594b2307cd;hpb=3a2dfe800fe4ec8214f42b28b3851ea8b8ffc72b diff --git a/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h old mode 100755 new mode 100644 index f1406fb..d60c205 --- a/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,58 +23,55 @@ namespace Dali { - namespace Toolkit { - namespace DevelTextLabel { - namespace Property { - enum Type - { - TEXT = Dali::Toolkit::TextLabel::Property::TEXT, - FONT_FAMILY = Dali::Toolkit::TextLabel::Property::FONT_FAMILY, - FONT_STYLE = Dali::Toolkit::TextLabel::Property::FONT_STYLE, - POINT_SIZE = Dali::Toolkit::TextLabel::Property::POINT_SIZE, - MULTI_LINE = Dali::Toolkit::TextLabel::Property::MULTI_LINE, - HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, - VERTICAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, - ENABLE_MARKUP = Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP, - ENABLE_AUTO_SCROLL = Dali::Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, - AUTO_SCROLL_SPEED = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED, - AUTO_SCROLL_LOOP_COUNT = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, - AUTO_SCROLL_GAP = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_GAP, - LINE_SPACING = Dali::Toolkit::TextLabel::Property::LINE_SPACING, - UNDERLINE = Dali::Toolkit::TextLabel::Property::UNDERLINE, - SHADOW = Dali::Toolkit::TextLabel::Property::SHADOW, - EMBOSS = Dali::Toolkit::TextLabel::Property::EMBOSS, - OUTLINE = Dali::Toolkit::TextLabel::Property::OUTLINE, - PIXEL_SIZE = Dali::Toolkit::TextLabel::Property::PIXEL_SIZE, - ELLIPSIS = Dali::Toolkit::TextLabel::Property::ELLIPSIS, - AUTO_SCROLL_LOOP_DELAY = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY, - AUTO_SCROLL_STOP_MODE = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE, - LINE_COUNT = Dali::Toolkit::TextLabel::Property::LINE_COUNT, - LINE_WRAP_MODE = Dali::Toolkit::TextLabel::Property::LINE_WRAP_MODE, - - /** +enum Type +{ + TEXT = Dali::Toolkit::TextLabel::Property::TEXT, + FONT_FAMILY = Dali::Toolkit::TextLabel::Property::FONT_FAMILY, + FONT_STYLE = Dali::Toolkit::TextLabel::Property::FONT_STYLE, + POINT_SIZE = Dali::Toolkit::TextLabel::Property::POINT_SIZE, + MULTI_LINE = Dali::Toolkit::TextLabel::Property::MULTI_LINE, + HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, + VERTICAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, + ENABLE_MARKUP = Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP, + ENABLE_AUTO_SCROLL = Dali::Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, + AUTO_SCROLL_SPEED = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED, + AUTO_SCROLL_LOOP_COUNT = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, + AUTO_SCROLL_GAP = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_GAP, + LINE_SPACING = Dali::Toolkit::TextLabel::Property::LINE_SPACING, + UNDERLINE = Dali::Toolkit::TextLabel::Property::UNDERLINE, + SHADOW = Dali::Toolkit::TextLabel::Property::SHADOW, + EMBOSS = Dali::Toolkit::TextLabel::Property::EMBOSS, + OUTLINE = Dali::Toolkit::TextLabel::Property::OUTLINE, + PIXEL_SIZE = Dali::Toolkit::TextLabel::Property::PIXEL_SIZE, + ELLIPSIS = Dali::Toolkit::TextLabel::Property::ELLIPSIS, + AUTO_SCROLL_LOOP_DELAY = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY, + AUTO_SCROLL_STOP_MODE = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE, + LINE_COUNT = Dali::Toolkit::TextLabel::Property::LINE_COUNT, + LINE_WRAP_MODE = Dali::Toolkit::TextLabel::Property::LINE_WRAP_MODE, + + /** * @brief The direction of the layout. * @details Name "textDirection", type [Type](@ref Dali::Toolkit::DevelText::TextDirection::Type) (Property::INTEGER), Read/Write * @note The text direction can be changed only by replacing the text itself. * @see TextDirection::Type for supported values. */ - TEXT_DIRECTION, + TEXT_DIRECTION, - /** + /** * @brief Alignment of text within area of single line * @details Name "verticalLineAlignment", type [Type](@ref Dali::Toolkit::DevelText::VerticalLineAlignment::Type) (Property::INTEGER), Read/Write * @note The default value is TOP * @see VerticalLineAlignment::Type for supported values */ - VERTICAL_LINE_ALIGNMENT, + VERTICAL_LINE_ALIGNMENT, - /** + /** * @brief The default text background parameters. * @details Name "textBackground", type Property::MAP. * @note Use "textBackground" as property name to avoid conflict with Control's "background" property @@ -86,19 +83,19 @@ namespace Property * | enable | BOOLEAN | No | True to enable the background or false to disable (the default value is false) | * | color | VECTOR4 | No | The color of the background (the default value is Color::CYAN) | */ - BACKGROUND, + BACKGROUND, - /** + /** * @brief Ignore spaces after text. * @details Name "ignoreSpacesAfterText", type (Property::BOLEAN), Read/Write * @note The default value is true */ - IGNORE_SPACES_AFTER_TEXT, + IGNORE_SPACES_AFTER_TEXT, - /** + /** * @brief Modifies the default text alignment to match the direction of the system language. * @details Name "matchSystemLanguageDirection", type (Property::BOLEAN), Read/Write - * @note The default value is false + * @note The default value is true * * If MATCH_SYSTEM_LANGUAGE_DIRECTION property set true, the default text alignment to match the direction of the system language. * @@ -108,15 +105,15 @@ namespace Property * * | TextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION | * |----------------------------------------------------------------------- - * | false (default) | true | + * | false | true (default) | * |-----------------------------------|----------------------------------| * | Hello world | Hello world | - * | ﻡﺮﺤﺑﺍ. | ﻡﺮﺤﺑﺍ. | + * | ﻡﺮﺤﺑﺍ. | ﻡﺮﺤﺑﺍ. | * */ - MATCH_SYSTEM_LANGUAGE_DIRECTION, + MATCH_SYSTEM_LANGUAGE_DIRECTION, - /** + /** * @brief The text fit parameters. * @details Name "textFit", type Property::MAP. * @note The default value is false @@ -131,24 +128,114 @@ namespace Property * | stepSize | FLOAT | No | Step Size for font increase (the default value is 1.f) | * | fontSizeType | STRING | No | The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize") | */ - TEXT_FIT, + TEXT_FIT, - /** + /** * @brief Sets the height of the line in points. * @details Name "lineSize", type Property::FLOAT. * @note If the font size is larger than the line size, it works with the font size. */ - MIN_LINE_SIZE, + MIN_LINE_SIZE, - /** + /** * @brief The type of rendering e.g. bitmap-based. * @details Name "renderingBackend", type Property::INT. */ - RENDERING_BACKEND, - }; + RENDERING_BACKEND, + + /** + * @brief The font size scale for scaling the specified font size up or down. + * @details name "fontSizeScale", type Property::FLOAT. + * @note The default value is 1.0 which does nothing. + * The given font size scale value is used for multiplying the specified font size before querying fonts. + * + * e.g. The rendering results of both cases are same. + * - fontSize: 15pt, fontSizeScale: 1.0 + * - fontSize: 10pt, fontSizeScale: 1.5 + */ + FONT_SIZE_SCALE, + + /** + * @brief True to enable the font size scale or false to disable. + * @details Name "enableFontSizeScale", type Property::BOOLEAN. + * @note The default value is true. + * If false, font size scale is not apppied. + */ + ENABLE_FONT_SIZE_SCALE, + + /** + * @brief The enumerations used to specify whether to position the ellipsis at the END, START or MIDDLE of the text. + * @details Name "EllipsisPosition", type [Type](@ref Dali::Toolkit::DevelText::EllipsisPosition::Type) (Property::INTEGER), or Property::STRING. Read/Write + * @note Default is EllipsisPosition::END. + * @see DevelText::EllipsisPosition + */ + ELLIPSIS_POSITION, +}; } // namespace Property +/** + * @brief Get the rendered size of a specific text range. + * if the requested text is at multilines, multiple sizes will be returned for each text located in a separate line. + * if a line contains characters with different directions, multiple sizes will be returned for each block of contiguous characters with the same direction. + * + * @param[in] textLabel The instance of TextLabel. + * @param[in] startIndex start index of the text requested to calculate size for. + * @param[in] endIndex end index(included) of the text requested to calculate size for. + * @return list of sizes of the reuested text. + */ +DALI_TOOLKIT_API Vector GetTextSize(TextLabel textLabel, const uint32_t startIndex, const uint32_t endIndex); + +/** + * @brief Get the top/left rendered position of a specific text range. + * if the requested text is at multilines, multiple positions will be returned for each text located in a separate line. + * if a line contains characters with different directions, multiple positions will be returned for each block of contiguous characters with the same direction. + * + * @param[in] textLabel The instance of TextLabel. + * @param[in] startIndex start index of the text requested to get position to. + * @param[in] endIndex end index(included) of the text requested to get position to. + * @return list of positions of the requested text. + */ +DALI_TOOLKIT_API Vector GetTextPosition(TextLabel textLabel, const uint32_t startIndex, const uint32_t endIndex); + +/** + * @brief Anchor clicked signal type. + * + * @note Signal + * - const char* : href of clicked anchor. + * - uint32_t : length of href. + */ +using AnchorClickedSignalType = Signal; + +/** + * @brief TextFit property changed signal type. + */ +using TextFitChangedSignalType = Signal; + +/** + * @brief This signal is emitted when the anchor is clicked. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(TextLabel textLabel, const char* href, uint32_t hrefLength); + * @endcode + * @param[in] textLabel The instance of TextLabel. + * @return The signal to connect to. + */ +DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextLabel textLabel); + +/** + * @brief This signal is emitted when the textfit property is changed. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(TextLabel textLabel); + * @endcode + * @param[in] textLabel The instance of TextLabel. + * @return The signal to connect to. + */ +DALI_TOOLKIT_API TextFitChangedSignalType& TextFitChangedSignal(TextLabel textLabel); + } // namespace DevelTextLabel } // namespace Toolkit