X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-effects-style.h;h=d87e8100436583e93d01e65097a1087045c19108;hb=7946b5a1a7188e31803ac8de5c4a8ea3cbc560cc;hp=436e8d132dd1517aff13fefd6d3d579724373a53;hpb=70fdb1a1e8e2660c383079ae49bc94fbe14943d1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-effects-style.h b/dali-toolkit/internal/text/text-effects-style.h index 436e8d1..d87e810 100644 --- a/dali-toolkit/internal/text/text-effects-style.h +++ b/dali-toolkit/internal/text/text-effects-style.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_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. @@ -20,6 +20,8 @@ // INTERNAL INCLUDES #include +#include +#include namespace Dali { @@ -27,6 +29,12 @@ namespace Toolkit { namespace Text { +const Scripting::StringEnum UNDERLINE_TYPE_STRING_TABLE[] = + { + {"solid", Text::Underline::SOLID}, + {"dashed", Text::Underline::DASHED}, + {"double", Text::Underline::DOUBLE}}; +const unsigned int UNDERLINE_TYPE_STRING_TABLE_COUNT = sizeof(UNDERLINE_TYPE_STRING_TABLE) / sizeof(UNDERLINE_TYPE_STRING_TABLE[0]); namespace EffectStyle { enum Type @@ -60,13 +68,22 @@ bool ParseShadowProperties(const Property::Map& shadowProperties, * @param[out] color The underline's color. * @param[out] heightDefined Whether the underline's height is defined. * @param[out] height The underline's height. + * @param[out] type The underline's type; DASHED, DOUBLE, etc. Default is a solid underline. + * @param[out] dashWidth The dashed underline's width. + * @param[out] dashGap The dashed underline's gap. */ -bool ParseUnderlineProperties(const Property::Map& underlineProperties, - bool& enabled, - bool& colorDefined, - Vector4& color, - bool& heightDefined, - float& height); +bool ParseUnderlineProperties(const Property::Map& underlineProperties, + bool& enabled, + bool& colorDefined, + Vector4& color, + bool& heightDefined, + float& height, + bool& typeDefined, + Text::Underline::Type& type, + bool& widthDefined, + float& dashWidth, + bool& dashGapDefined, + float& dashGap); /** * @brief Parses the outline properties. @@ -107,11 +124,11 @@ bool ParseBackgroundProperties(const Property::Map& backgroundProperties, * @param[out] height The strikethrough's height. */ bool ParseStrikethroughProperties(const Property::Map& strikethroughProperties, - bool& enabled, - bool& colorDefined, - Vector4& color, - bool& heightDefined, - float& height); + bool& enabled, + bool& colorDefined, + Vector4& color, + bool& heightDefined, + float& height); /** * @brief Sets the underline properties. @@ -233,6 +250,15 @@ bool SetBackgroundProperties(ControllerPtr controller, const Property::Value& va */ void GetBackgroundProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type); +/** + * @brief Converts a underline type string into @e Underline::Type + * + * @param[in] underlineTypeStr The underline type string. Must end with '\0'. + * + * @return The @e Underline::Type value corresponding to the string. + */ +Underline::Type StringToUnderlineType(const char* const underlineTypeStr); + } // namespace Text } // namespace Toolkit