Merge "Make radio buttons work with size negotiation, bug fixes." into tizen
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / buttons / button-impl.h
index a1be790..2c45d7f 100644 (file)
@@ -38,14 +38,14 @@ namespace Internal
 /**
  * Button is the base class implementation for all buttons.
  */
-class Button : public ControlImpl
+class Button : public Control
 {
 public:
 
   // Properties
   enum
   {
-    BUTTON_PROPERTY_START_INDEX = ControlImpl::CONTROL_PROPERTY_END_INDEX + 1,
+    BUTTON_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
     BUTTON_PROPERTY_END_INDEX = BUTTON_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
   };
 
@@ -130,6 +130,12 @@ private:
    */
   virtual float OnAnimationTimeRequested() const;
 
+  /**
+   * This method is called when the button is removed from the stage.
+   * Could be reimplemented in subclasses to provide specific behaviour.
+   */
+  virtual void OnButtonStageDisconnection() { }
+
 public:
 
   /**
@@ -138,6 +144,11 @@ public:
   Toolkit::Button::ClickedSignalV2& ClickedSignal();
 
   /**
+   * @copydoc Dali::Toolkit::Button::ToggledSignal()
+   */
+  Toolkit::Button::ToggledSignalV2& ToggledSignal();
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -173,7 +184,7 @@ protected: // From CustomActorImpl
    */
   virtual bool OnTouchEvent( const TouchEvent& event );
 
-private: // From ControlImpl
+private: // From Control
 
   /**
    * @copydoc Toolkit::Control::OnInitialize()
@@ -185,6 +196,12 @@ private: // From ControlImpl
    */
   virtual void OnControlSizeSet( const Vector3& targetSize );
 
+  /**
+   * Callback received when the button is disconnected from the stage.
+   * It resets the button status.
+   */
+  void OnControlStageDisconnection();
+
 private:
 
   /**
@@ -199,14 +216,6 @@ private:
 
 private:
 
-  /**
-   * Callback received when the button is disconected from the stage.
-   * It resets the button status.
-   */
-  void OnStageDisconnection();
-
-private:
-
   // Undefined
   Button( const Button& );
 
@@ -228,6 +237,7 @@ protected: // Signals
   ButtonPainterPtr mPainter;              ///< Pointer to a ButtonPainter base class.
 
   Toolkit::Button::ClickedSignalV2 mClickedSignalV2; ///< Signal emitted when the button is clicked.
+  Toolkit::Button::ToggledSignalV2 mToggledSignalV2; ///< Signal emitted when the button is toggled.
 
   TapGestureDetector mTapDetector;
 };