[dali_2.1.5] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-effects-style.h
index fb21fe9..a1b7bea 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H
 
 /*
- * Copyright (c) 2016 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
 {
-
 namespace Toolkit
 {
-
 namespace Text
 {
-
 namespace EffectStyle
 {
-  enum Type
-  {
-    DEFAULT, ///< The default text effect style.
-    INPUT    ///< The input text effect style.
-  };
+enum Type
+{
+  DEFAULT, ///< The default text effect style.
+  INPUT    ///< The input text effect style.
+};
 };
 
 /**
  * @brief Parses the shadow properties.
  *
+ * @param[in] shadowProperties The map with the shadow properties.
  * @param[out] colorDefined Whether the shadow's color is defined.
  * @param[out] color The shadow's color.
  * @param[out] offsetDefined Whether the shadow's offset is defined.
  * @param[out] offset The shadow's offset.
  */
-bool ParseProperties( const std::string& shadowProperties,
-                      bool& colorDefined,
-                      Vector4& color,
-                      bool& offsetDefined,
-                      Vector2& offset );
+bool ParseShadowProperties(const Property::Map& shadowProperties,
+                           bool&                colorDefined,
+                           Vector4&             color,
+                           bool&                offsetDefined,
+                           Vector2&             offset);
 
 /**
  * @brief Parses the underline properties.
  *
+ * @param[in] underlineProperties The map with the underline properties.
  * @param[out] enabled Whether the underline is enabled.
  * @param[out] colorDefined Whether the underline's color is defined.
  * @param[out] color The underline's color.
  * @param[out] heightDefined Whether the underline's height is defined.
  * @param[out] height The underline's height.
+ * @param[out] type The underline's type; DASHED, DOUBLE, etc. Default is a solid underline.
+ * @param[out] dashWidth The dashed underline's width.
+ * @param[out] dashGap The dashed underline's gap.
+ */
+bool ParseUnderlineProperties(const Property::Map&   underlineProperties,
+                              bool&                  enabled,
+                              bool&                  colorDefined,
+                              Vector4&               color,
+                              bool&                  heightDefined,
+                              float&                 height,
+                              bool&                  typeDefined,
+                              Text::Underline::Type& type,
+                              bool&                  widthDefined,
+                              float&                 dashWidth,
+                              bool&                  dashGapDefined,
+                              float&                 dashGap);
+
+/**
+ * @brief Parses the outline properties.
+ *
+ * @param[in] outlineProperties The map with the outline properties.
+ * @param[out] colorDefined Whether the outline's color is defined.
+ * @param[out] color The outline's color.
+ * @param[out] widthDefined Whether the outline's width is defined.
+ * @param[out] width The outline's width.
+ */
+bool ParseOutlineProperties(const Property::Map& outlineProperties,
+                            bool&                colorDefined,
+                            Vector4&             color,
+                            bool&                widthDefined,
+                            unsigned int&        width);
+
+/**
+ * @brief Parses the background properties.
+ *
+ * @param[in] backgroundProperties The map with the background properties.
+ * @param[out] enabled Whether the background is enabled.
+ * @param[out] colorDefined Whether the background color is defined.
+ * @param[out] color The background color.
+ */
+bool ParseBackgroundProperties(const Property::Map& backgroundProperties,
+                               bool&                enabled,
+                               bool&                colorDefined,
+                               Vector4&             color);
+
+/**
+ * @brief Parses the strikethrough properties.
+ *
+ * @param[in] strikethroughProperties The map with the strikethrough properties.
+ * @param[out] enabled Whether the strikethrough is enabled.
+ * @param[out] colorDefined Whether the strikethrough's color is defined.
+ * @param[out] color The strikethrough's color.
+ * @param[out] heightDefined Whether the strikethrough's height is defined.
+ * @param[out] height The strikethrough's height.
  */
-bool ParseProperties( const std::string& underlineProperties,
-                      bool& enabled,
-                      bool& colorDefined,
-                      Vector4& color,
-                      bool& heightDefined,
-                      float& height );
+bool ParseStrikethroughProperties(const Property::Map& strikethroughProperties,
+                              bool&                enabled,
+                              bool&                colorDefined,
+                              Vector4&             color,
+                              bool&                heightDefined,
+                              float&               height);
 
 /**
  * @brief Sets the underline properties.
@@ -78,7 +131,18 @@ bool ParseProperties( const std::string& underlineProperties,
  *
  * @return Whether the underline properties have been updated.
  */
-bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
+bool SetUnderlineProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
+
+/**
+ * @brief Sets the strikethrough properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[in] value The values of the strikethrough's properties.
+ * @param[in] type Whether the property is for the default strikethrough or the input strikethrough.
+ *
+ * @return Whether the strikethrough properties have been updated.
+ */
+bool SetStrikethroughProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Retrieves the underline's properties.
@@ -87,7 +151,16 @@ bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& va
  * @param[out] value The value of the underline's properties.
  * @param[in] type Whether the property is for the default underline or the input underline.
  */
-void GetUnderlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
+void GetUnderlineProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
+
+/**
+ * @brief Retrieves the strikethrough's properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[out] value The value of the strikethrough's properties.
+ * @param[in] type Whether the property is for the default strikethrough or the input strikethrough.
+ */
+void GetStrikethroughProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Sets the shadow properties.
@@ -98,7 +171,7 @@ void GetUnderlineProperties( ControllerPtr controller, Property::Value& value, E
  *
  * @return Whether the shadow properties have been updated.
  */
-bool SetShadowProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
+bool SetShadowProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Retrieves the shadow's properties.
@@ -107,7 +180,7 @@ bool SetShadowProperties( ControllerPtr controller, const Property::Value& value
  * @param[out] value The value of the shadow's properties.
  * @param[in] type Whether the property is for the default shadow or the input shadow.
  */
-void GetShadowProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
+void GetShadowProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Sets the emboss properties.
@@ -118,7 +191,7 @@ void GetShadowProperties( ControllerPtr controller, Property::Value& value, Effe
  *
  * @return Whether the emboss properties have been updated.
  */
-bool SetEmbossProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
+bool SetEmbossProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Retrieves the emboss's properties.
@@ -127,7 +200,7 @@ bool SetEmbossProperties( ControllerPtr controller, const Property::Value& value
  * @param[out] value The value of the emboss's properties.
  * @param[in] type Whether the property is for the default emboss or the input emboss.
  */
-void GetEmbossProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
+void GetEmbossProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Sets the outline properties.
@@ -138,7 +211,7 @@ void GetEmbossProperties( ControllerPtr controller, Property::Value& value, Effe
  *
  * @return Whether the outline properties have been updated.
  */
-bool SetOutlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
+bool SetOutlineProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
 
 /**
  * @brief Retrieves the outline's properties.
@@ -147,7 +220,27 @@ bool SetOutlineProperties( ControllerPtr controller, const Property::Value& valu
  * @param[out] value The value of the outline's properties.
  * @param[in] type Whether the property is for the default outline or the input outline.
  */
-void GetOutlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
+void GetOutlineProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
+
+/**
+ * @brief Sets the background properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[in] value The values of the background's properties.
+ * @param[in] type Whether the property is for the default background or the input background.
+ *
+ * @return Whether the background properties have been updated.
+ */
+bool SetBackgroundProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
+
+/**
+ * @brief Retrieves the background's properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[out] value The value of the underline's properties.
+ * @param[in] type Whether the property is for the default background or the input background.
+ */
+void GetBackgroundProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
 
 } // namespace Text
 
@@ -155,4 +248,4 @@ void GetOutlineProperties( ControllerPtr controller, Property::Value& value, Eff
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H