*/
// EXTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/animation/animation.h>
// INTERNAL INCLUDES
*/
virtual ~PushButton();
-public: // From Button
-
- /**
- * @copydoc Toolkit::Internal::Button::SetButtonImage( Actor image )
- */
- virtual void SetButtonImage( Actor image );
-
- /**
- * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
- */
- virtual void SetSelectedImage( Actor image );
-
- /**
- * @copydoc Toolkit::Internal::Button::SetBackgroundImage( Actor image )
- */
- virtual void SetBackgroundImage( Actor image );
-
- /**
- * @copydoc Toolkit::Internal::Button::SetDisabledImage( Actor image )
- */
- virtual void SetDisabledImage( Actor image );
-
- /**
- * @copydoc Toolkit::Internal::Button::SetDisabledBackgroundImage( Actor image )
- */
- virtual void SetDisabledBackgroundImage( Actor image );
-
private: // From Button
/**
virtual void OnLabelSet();
/**
- * @copydoc Toolkit::Internal::Button::OnSelected()
+ * @copydoc Toolkit::Internal::Button::OnButtonImageSet()
*/
- virtual void OnSelected( bool selected );
+ virtual void OnButtonImageSet();
/**
- * @copydoc Toolkit::Internal::Button::OnDisabled( bool disabled )
+ * @copydoc Toolkit::Internal::Button::OnSelectedImageSet()
*/
- virtual void OnDisabled( bool disabled );
+ virtual void OnSelectedImageSet();
/**
- * @copydoc Toolkit::Internal::Button::OnPressed()
+ * @copydoc Toolkit::Internal::Button::OnBackgroundImage()
*/
- virtual void OnPressed();
+ virtual void OnBackgroundImageSet();
/**
- * @copydoc Toolkit::Internal::Button::OnReleased()
+ * @copydoc Toolkit::Internal::Button::OnSelectedBackgroundImageSet()
*/
- virtual void OnReleased();
+ virtual void OnSelectedBackgroundImageSet();
/**
- * @copydoc Toolkit::Internal::Button::OnClicked()
+ * @copydoc Toolkit::Internal::Button::OnDisabledImageSet()
*/
- virtual void OnClicked();
-
-private: // From Control
+ virtual void OnDisabledImageSet();
/**
- * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+ * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet()
*/
- virtual void OnControlSizeSet( const Vector3& targetSize );
+ virtual void OnDisabledBackgroundImageSet();
/**
- * @copydoc Toolkit::Control::GetNaturalSize()
+ * @copydoc Toolkit::Internal::Button::OnSelected()
*/
- virtual Vector3 GetNaturalSize();
-
-private:
+ virtual bool OnSelected();
/**
- * Used in the FadeOut functions.
+ * @copydoc Toolkit::Internal::Button::OnDisabled()
*/
- enum ImageLayer
- {
- Background, ///< Fade out the background.
- Foreground ///< Fade out the foreground.
- };
+ virtual bool OnDisabled();
/**
- * Gets the button image that is fading out.
- * @return A reference to the button image that is fading out.
+ * @copydoc Toolkit::Internal::Button::OnPressed()
*/
- Actor& GetFadeOutButtonImage();
+ virtual bool OnPressed();
/**
- * Gets the background image that is fading out.
- * @return A reference to the background image that is fading out.
+ * @copydoc Toolkit::Internal::Button::OnReleased()
*/
- Actor& GetFadeOutBackgroundImage();
+ virtual bool OnReleased();
/**
- * Adds the actor to the fade in animation. It creates a fade in animation if needed.
- * @param[in] actor The actor.
+ * @copydoc Toolkit::Internal::Button::StopAllAnimations()
*/
- void AddToFadeInAnimation( const Actor& actor );
+ virtual void StopAllAnimations();
+
+private: // From Control
/**
- * Starts the fade in animation.
- * PushButton::FadeInAnimationFinished slot is called when the animation finishes.
+ * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
*/
- void StartFadeInAnimation();
+ virtual void OnSizeSet( const Vector3& targetSize );
/**
- * Stops the fade in animation.
+ * @copydoc Toolkit::Control::GetNaturalSize
*/
- void StopFadeInAnimation();
+ virtual Vector3 GetNaturalSize();
/**
- * Adds the actor to the fade out animation. It creates a fade out animation if needed.
+ * @copydoc Toolkit::Control::OnSetResizePolicy
*/
- void AddToFadeOutAnimation( const Actor& actor );
+ virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
+
+private:
/**
- * Starts the fade out animation.
- * PushButton::FadeOutAnimationFinished slot is called when the animation finishes.
+ * Starts the transition animation.
+ * PushButton::TransitionAnimationFinished slot is called when the animation finishes.
*/
- void StartFadeOutAnimation();
+ void StartTransitionAnimation();
/**
- * Stops the fade out animation.
- * It removes the actor stored in PushButton::mFadeOutBackgroundImage and PushButton::mFadeOutCheckedImage.
+ * Stops the transition animation.
* @param[in] remove If true, removes the fadeout actor from root.
*/
- void StopFadeOutAnimation( bool remove = true );
+ 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 );
+ 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( ImageLayer layer, Actor& image, float opacity = 1.f );
+ void FadeOutImage( Actor& image, float opacity = 1.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
- // slots
+ /**
+ * @brief Custom configuration for size negotiation
+ */
+ void ConfigureSizeNegotiation();
/**
- * Called when the fade out animation finishes.
- * It changes the check button paint state and removes actors from the root.
+ * @brief Configure size negotiation for a given dimension
+ *
+ * @param[in] dimension The dimension to configure
+ * @param[in] images The list of images to configure
+ * @param[in] label The text label to configure
*/
- void FadeOutAnimationFinished( Dali::Animation& source );
+ void ConfigureSizeNegotiationDimension( Dimension::Type dimension, const std::vector< Actor >& images, Actor& label );
+
+ // slots
/**
- * Called when the fade in animation finishes.
- * It changes the check button paint state.
+ * Called when the transition animation finishes.
*/
- void FadeInAnimationFinished( Dali::Animation& source );
+ void TransitionAnimationFinished( Dali::Animation& source );
private:
private:
- Animation mFadeInAnimation; ///< Animation used in the state transitions.
- Animation mFadeOutAnimation; ///< Animation used in the state transitions.
-
- Actor mFadeOutButtonContent; ///< Stores a foreground content, which is in a fade out animation, to be removed when the animation finishes.
- Actor mFadeOutBackgroundContent; ///< Stores a background content, which is in a fade out animation, to be removed when the animation finishes.
-
+ Animation mTransitionAnimation; ///< Animation used in the state transitions.
Vector3 mSize; ///< The button's size.
-
- PaintState mPaintState; ///< The paint state.
};
} // namespace Internal