Fix compile errors after removing boost function include from dali-core
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / push-button-impl.h
index 730b746..3eddddc 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
@@ -49,29 +50,134 @@ public:
    */
   static Dali::Toolkit::PushButton New();
 
-protected: // From Button
+protected:
 
   /**
-   * Sets the Leave signal.
+   * Construct a new PushButton.
+   */
+  PushButton();
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~PushButton();
+
+private: // From Button
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
    */
   virtual void OnButtonInitialize();
 
-protected: // From Control
+  /**
+   * @copydoc Toolkit::Internal::Button::OnLabelSet()
+   */
+  virtual void OnLabelSet();
 
   /**
-   * @copydoc Control::GetNaturalSize()
+   * @copydoc Toolkit::Internal::Button::OnButtonImageSet()
+   */
+  virtual void OnButtonImageSet();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnSelectedImageSet()
+   */
+  virtual void OnSelectedImageSet();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnBackgroundImage()
+   */
+  virtual void OnBackgroundImageSet();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnSelectedBackgroundImageSet()
+   */
+  virtual void OnSelectedBackgroundImageSet();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnDisabledImageSet()
+   */
+  virtual void OnDisabledImageSet();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet()
+   */
+  virtual void OnDisabledBackgroundImageSet();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnSelected()
+   */
+  virtual bool OnSelected();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnDisabled()
+   */
+  virtual bool OnDisabled();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnPressed()
+   */
+  virtual bool OnPressed();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnReleased()
+   */
+  virtual bool OnReleased();
+
+  /**
+   * @copydoc Toolkit::Internal::Button::StopAllAnimations()
+   */
+  virtual void StopAllAnimations();
+
+private: // From Control
+
+  /**
+   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   */
+  virtual void OnControlSizeSet( const Vector3& targetSize );
+
+  /**
+   * @copydoc Toolkit::Control::GetNaturalSize()
    */
   virtual Vector3 GetNaturalSize();
 
+private:
+
   /**
-   * Construct a new PushButton.
+   * Starts the transition animation.
+   * PushButton::TransitionAnimationFinished slot is called when the animation finishes.
    */
-  PushButton();
+  void StartTransitionAnimation();
 
   /**
-   * A reference counted object may only be deleted by calling Unreference()
+   * Stops the transition animation.
+   * @param[in] remove If true, removes the fadeout actor from root.
    */
-  virtual ~PushButton();
+  void StopTransitionAnimation( bool remove = true );
+
+  /**
+   * It adds the actor to the root actor and to the fade in animation.
+   * @param[inout] image The actor.
+   * @param[in] opacity The initial opacity.
+   * @param[in] scale The initial scale.
+   */
+  void FadeInImage( Actor& image, float opacity = 0.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
+
+  /**
+   * It adds the actor fade out animation and stores it to be removed when the animation finishes.
+   * @param[in] layer Defines if the actor is going to be stored in the mFadeOutBackgroundImage or mFadeOutCheckedImage member.
+   * @param[inout] image The actor.
+   * @param[in] opacity The initial opacity.
+   * @param[in] scale The initial scale.
+   */
+  void FadeOutImage( Actor& image, float opacity = 1.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
+
+  // slots
+
+  /**
+   * Called when the transition animation finishes.
+   */
+  void TransitionAnimationFinished( Dali::Animation& source );
 
 private:
 
@@ -80,6 +186,11 @@ private:
 
   // Undefined
   PushButton& operator=( const PushButton& );
+
+private:
+
+  Animation             mTransitionAnimation;       ///< Animation used in the state transitions.
+  Vector3               mSize;                      ///< The button's size.
 };
 
 } // namespace Internal