X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fpush-button-impl.h;h=7a2347485a2f9939fd06d8c8275643fdfdccf937;hb=620ac79821b89142af1926f3577c7fa003f16ad3;hp=730b7466f1ee66f483f8a791ca9c9addf18cc358;hpb=87f440c3d0367ca5a7027eef8d01d79b8703cf05;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.h b/dali-toolkit/internal/controls/buttons/push-button-impl.h index 730b746..7a23474 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -49,29 +50,153 @@ 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 Vector3 GetNaturalSize(); + virtual void OnButtonImageSet(); /** - * Construct a new PushButton. + * @copydoc Toolkit::Internal::Button::OnSelectedImageSet() */ - PushButton(); + virtual void OnSelectedImageSet(); /** - * A reference counted object may only be deleted by calling Unreference() + * @copydoc Toolkit::Internal::Button::OnBackgroundImage() */ - virtual ~PushButton(); + 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 + */ + Vector3 GetNaturalSize(); + + /** + * @copydoc Toolkit::Control::OnSetResizePolicy + */ + virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ); + +private: + + /** + * Starts the transition animation. + * PushButton::TransitionAnimationFinished slot is called when the animation finishes. + */ + void StartTransitionAnimation(); + + /** + * Stops the transition animation. + * @param[in] remove If true, removes the fadeout actor from root. + */ + 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 ) ); + + /** + * @brief Custom configuration for size negotiation + */ + void ConfigureSizeNegotiation(); + + /** + * @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 ConfigureSizeNegotiationDimension( Dimension::Type dimension, const ActorContainer& images, Actor& label ); + + // slots + + /** + * Called when the transition animation finishes. + */ + void TransitionAnimationFinished( Dali::Animation& source ); private: @@ -80,6 +205,11 @@ private: // Undefined PushButton& operator=( const PushButton& ); + +private: + + Animation mTransitionAnimation; ///< Animation used in the state transitions. + Vector3 mSize; ///< The button's size. }; } // namespace Internal