Resolve cases for strikethrough when using multiple <s> tags
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / styles / strikethrough-helper-functions.h
index b3df7ef..c5c5141 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/underlined-glyph-run.h>
+#include <dali-toolkit/internal/text/strikethrough-glyph-run.h>
 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
 
 namespace Dali
@@ -33,7 +33,48 @@ namespace Toolkit
 namespace Text
 {
 /**
- * @brief Calculate the current underline height and update maximum underline height
+ * @brief Whether the glyph at index is strikethrough or not. If true then return iterator to the run containes index.
+ *
+ * @param[in] index the index of glyph.
+ * @param[in] strikethroughRuns the strikethrough runs.
+ * @param[out] currentStrikethroughGlyphRunIt the iterator of current strikethrough glyph run.
+ *
+ * @return true if glyph at index is strikethrough
+ */
+bool IsGlyphStrikethrough(GlyphIndex                                    index,
+                          const Vector<StrikethroughGlyphRun>&          strikethroughRuns,
+                          Vector<StrikethroughGlyphRun>::ConstIterator& currentStrikethroughGlyphRunIt);
+
+/**
+ * @brief Check the current strikethrough glyph run iterator if not empty and its height is defined then return ts height. Otherwise return the common strikethrough height.
+ *
+ * @param[in] strikethroughRuns the strikethrough runs.
+ * @param[in] currentStrikethroughGlyphRunIt the iterator of current strikethrough glyph run.
+ * @param[in] strikethroughHeight the common strikethrough height.
+ *
+ * @return the determined strikethrough height
+ */
+float GetCurrentStrikethroughHeight(const Vector<StrikethroughGlyphRun>&         strikethroughRuns,
+                                    Vector<StrikethroughGlyphRun>::ConstIterator currentStrikethroughGlyphRunIt,
+                                    const float                                  strikethroughHeight);
+
+/**
+ * @brief Check the current strikethrough glyph run iterator if not empty and isGlyphStrikethrough is true then return its StrikethroughProperties. Otherwise return the common strikethrough properties.
+ *
+ * @param[in] isGlyphStrikethrough whether the glyph is strikethrough.
+ * @param[in] strikethroughRuns the strikethrough runs.
+ * @param[in] currentStrikethroughGlyphRunIt the iterator of current strikethrough glyph run.
+ * @param[in] commonStrikethroughProperties the common strikethrough properties.
+ *
+ * @return the determined strikethrough properties
+ */
+StrikethroughStyleProperties GetCurrentStrikethroughProperties(const bool&                                  isGlyphStrikethrough,
+                                                               const Vector<StrikethroughGlyphRun>&         strikethroughRuns,
+                                                               Vector<StrikethroughGlyphRun>::ConstIterator currentStrikethroughGlyphRunIt,
+                                                               const StrikethroughStyleProperties&          commonStrikethroughProperties);
+
+/**
+ * @brief Calculate the current strikethrough height and update maximum strikethrough height
  *
  * @param[inout] currentStrikethroughHeight the current strikethrough height.
  * @param[inout] maxStrikethroughHeight the maximum strikethrough height.