X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmarkup-processor-span.cpp;h=3e20c6feace7aedc59f57817c5fa22d158b1eb14;hb=d19410c023c18c050ae226c72c6d79ebf9b0de80;hp=40a508d80919c269fee19f1964d14e1867b04e27;hpb=85a9005b80fce7dedf0acc52cf73aa950905e3ec;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/markup-processor-span.cpp b/dali-toolkit/internal/text/markup-processor-span.cpp index 40a508d..3e20c6f 100644 --- a/dali-toolkit/internal/text/markup-processor-span.cpp +++ b/dali-toolkit/internal/text/markup-processor-span.cpp @@ -24,8 +24,12 @@ // INTERNAL INCLUDES #include #include +#include #include #include +#include +#include +#include namespace Dali { @@ -33,18 +37,19 @@ namespace Toolkit { namespace Text { -namespace -{ -const std::string XHTML_FAMILY_ATTRIBUTE("font-family"); -const std::string XHTML_SIZE_ATTRIBUTE("font-size"); -const std::string XHTML_WEIGHT_ATTRIBUTE("font-weight"); -const std::string XHTML_WIDTH_ATTRIBUTE("font-width"); -const std::string XHTML_SLANT_ATTRIBUTE("font-slant"); - -const std::string XHTML_COLOR_ATTRIBUTE("text-color"); -} // namespace - -void ProcessSpanTag(const Tag& tag, ColorRun& colorRun, FontDescriptionRun& fontRun, bool& isColorDefined, bool& isFontDefined) +void ProcessSpanTag(const Tag& tag, + ColorRun& colorRun, + FontDescriptionRun& fontRun, + UnderlinedCharacterRun& underlinedCharacterRun, + ColorRun& backgroundColorRun, + StrikethroughCharacterRun& strikethroughRun, + CharacterSpacingCharacterRun& characterSpacingCharacterRun, + bool& isColorDefined, + bool& isFontDefined, + bool& isUnderlinedCharacterDefined, + bool& isBackgroundColorDefined, + bool& isStrikethroughDefined, + bool& isCharacterSpacingDefined) { for(Vector::ConstIterator it = tag.attributes.Begin(), endIt = tag.attributes.End(); @@ -53,36 +58,81 @@ void ProcessSpanTag(const Tag& tag, ColorRun& colorRun, FontDescriptionRun& font { const Attribute& attribute(*it); - if(TokenComparison(XHTML_COLOR_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::TEXT_COLOR, attribute.nameBuffer, attribute.nameLength)) { isColorDefined = true; ProcessColor(attribute, colorRun); } - else if(TokenComparison(XHTML_FAMILY_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::BACKGROUND_COLOR, attribute.nameBuffer, attribute.nameLength)) + { + isBackgroundColorDefined = true; + ProcessColor(attribute, backgroundColorRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::FONT_FAMILY, attribute.nameBuffer, attribute.nameLength)) { isFontDefined = true; ProcessFontFamily(attribute, fontRun); } - else if(TokenComparison(XHTML_SIZE_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::FONT_SIZE, attribute.nameBuffer, attribute.nameLength)) { isFontDefined = true; ProcessFontSize(attribute, fontRun); } - else if(TokenComparison(XHTML_WEIGHT_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::FONT_WEIGHT, attribute.nameBuffer, attribute.nameLength)) { isFontDefined = true; ProcessFontWeight(attribute, fontRun); } - else if(TokenComparison(XHTML_WIDTH_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::FONT_WIDTH, attribute.nameBuffer, attribute.nameLength)) { isFontDefined = true; ProcessFontWidth(attribute, fontRun); } - else if(TokenComparison(XHTML_SLANT_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::FONT_SLANT, attribute.nameBuffer, attribute.nameLength)) { isFontDefined = true; ProcessFontSlant(attribute, fontRun); } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::UNDERLINE_COLOR, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessColorAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::UNDERLINE_HEIGHT, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessHeightAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::UNDERLINE_TYPE, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessTypeAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::UNDERLINE_DASH_GAP, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessDashGapAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::UNDERLINE_DASH_WIDTH, attribute.nameBuffer, attribute.nameLength)) + { + isUnderlinedCharacterDefined = true; + ProcessDashWidthAttribute(attribute, underlinedCharacterRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::STRIKETHROUGH_COLOR, attribute.nameBuffer, attribute.nameLength)) + { + isStrikethroughDefined = true; + ProcessColorAttribute(attribute, strikethroughRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::STRIKETHROUGH_HEIGHT, attribute.nameBuffer, attribute.nameLength)) + { + isStrikethroughDefined = true; + ProcessHeightAttribute(attribute, strikethroughRun); + } + else if(TokenComparison(MARKUP::SPAN_ATTRIBUTES::CHARACTER_SPACING_VALUE, attribute.nameBuffer, attribute.nameLength)) + { + isCharacterSpacingDefined = true; + ProcessValueAttribute(attribute, characterSpacingCharacterRun); + } } }