Button to use Color Renderer when setting (un)selected color
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / button-impl.h
index 71a42fe..da2557f 100644 (file)
@@ -43,18 +43,6 @@ namespace Internal
 class Button : public Control
 {
 
-protected:
-
-  /**
-   * Construct a new Button.
-   */
-  Button();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~Button();
-
 public:
 
   /**
@@ -285,6 +273,42 @@ public: // Deprecated API
 
 protected:
 
+  enum ButtonState
+  {
+    ButtonUp,                                  ///< The button is up.
+    ButtonDown,                                ///< The button is down.
+  };
+
+  /**
+   * Button paint states.
+   */
+  enum PaintState
+  {
+    UnselectedState,              ///< The button is unselected.
+    SelectedState,                ///< The button is selected.
+    DisabledUnselectedState,      ///< The button is disabled and unselected.
+    DisabledSelectedState,        ///< The button is disabled and selected.
+  };
+
+  /**
+   * Enum to specify which decoration when getting and setting decorations.
+   */
+  enum DecorationState
+  {
+    UNSELECTED_DECORATION = 0,
+    SELECTED_DECORATION,
+    DECORATION_STATES
+  };
+
+  /**
+   * Construct a new Button.
+   */
+  Button();
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~Button();
   /**
    * @return A reference to the label actor.
    */
@@ -494,6 +518,7 @@ protected: // From Control
    */
   void OnStageDisconnection();
 
+
 private:
 
   /**
@@ -551,24 +576,18 @@ private:
   void SetupContent( Actor& actorToModify, Actor newActor );
 
   /**
-   * Sets the color of the unselected image.
-   * If no image exists, it is created.
-   * @param[in]  color The color to use.
-   */
-  void SetUnselectedColor( const Vector4& color );
-
-  /**
    * Gets the unselected content color.
    * @return     The currently used unselected color.
    */
   const Vector4 GetUnselectedColor() const;
 
   /**
-   * Sets the color of the selected image.
-   * If no image exists, it is created.
+   * Sets the color of button in selected or unselected state, if image also supplied this color will be appplied to it.
+   * If no visual exists, it is created.
    * @param[in]  color The color to use.
+   * @param[in]  selectedState The state to apply the color to, SelectedState or DisabledUnselectedState.
    */
-  void SetSelectedColor( const Vector4& color );
+  void SetColor( const Vector4& color, PaintState selectedState );
 
   /**
    * Gets the selected content color.
@@ -578,33 +597,6 @@ private:
 
 protected:
 
-  enum ButtonState
-  {
-    ButtonUp,                                  ///< The button is up.
-    ButtonDown,                                ///< The button is down.
-  };
-
-  /**
-   * Button paint states.
-   */
-  enum PaintState
-  {
-    UnselectedState,              ///< The button is unselected.
-    SelectedState,                ///< The button is selected.
-    DisabledUnselectedState,      ///< The button is disabled and unselected.
-    DisabledSelectedState,        ///< The button is disabled and selected.
-  };
-
-  /**
-   * Enum to specify which decoration when getting and setting decorations.
-   */
-  enum DecorationState
-  {
-    UNSELECTED_DECORATION = 0,
-    SELECTED_DECORATION,
-    DECORATION_STATES
-  };
-
   ButtonState GetState();
   PaintState GetPaintState();
   void SetDecoration( DecorationState state, Actor actor );