[ATSPI] I18N of name, description, action name and role name
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visual-factory / visual-base.h
index 8b0f576..3b03dbe 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_TOOLKIT_VISUAL_BASE_H
 #define DALI_TOOLKIT_VISUAL_BASE_H
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/object/base-handle.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal DALI_INTERNAL
 {
 namespace Visual
 {
 class Base;
 }
-}
+} // namespace DALI_INTERNAL
 
 namespace Visual
 {
@@ -52,27 +54,23 @@ namespace Visual
  * | transform               | MAP              |
  *
  * where \b customShader is a map with at least one of the following properties:
- * | %Property Name          | Type             | Required | Default | Description |
- * |-------------------------|------------------|----------|---------|-------------|
- * | vertexShader            | STRING           | No | "" | Vertex shader code|
- * | fragmentShader          | STRING           | No | "" | Fragment shader code|
- * | subdivideGridX          | INTEGER          | No | 1 | How to subdivide the grid along X |
- * | subdivideGridY          | INTEGER          | No | 1 | How to subdivide the grid along Y |
- * | shaderHints             | INTEGER or ARRAY of STRING | No | NONE | Bitmask of hints @sa Dali::Shader::Hint |
+ * | %Property Name          | Type                       | Required | Default | Description                             |
+ * |-------------------------|----------------------------|----------|---------|-----------------------------------------|
+ * | vertexShader            | STRING                     | No       | ""      | Vertex shader code                      |
+ * | fragmentShader          | STRING                     | No       | ""      | Fragment shader code                    |
+ * | subdivideGridX          | INTEGER                    | No       | 1       | How to subdivide the grid along X       |
+ * | subdivideGridY          | INTEGER                    | No       | 1       | How to subdivide the grid along Y       |
+ * | shaderHints             | INTEGER or ARRAY of STRING | No       | NONE    | Bitmask of hints @sa Dali::Shader::Hint |
  *
  * and \b transform is a map with the following properties:
- * | %Property Name          | Type             | Required | Default |Description |
- * |-------------------------|------------------|----------|---------|------------|
- * | offset                  | VECTOR2          | No | (0,0) | Offset of visual from origin |
- * | size                    | VECTOR2          | No | (1,1) | size of visual |
- * | origin                  | INTEGER or STRING | No | CENTER | origin of the visual @sa Dali::Toolkit::Align |
- * | anchorPoint             | INTEGER or STRING | No | CENTER | anchor point of the visual @sa Dali::Toolkit::Align |
- * | offsetSizeMode          | VECTOR4          | No | (0,0,0,0) | See below |
- *
- *
- * offsetSizeMode describes whether the offset and the size are
- * relative or absolute by using 0 or 1 respectively in the corresponding
- * components (offsetSizeMode.xy for offset.xy; offsetSizeMode.zw for size.xy).
+ * | %Property Name          | Type              | Required | Default                | Description                                         |
+ * |-------------------------|-------------------|----------|------------------------|-----------------------------------------------------|
+ * | offset                  | VECTOR2           | No       | (0,0)                  | Offset of visual from origin                        |
+ * | size                    | VECTOR2           | No       | (1,1)                  | size of visual                                      |
+ * | origin                  | INTEGER or STRING | No       | CENTER                 | origin of the visual @sa Dali::Toolkit::Align       |
+ * | anchorPoint             | INTEGER or STRING | No       | CENTER                 | anchor point of the visual @sa Dali::Toolkit::Align |
+ * | offsetPolicy            | VECTOR2           | No       | ( RELATIVE, RELATIVE ) | @sa Dali::Toolkit::Visual::Transform::Policy   |
+ * | sizePolicy              | VECTOR2           | No       | ( RELATIVE, RELATIVE ) | @sa Dali::Toolkit::Visual::Transform::Policy   |
  *
  * Relative means that the component describes a factor of the parent control size;
  * size.x = 1 means full width; size.y = 0.5 means half height.
@@ -80,10 +78,9 @@ namespace Visual
  * Absolute means that the component describes world units (equivalent to pixels)
  *
  */
-class DALI_IMPORT_API Base : public BaseHandle
+class DALI_TOOLKIT_API Base : public BaseHandle
 {
 public:
-
   /**
    * @brief Create an empty Visual Handle
    */
@@ -101,7 +98,7 @@ public:
    *
    * @param[in] handle A reference to the copied handle.
    */
-  Base( const Base& handle );
+  Base(const Base& handle);
 
   /**
    * @brief This assignment operator is required for (smart) pointer semantics.
@@ -109,7 +106,7 @@ public:
    * @param [in] handle  A reference to the copied handle.
    * @return A reference to this.
    */
-  Base& operator=( const Base& handle );
+  Base& operator=(const Base& handle);
 
   /**
    * @brief Set the name of the visual
@@ -117,7 +114,7 @@ public:
    * Used by the styling system to animate properties
    * @param[in] name The name to give the visual
    */
-  void SetName( const std::string& name );
+  void SetName(const std::string& name);
 
   /**
    * @brief Get the name of the visual
@@ -125,7 +122,7 @@ public:
    * Used by the styling system to animate properties
    * @return The name of the visual
    */
-  const std::string& GetName();
+  const std::string& GetName() const;
 
   /**
    * @brief Sets the transform and the control size
@@ -133,7 +130,7 @@ public:
    * @param[in] transform A property map describing the transform
    * @param[in] controlSize The size of the parent control for visuals that need to scale internally.
    */
-  void SetTransformAndSize( const Dali::Property::Map& transform, Size controlSize );
+  void SetTransformAndSize(const Dali::Property::Map& transform, Size controlSize);
 
   /**
    * @brief Returns the height for a given width.
@@ -142,7 +139,16 @@ public:
    *
    * @return The height based on the width.
    */
-  float GetHeightForWidth( float width ) const;
+  float GetHeightForWidth(float width);
+
+  /**
+   * @brief Returns the width for a given height.
+   *
+   * @param[in] height Height to use.
+   *
+   * @return The width based on the height.
+   */
+  float GetWidthForHeight(float height);
 
   /**
    * @brief Return the natural size of the visual.
@@ -155,7 +161,7 @@ public:
    *
    * @param[out] naturalSize The visual's natural size
    */
-  void GetNaturalSize( Vector2& naturalSize );
+  void GetNaturalSize(Vector2& naturalSize);
 
   /**
    * @brief Set the depth index of this visual.
@@ -165,43 +171,31 @@ public:
    *
    * @param[in] index The depth index of this visual.
    */
-  void SetDepthIndex( float index );
+  void SetDepthIndex(int index);
 
   /**
    * @brief Get the depth index of this visual
    *
    * @return The depth index of this visual.
    */
-  float GetDepthIndex() const;
+  int GetDepthIndex() const;
 
   /**
    * @brief Create the property map representing this visual.
    *
    * @param[out] map The visual property map.
    */
-  void CreatePropertyMap( Dali::Property::Map& map ) const;
-
-  /**
-   * @brief Sets the value of an existing property.
-   *
-   * @param [in] index The index of the property.
-   * @param [in] propertyValue The new value of the property.
-   */
-  void SetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue );
+  void CreatePropertyMap(Dali::Property::Map& map) const;
 
   /**
-   * @brief Retrieves a property value.
-   *
-   * @param [in] index The index of the property.
+   * @brief Get the type of this visual.
    *
-   * @return The property value.
+   * @return The the type of this visual.
    */
-  Dali::Property::Value GetProperty( Dali::Property::Index index );
+  Visual::Type GetType() const;
 
 public: // Not intended for application developers
-
-  explicit DALI_INTERNAL Base(Internal::Visual::Base *impl);
-
+  explicit DALI_INTERNAL Base(Internal::Visual::Base* impl);
 };
 
 } // namespace Visual