Cleaning up property public API and usage of typedefs
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / buttons / button-impl.h
index a1be790..166f315 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include <dali-toolkit/public-api/controls/buttons/button.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include "button-painter-impl.h"
@@ -38,14 +37,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 +129,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 +143,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 +183,7 @@ protected: // From CustomActorImpl
    */
   virtual bool OnTouchEvent( const TouchEvent& event );
 
-private: // From ControlImpl
+private: // From Control
 
   /**
    * @copydoc Toolkit::Control::OnInitialize()
@@ -185,6 +195,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:
 
   /**
@@ -195,15 +211,7 @@ private:
    * @param[in]  actor  The tapped actor.
    * @param[in]  tap    The tap gesture.
    */
-  void OnTap(Actor actor, TapGesture tap);
-
-private:
-
-  /**
-   * Callback received when the button is disconected from the stage.
-   * It resets the button status.
-   */
-  void OnStageDisconnection();
+  void OnTap(Actor actor, const TapGesture& tap);
 
 private:
 
@@ -228,6 +236,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;
 };