X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Ftext-controls%2Ftext-label-devel.h;h=ed2e5d9c7a6463a073c6585bdd6640ad0f2b39d0;hb=e591332735fe123a1d72ec7b88133a5dc14dc493;hp=205950c27903e1a93bbe2a6f7911a82c95caa601;hpb=d7bf9a0c46a7900e7c066711463babd639154f73;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 205950c..ed2e5d9 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 @@ -18,6 +18,9 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include @@ -194,10 +197,70 @@ enum Type * 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, + + /** + * @brief Whether to trim the xBearing of first glyph of the text. + * @details Name "removeFrontInset", type Property::BOOLEAN. + */ + REMOVE_FRONT_INSET, + + /** + * @brief Whether to trim the advance of last glyph of the text. + * @details Name "removeBackInset", type Property::BOOLEAN. + */ + REMOVE_BACK_INSET, }; } // 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. @@ -223,6 +286,72 @@ DALI_TOOLKIT_API Vector GetTextSize(TextLabel textLabel, const uint32_t 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 Set removing front inset to text label. + * + * @param[in] textLabel The instance of TextLabel. + * @param[in] remove Whether front inset of text label has to be removed or not. + */ +DALI_TOOLKIT_API void SetRemoveFrontInset(TextLabel textLabel, const bool remove); + +/** + * @brief Whether front inset of text label is removed or not. + * + * @param[in] textLabel The instance of TextLabel. + * @return True if the front inset of text label is removed. + */ +DALI_TOOLKIT_API bool IsRemoveFrontInset(TextLabel textLabel); + +/** + * @brief Set removing back inset to text label. + * + * @param[in] textLabel The instance of TextLabel. + * @param[in] remove Whether back inset of text label has to be removed or not. + */ +DALI_TOOLKIT_API void SetRemoveBackInset(TextLabel textLabel, const bool remove); + +/** + * @brief Whether back inset of text label is removed or not. + * + * @param[in] textLabel The instance of TextLabel. + * @return True if the back inset of text label is removed. + */ +DALI_TOOLKIT_API bool IsRemoveBackInset(TextLabel textLabel); + +/** * @brief Anchor clicked signal type. * * @note Signal