X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmarkup-processor-span.cpp;h=19810ee240857703dad85546c05be712c124f380;hp=d7bf5eb7224f40b2f1ba5e66e015057f51a381a3;hb=c49e595f12e9e56cd7c35262eb52ae1f2d9b685b;hpb=cbae9964e389c6a5cafa3a284f281609a0ed2e60 diff --git a/dali-toolkit/internal/text/markup-processor-span.cpp b/dali-toolkit/internal/text/markup-processor-span.cpp index d7bf5eb..19810ee 100644 --- a/dali-toolkit/internal/text/markup-processor-span.cpp +++ b/dali-toolkit/internal/text/markup-processor-span.cpp @@ -24,8 +24,10 @@ // INTERNAL INCLUDES #include #include +#include #include #include +#include #include namespace Dali @@ -43,6 +45,7 @@ const std::string XHTML_WIDTH_ATTRIBUTE("font-width"); const std::string XHTML_SLANT_ATTRIBUTE("font-slant"); const std::string XHTML_COLOR_ATTRIBUTE("text-color"); +const std::string XHTML_BACKGROUND_COLOR_ATTRIBUTE("background-color"); //the underlined character's attributes const std::string XHTML_UNDERLINE_COLOR_ATTRIBUTE("u-color"); @@ -50,15 +53,31 @@ const std::string XHTML_UNDERLINE_HEIGHT_ATTRIBUTE("u-height"); const std::string XHTML_UNDERLINE_TYPE_ATTRIBUTE("u-type"); const std::string XHTML_UNDERLINE_DASH_GAP_ATTRIBUTE("u-dash-gap"); const std::string XHTML_UNDERLINE_DASH_WIDTH_ATTRIBUTE("u-dash-width"); + +//the strikethroughed character's attributes +const std::string XHTML_STRIKETHROUGH_COLOR_ATTRIBUTE("s-color"); +const std::string XHTML_STRIKETHROUGH_HEIGHT_ATTRIBUTE("s-height"); + +//the character-spacing character's attributes +const std::string XHTML_CHARACTER_SPACING_VALUE_ATTRIBUTE("char-space-value"); + +//NOTE: the MAX_NUM_OF_ATTRIBUTES in "markup-processor.cpp" should be updated when add a new attribute for span tag. + } // namespace -void ProcessSpanTag(const Tag& tag, - ColorRun& colorRun, - FontDescriptionRun& fontRun, - UnderlinedCharacterRun& underlinedCharacterRun, - bool& isColorDefined, - bool& isFontDefined, - bool& isUnderlinedCharacterDefined) +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(); @@ -72,6 +91,11 @@ void ProcessSpanTag(const Tag& tag, isColorDefined = true; ProcessColor(attribute, colorRun); } + else if(TokenComparison(XHTML_BACKGROUND_COLOR_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isBackgroundColorDefined = true; + ProcessColor(attribute, backgroundColorRun); + } else if(TokenComparison(XHTML_FAMILY_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) { isFontDefined = true; @@ -122,6 +146,21 @@ void ProcessSpanTag(const Tag& tag, isUnderlinedCharacterDefined = true; ProcessDashWidthAttribute(attribute, underlinedCharacterRun); } + else if(TokenComparison(XHTML_STRIKETHROUGH_COLOR_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isStrikethroughDefined = true; + ProcessColorAttribute(attribute, strikethroughRun); + } + else if(TokenComparison(XHTML_STRIKETHROUGH_HEIGHT_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isStrikethroughDefined = true; + ProcessHeightAttribute(attribute, strikethroughRun); + } + else if(TokenComparison(XHTML_CHARACTER_SPACING_VALUE_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength)) + { + isCharacterSpacingDefined = true; + ProcessValueAttribute(attribute, characterSpacingCharacterRun); + } } }