X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Ftext-controls%2Ftext-label-devel.h;h=877125502b1c073f08b95e1bf971d89e1b13885d;hb=172fae8f3b64a9e14c725fbcccd51080117ca9aa;hp=6bcbdd01b1ae56f738151011686293f2d35fc170;hpb=c2a64c99bfb51070915cdb15559bd3be5d2f9998;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 index 6bcbdd0..8771255 100644 --- 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) 2021 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. @@ -18,6 +18,9 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include @@ -156,16 +159,154 @@ enum Type 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, + + /** + * @brief The default strikethrough parameters. + * @details Name "strikethrough", type Property::MAP. + * + * The strikethrough map contains the following keys: + * + * | %Property Name | Type | Required | Description | + * |----------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------| + * | enable | BOOLEAN | No | True to enable the strikethrough or false to disable (the default value is false) | + * | color | VECTOR4 | No | The color of the strikethrough (the default value is Color::BLACK) | + * | height | FLOAT | No | The height of the strikethrough (the default value is 0) | + * + */ + STRIKETHROUGH, + + /** + * @brief The spaces between characters in Pixels. + * @details Name "characterSpacing", type Property::FLOAT. + * @note + * A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed). + * The default value is 0.f which does nothing. + */ + CHARACTER_SPACING, + + /** + * @brief the relative height of the line (a factor that will be multiplied by text height). + * @details Name "relativeLineSize", type Property::FLOAT. + * @note If the value is less than 1, the lines could to be overlapped. + */ + RELATIVE_LINE_SIZE, + + /** + * @brief The anchor color that will be used by default in markup processing. + * @details Name "anchorColor", type Property::VECTOR4. + * @note If there is a color attribute in the anchor tag, the markup attribute takes precedence. + */ + ANCHOR_COLOR, + + /** + * @brief The anchor clicked color that will be used by default in markup processing. + * @details Name "anchorClickedColor", type Property::VECTOR4. + * @note If there is a color attribute in the anchor tag, the markup attribute takes precedence. + */ + ANCHOR_CLICKED_COLOR, }; } // namespace Property +struct FitOption +{ + FitOption(float pointSize = 0.0f, float minLineSize = 0.0f) + : mPointSize(pointSize), mMinLineSize(minLineSize) {} + + float GetPointSize() const + { + return mPointSize; + } + float GetMinLineSize() const + { + return mMinLineSize; + } + void SetPointSize(float pointSize) + { + mPointSize = pointSize; + } + void SetMinLineSize(float minLineSize) + { + mMinLineSize = minLineSize; + } + +private: + float mPointSize = 0.0f; + float mMinLineSize = 0.0f; +}; + +/** + * @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 Gets the bounding box of a specific text range. + * + * @param[in] textLabel The instance of TextLabel. + * @param[in] startIndex start index of the text requested to get bounding box to. + * @param[in] endIndex end index(included) of the text requested to get bounding box to. + * @return bounding box of the requested text. + */ +DALI_TOOLKIT_API Rect<> GetTextBoundingRectangle(TextLabel textLabel, uint32_t startIndex, uint32_t endIndex); + +/** + * @brief Set text fit array to text label. + * + * @param[in] textLabel The instance of TextLabel. + * @param[in] enable Whether the text fit array is enabled or not. + * @param[in] fitOptions list of the fit options. + */ +DALI_TOOLKIT_API void SetTextFitArray(TextLabel textLabel, const bool enable, std::vector& fitOptions); + +/** + * @brief Get the text fit array of text label. + * + * @param[in] textLabel The instance of TextLabel. + * @return list of the fit options. + */ +DALI_TOOLKIT_API std::vector& GetTextFitArray(TextLabel textLabel); + +/** + * @brief Whether the text fit array is enabled or not. + * + * @return True if the text fit array is enabled. + */ +DALI_TOOLKIT_API bool IsTextFitArrayEnabled(TextLabel textLabel); + /** * @brief Anchor clicked signal type. *