X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fpush-button-impl.h;h=7a2347485a2f9939fd06d8c8275643fdfdccf937;hb=030e7c680a6eb0e8d87bfdb8ec359a0267ef7db2;hp=89bce4b896f36ad2cb09c35f5410f784ac08420a;hpb=cc82bd9b187cda8fe2c8336b73fd1fa9376cfebd;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 89bce4b..7a23474 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.h @@ -62,69 +62,72 @@ protected: */ virtual ~PushButton(); -public: // From Button +private: // From Button /** - * @copydoc Toolkit::Internal::Button::SetButtonImage( Actor image ) + * @copydoc Toolkit::Internal::Button::OnButtonInitialize() */ - virtual void SetButtonImage( Actor image ); + virtual void OnButtonInitialize(); /** - * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image ) + * @copydoc Toolkit::Internal::Button::OnLabelSet() */ - virtual void SetSelectedImage( Actor image ); + virtual void OnLabelSet(); /** - * @copydoc Toolkit::Internal::Button::SetBackgroundImage( Actor image ) + * @copydoc Toolkit::Internal::Button::OnButtonImageSet() */ - virtual void SetBackgroundImage( Actor image ); + virtual void OnButtonImageSet(); /** - * @copydoc Toolkit::Internal::Button::SetDisabledImage( Actor image ) + * @copydoc Toolkit::Internal::Button::OnSelectedImageSet() */ - virtual void SetDisabledImage( Actor image ); + virtual void OnSelectedImageSet(); /** - * @copydoc Toolkit::Internal::Button::SetDisabledBackgroundImage( Actor image ) + * @copydoc Toolkit::Internal::Button::OnBackgroundImage() */ - virtual void SetDisabledBackgroundImage( Actor image ); + virtual void OnBackgroundImageSet(); -private: // From Button + /** + * @copydoc Toolkit::Internal::Button::OnSelectedBackgroundImageSet() + */ + virtual void OnSelectedBackgroundImageSet(); /** - * @copydoc Toolkit::Internal::Button::OnButtonInitialize() + * @copydoc Toolkit::Internal::Button::OnDisabledImageSet() */ - virtual void OnButtonInitialize(); + virtual void OnDisabledImageSet(); /** - * @copydoc Toolkit::Internal::Button::OnLabelSet() + * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet() */ - virtual void OnLabelSet(); + virtual void OnDisabledBackgroundImageSet(); /** * @copydoc Toolkit::Internal::Button::OnSelected() */ - virtual void OnSelected( bool selected ); + virtual bool OnSelected(); /** - * @copydoc Toolkit::Internal::Button::OnDisabled( bool disabled ) + * @copydoc Toolkit::Internal::Button::OnDisabled() */ - virtual void OnDisabled( bool disabled ); + virtual bool OnDisabled(); /** * @copydoc Toolkit::Internal::Button::OnPressed() */ - virtual void OnPressed(); + virtual bool OnPressed(); /** * @copydoc Toolkit::Internal::Button::OnReleased() */ - virtual void OnReleased(); + virtual bool OnReleased(); /** - * @copydoc Toolkit::Internal::Button::OnClicked() + * @copydoc Toolkit::Internal::Button::StopAllAnimations() */ - virtual void OnClicked(); + virtual void StopAllAnimations(); private: // From Control @@ -134,96 +137,66 @@ private: // From Control virtual void OnControlSizeSet( const Vector3& targetSize ); /** - * @copydoc Toolkit::Control::GetNaturalSize() - */ - virtual Vector3 GetNaturalSize(); - -private: - - /** - * Used in the FadeOut functions. - */ - enum ImageLayer - { - Background, ///< Fade out the background. - Foreground ///< Fade out the foreground. - }; - - /** - * Gets the button image that is fading out. - * @return A reference to the button image that is fading out. + * @copydoc Toolkit::Control::GetNaturalSize */ - Actor& GetFadeOutButtonImage(); + Vector3 GetNaturalSize(); /** - * Gets the background image that is fading out. - * @return A reference to the background image that is fading out. + * @copydoc Toolkit::Control::OnSetResizePolicy */ - Actor& GetFadeOutBackgroundImage(); + virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ); - /** - * Adds the actor to the fade in animation. It creates a fade in animation if needed. - * @param[in] actor The actor. - */ - void AddToFadeInAnimation( const Actor& actor ); - - /** - * Starts the fade in animation. - * PushButton::FadeInAnimationFinished slot is called when the animation finishes. - */ - void StartFadeInAnimation(); - - /** - * Stops the fade in animation. - */ - void StopFadeInAnimation(); - - /** - * Adds the actor to the fade out animation. It creates a fade out animation if needed. - */ - void AddToFadeOutAnimation( const Actor& actor ); +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, int priority = -1 ); + 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 ActorContainer& 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: @@ -235,15 +208,8 @@ 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