Extending Text Styles - Adding Dashed/Double Underline
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-view.h
index e611c3c..7b14c8c 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEXT_VIEW_H__
-#define __DALI_TOOLKIT_TEXT_VIEW_H__
+#ifndef DALI_TOOLKIT_TEXT_VIEW_H
+#define DALI_TOOLKIT_TEXT_VIEW_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 namespace Dali
 {
-
-struct Vector2;
-
 namespace Toolkit
 {
-
 namespace Text
 {
-
 /**
  * @brief View provides an interface between the Text layout engine and rendering back-end.
  */
 class View : public ViewInterface
 {
 public:
-
   /**
    * @brief Create a new instance of a View.
    */
@@ -55,67 +49,192 @@ public:
    *
    * @param[in] visualModel The visual model used by the View.
    */
-  void SetVisualModel( VisualModelPtr visualModel );
+  void SetVisualModel(VisualModelPtr visualModel);
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetControlSize()
+   */
+  const Vector2& GetControlSize() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetLayoutSize()
+   */
+  const Vector2& GetLayoutSize() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfGlyphs()
    */
-  virtual Length GetNumberOfGlyphs() const;
+  Length GetNumberOfGlyphs() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
    */
-  virtual void GetGlyphs( GlyphInfo* glyphs,
-                          GlyphIndex glyphIndex,
-                          Length numberOfGlyphs ) const;
+  virtual Length GetGlyphs(GlyphInfo* glyphs,
+                           Vector2*   glyphPositions,
+                           float&     minLineOffset,
+                           GlyphIndex glyphIndex,
+                           Length     numberOfGlyphs) const;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetColors()
+   */
+  const Vector4* const GetColors() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetColorIndices()
+   */
+  const ColorIndex* const GetColorIndices() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColors()
+   */
+  const Vector4* const GetBackgroundColors() const override;
 
   /**
-   * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphPositions()
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColorIndices()
    */
-  virtual void GetGlyphPositions( Vector2* glyphPositions,
-                                  GlyphIndex glyphIndex,
-                                  Length numberOfGlyphs ) const;
+  const ColorIndex* const GetBackgroundColorIndices() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupBackgroundColorSet()
+   */
+  bool const IsMarkupBackgroundColorSet() const;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
    */
-  virtual const Vector4& GetTextColor() const;
+  const Vector4& GetTextColor() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowOffset()
    */
-  virtual const Vector2& GetShadowOffset() const;
+  const Vector2& GetShadowOffset() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowColor()
    */
-  virtual const Vector4& GetShadowColor() const;
+  const Vector4& GetShadowColor() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineColor()
    */
-  virtual const Vector4& GetUnderlineColor() const;
+  const Vector4& GetUnderlineColor() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::IsUnderlineEnabled()
    */
-  virtual bool IsUnderlineEnabled() const;
+  bool IsUnderlineEnabled() const override;
+
+  /**
+  * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
+  */
+  const GlyphInfo* GetHyphens() const override;
+
+  /**
+  * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
+  */
+  const Length* GetHyphenIndices() const override;
+
+  /**
+  * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
+  */
+  Length GetHyphensCount() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineHeight()
    */
-  virtual float GetUnderlineHeight() const;
+  float GetUnderlineHeight() const override;
 
-private:
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineType()
+   */
+  Text::Underline::Type GetUnderlineType() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetDashedUnderlineWidth()
+   */
+  float GetDashedUnderlineWidth() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetDashedUnderlineGap()
+   */
+  float GetDashedUnderlineGap() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfUnderlineRuns()
+   */
+  Length GetNumberOfUnderlineRuns() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineRuns()
+   */
+  virtual void GetUnderlineRuns(GlyphRun*         underlineRuns,
+                                UnderlineRunIndex index,
+                                Length            numberOfRuns) const;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineColor()
+   */
+  const Vector4& GetOutlineColor() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineWidth()
+   */
+  uint16_t GetOutlineWidth() const override;
+
+  /**
+  * @copydoc Dali::Toolkit::Text::ViewInterface::GetEllipsisPosition()
+  */
+  DevelText::EllipsisPosition::Type GetEllipsisPosition() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::IsTextElideEnabled()
+   */
+  bool IsTextElideEnabled() const override;
 
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetStartIndexOfElidedGlyphs()
+   */
+  GlyphIndex GetStartIndexOfElidedGlyphs() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetEndIndexOfElidedGlyphs()
+   */
+  GlyphIndex GetEndIndexOfElidedGlyphs() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetFirstMiddleIndexOfElidedGlyphs()
+   */
+  GlyphIndex GetFirstMiddleIndexOfElidedGlyphs() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetSecondMiddleIndexOfElidedGlyphs()
+   */
+  GlyphIndex GetSecondMiddleIndexOfElidedGlyphs() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughColor()
+   */
+  const Vector4& GetStrikethroughColor() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::IsStrikethroughEnabled()
+   */
+  bool IsStrikethroughEnabled() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughHeight()
+   */
+  float GetStrikethroughHeight() const override;
+
+private:
   // Undefined
-  View( const View& handle );
+  View(const View& handle);
 
   // Undefined
-  View& operator=( const View& handle );
+  View& operator=(const View& handle);
 
 private:
-
   struct Impl;
   Impl* mImpl;
 };
@@ -125,4 +244,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_VIEW_H__
+#endif // DALI_TOOLKIT_TEXT_VIEW_H