On state change, visuals now keep instance data
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / border / border-visual.h
index 8a44250..473080b 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/common/intrusive-ptr.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
@@ -33,6 +34,9 @@ namespace Toolkit
 namespace Internal
 {
 
+class BorderVisual;
+typedef IntrusivePtr< BorderVisual > BorderVisualPtr;
+
 /**
  * The visual which renders a solid color to the control's quad border fixed to a specified size.
  *
@@ -44,12 +48,22 @@ namespace Internal
  * | borderSize      | FLOAT       |
  * | antiAliasing    | BOOLEAN     |
  */
-
 class BorderVisual : public Visual::Base
 {
 public:
 
   /**
+   * @brief Create a new border visual.
+   *
+   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] properties A Property::Map containing settings for this visual
+   * @return A smart-pointer to the newly allocated visual.
+   */
+  static BorderVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
+
+protected:
+
+  /**
    * @brief Constructor.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
@@ -61,12 +75,10 @@ public:
    */
   virtual ~BorderVisual();
 
-protected:
-
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::Base::DoSetProperties
    */
-  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+  virtual void DoSetProperties( const Property::Map& propertyMap );
 
   /**
    * @copydoc Visual::Base::DoSetOnStage
@@ -78,6 +90,16 @@ protected:
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  virtual void OnSetTransform();
+
 public:
 
   /**
@@ -117,6 +139,13 @@ private:
    */
   Geometry CreateBorderGeometry();
 
+  /**
+   * Helper method to set individual values by index key.
+   * @param[in] index The index key of the value
+   * @param[in] value The value
+   */
+  void DoSetProperty( Property::Index index, const Property::Value& value );
+
   // Undefined
   BorderVisual( const BorderVisual& borderRenderer );