X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fpush-button-impl.h;h=51164b56e5a92be2ca66679425c73a9bdf9417a4;hp=2784bab0b245fbd68fc5796f769b687039071d9a;hb=efc136204e9a4460a7a2421e673c873e23974a80;hpb=928136dbb9e23970f3894eabc7c8b224003b77be diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.h b/dali-toolkit/internal/controls/buttons/push-button-impl.h index 2784bab..51164b5 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.h @@ -19,8 +19,7 @@ */ // EXTERNAL INCLUDES -#include -#include +#include // INTERNAL INCLUDES #include @@ -62,33 +61,6 @@ protected: */ 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 /** @@ -102,128 +74,99 @@ 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::OnDisabledSelectedImageSet() */ - virtual void OnControlSizeSet( const Vector3& targetSize ); + virtual void OnDisabledSelectedImageSet(); /** - * @copydoc Toolkit::Control::GetNaturalSize() + * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet() */ - virtual Vector3 GetNaturalSize(); - -private: + virtual void OnDisabledBackgroundImageSet(); /** - * Used in the FadeOut functions. + * @copydoc Toolkit::Internal::Button::PrepareForTranstionIn( Actor actor ) */ - enum ImageLayer - { - Background, ///< Fade out the background. - Foreground ///< Fade out the foreground. - }; + virtual void PrepareForTranstionIn( Actor actor ); /** - * Gets the button image that is fading out. - * @return A reference to the button image that is fading out. + * @copydoc Toolkit::Internal::Button::PrepareForTranstionOut( Actor actor ) */ - Actor& GetFadeOutButtonImage(); + virtual void PrepareForTranstionOut( Actor actor ); /** - * Gets the background image that is fading out. - * @return A reference to the background image that is fading out. + * @copydoc Toolkit::Internal::Button::OnTransitionIn( Actor actor ) */ - Actor& GetFadeOutBackgroundImage(); + virtual void OnTransitionIn( Actor actor ); /** - * 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::OnTransitionOut( Actor actor ) */ - void AddToFadeInAnimation( const Actor& actor ); + virtual void OnTransitionOut( Actor actor ); - /** - * Starts the fade in animation. - * PushButton::FadeInAnimationFinished slot is called when the animation finishes. - */ - void StartFadeInAnimation(); +private: // From Control /** - * Stops the fade in animation. + * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize ) */ - void StopFadeInAnimation(); + virtual void OnSizeSet( const Vector3& targetSize ); /** - * Adds the actor to the fade out animation. It creates a fade out animation if needed. + * @copydoc Toolkit::Control::GetNaturalSize */ - void AddToFadeOutAnimation( const Actor& actor ); + virtual Vector3 GetNaturalSize(); /** - * Starts the fade out animation. - * PushButton::FadeOutAnimationFinished slot is called when the animation finishes. + * @copydoc Toolkit::Control::OnSetResizePolicy */ - void StartFadeOutAnimation(); + virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ); - /** - * Stops the fade out animation. - * It removes the actor stored in PushButton::mFadeOutBackgroundImage and PushButton::mFadeOutCheckedImage. - * @param[in] remove If true, removes the fadeout actor from root. - */ - void StopFadeOutAnimation( bool remove = true ); +private: /** * 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. - */ - void FadeInImage( Actor& image, float opacity = 0.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[inout] actor The actor. + * @param[in] opacity The opacity to fade to */ - void FadeOutImage( ImageLayer layer, Actor& image, float opacity = 1.f ); - - // slots + void FadeImageTo( Actor actor, float opacity ); /** - * Called when the fade out animation finishes. - * It changes the check button paint state and removes actors from the root. + * @brief Custom configuration for size negotiation */ - void FadeOutAnimationFinished( Dali::Animation& source ); + void ConfigureSizeNegotiation(); /** - * Called when the fade in animation finishes. - * It changes the check button paint state. + * @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 FadeInAnimationFinished( Dali::Animation& source ); + void ConfigureSizeNegotiationDimension( Dimension::Type dimension, const std::vector< Actor >& images, Actor& label ); private: @@ -235,15 +178,7 @@ 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. - Vector3 mSize; ///< The button's size. - - PaintState mPaintState; ///< The paint state. }; } // namespace Internal