Support Markup Underline attributes
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / visual-model-impl.h
index 673156b..4bae17c 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali-toolkit/internal/text/color-run.h>
 #include <dali-toolkit/internal/text/line-run.h>
 #include <dali-toolkit/internal/text/strikethrough-glyph-run.h>
+#include <dali-toolkit/internal/text/underlined-glyph-run.h>
 #include <dali-toolkit/public-api/text/text-enumerations.h>
 
 // DEVEL INCLUDES
@@ -172,9 +173,9 @@ public:
    * @param[in] index Index of the first underline run to be copied.
    * @param[in] numberOfRuns Number of underline runs to be copied.
    */
-  void GetUnderlineRuns(GlyphRun*         underlineRuns,
-                        UnderlineRunIndex index,
-                        Length            numberOfRuns) const;
+  void GetUnderlineRuns(UnderlinedGlyphRun* underlineRuns,
+                        UnderlineRunIndex   index,
+                        Length              numberOfRuns) const;
 
   // Size interface
 
@@ -552,6 +553,30 @@ public:
    * @return Returns the override height for a strikethrough, 0 indicates that font metrics will determine the height
    */
   float GetStrikethroughHeight() const;
+  /**
+   * @brief Set the override used for character spacing.
+   *
+   * @note A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
+   *
+   * @param[in] characterSpacing The character spacing.
+   */
+  void SetCharacterSpacing(float characterSpacing);
+
+  /**
+   * @brief Retrieves the characterSpacing.
+   *
+   * @note A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
+   *
+   * @return Returns the characterSpacing.
+   */
+  const float GetCharacterSpacing() const;
+
+  /**
+   * @brief Retrieves the Glyphs to Characters Array.
+   *
+   * @return The GlyphsToCharacters.
+   */
+  const Vector<CharacterIndex>& GetGlyphsToCharacters() const;
 
   /**
    * @brief Retrieves the strikethrough runs.
@@ -597,7 +622,7 @@ public:
   Vector<Length>                mGlyphsPerCharacter;     ///< For each character, the number of glyphs that are shaped.
   Vector<Vector2>               mGlyphPositions;         ///< For each glyph, the position.
   Vector<LineRun>               mLines;                  ///< The laid out lines.
-  Vector<GlyphRun>              mUnderlineRuns;          ///< Runs of glyphs that are underlined.
+  Vector<UnderlinedGlyphRun>    mUnderlineRuns;          ///< Runs of glyphs that are underlined.
   Vector<Vector4>               mColors;                 ///< Colors of the glyphs.
   Vector<ColorIndex>            mColorIndices;           ///< Indices to the vector of colors for each glyphs.
   Vector<Vector4>               mBackgroundColors;       ///< Background colors of the glyphs.
@@ -640,6 +665,7 @@ public:
   bool       mMarkupProcessorEnabled : 1; ///< Markup-processor enabled flag
   HyphenInfo mHyphen;                     ///< Contains hyphen glyph info & the character index to draw hyphen after.
   bool       mStrikethroughEnabled : 1;   ///< Strikethrough enabled flag
+  float      mCharacterSpacing;           ///< Contains the value of the character spacing.
 };
 
 } // namespace Text