X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fcheck-box-button-impl.h;h=0135e6b5b349b00d26ee6ac0b7aa3d68742c0064;hb=31df2b9472ccbe0ae460a958535be8ef790c96f2;hp=cb5e08c8cba1aec920c027114dc730b62b76f566;hpb=2ddfbb9e23a7c3fc30e604236c41e0ef6d2ed6a2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/buttons/check-box-button-impl.h b/dali-toolkit/internal/controls/buttons/check-box-button-impl.h index cb5e08c..0135e6b 100644 --- a/dali-toolkit/internal/controls/buttons/check-box-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/check-box-button-impl.h @@ -18,10 +18,15 @@ * */ -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include +#include +#include + +// INTERNAL INCLUDES #include +#include #include "button-impl.h" @@ -49,173 +54,67 @@ public: */ static Dali::Toolkit::CheckBoxButton New(); - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetChecked( bool checked ) - */ - void SetChecked( bool checked ); - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::IsChecked() - */ - bool IsChecked() const; - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetBackgroundImage( Image image ) - */ - void SetBackgroundImage( Image image ); - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetBackgroundImage( Actor image ) - */ - void SetBackgroundImage( Actor image ); - - /** - * Used by the painter only. - * @return A reference to the background image. - */ - Actor& GetBackgroundImage(); - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::GetBackgroundImage() - */ - Actor GetBackgroundImage() const; - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetCheckedImage( Image image ) - */ - void SetCheckedImage( Image image ); - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetCheckedImage( Actor image ) - */ - void SetCheckedImage( Actor image ); - - /** - * Used by the painter only. - * @return A reference to the checked image. - */ - Actor& GetCheckedImage(); - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::GetCheckedImage() - */ - Actor GetCheckedImage() const; - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledBackgroundImage( Image image ) - */ - void SetDisabledBackgroundImage( Image image ); - - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledBackgroundImage( Actor image ) - */ - void SetDisabledBackgroundImage( Actor image ); +private: /** - * Used by the painter only. - * @return A reference to the disabled background image. + * Construct a new CheckBoxButton. */ - Actor& GetDisabledBackgroundImage(); + CheckBoxButton(); /** - * @copydoc Dali::Toolkit::CheckBoxButton::GetDisabledBackgroundImage() + * A reference counted object may only be deleted by calling Unreference() */ - Actor GetDisabledBackgroundImage() const; + virtual ~CheckBoxButton(); - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledCheckedImage( Image image ) - */ - void SetDisabledCheckedImage( Image image ); +private: // From Button - /** - * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledCheckedImage( Actor image ) - */ - void SetDisabledCheckedImage( Actor image ); /** - * Used by the painter only. - * @return A reference to the disabled checked image. + * @copydoc Toolkit::Internal::Button::OnButtonInitialize() */ - Actor& GetDisabledCheckedImage(); + virtual void OnButtonInitialize(); /** - * @copydoc Dali::Toolkit::CheckBoxButton::GetDisabledCheckedImage() + * @copydoc Toolkit::Internal::Button::OnLabelSet() */ - Actor GetDisabledCheckedImage() const; + virtual void OnLabelSet(); /** - * Used by the painter only. - * @return A reference to the background image that is fading out. + * @copydoc Toolkit::Internal::Button::OnSelected() */ - Actor& GetFadeOutBackgroundImage(); + virtual bool OnSelected(); /** - * Used by the painter only. - * @return A reference to the checked image that is fading out. + * @copydoc Toolkit::Internal::Button::OnDisabled() */ - Actor& GetFadeOutCheckedImage(); - -protected: // From Control + virtual bool OnDisabled(); /** - * Respond the activate notification. + * @copydoc Toolkit::Internal::Button::StopAllAnimations() */ - virtual void OnActivated(); + virtual void StopAllAnimations(); private: /** - * Perform the click action to click the button. - * @param[in] attributes The attributes to perfrom this action. + * Adds the actor to the transition animation. + * It creates a transition animation if needed and starts the animation. + * @param[in] actor The actor. */ - void DoClickAction(const PropertyValueContainer& attributes); + void StartTransitionAnimation( Actor& actor ); -public: /** - * Performs actions as requested using the action name. - * @param[in] object The object on which to perform the action. - * @param[in] actionName The action to perform. - * @param[in] attributes The attributes with which to perfrom this action. - * @return true if action has been accepted by this control + * Stops the transition animation. + * @param[in] remove If true, removes the fadeout actor from root. */ - static bool DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes); + void StopTransitionAnimation( bool remove = true ); -protected: // From Button + // slots /** - * Registers properties + * Called when the transition animation finishes. */ - virtual void OnButtonInitialize(); - - /** - * Emits signals and notifies the painter accordingly with the set button - * properties when the button is released. - */ - virtual void OnButtonUp(); - - /** - * Sets the push button animation time. - * @param animationTime The animation time in seconds. - */ - virtual void OnAnimationTimeSet( float animationTime ); - - /** - * Retrieves the animation time. - * @return The animation time in seconds. - */ - virtual float OnAnimationTimeRequested() const; - -protected: - - /** - * Construct a new CheckBoxButton. - */ - CheckBoxButton(); - - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~CheckBoxButton(); + void TransitionAnimationFinished( Dali::Animation& source ); private: @@ -225,19 +124,9 @@ private: // Undefined CheckBoxButton& operator=( const CheckBoxButton& ); - private: - bool mChecked; ///< Stores the check state. - - Actor mBackgroundImage; ///< Stores the background image. - Actor mCheckedImage; ///< Stores the checked image. - Actor mDisabledCheckedImage; ///< Stores the disabled checked image. - Actor mDisabledBackgroundImage; ///< Stores the disabled background image. - Actor mFadeOutBackgroundImage; ///< Stores a background image, which is in a fade out animation, to be removed when the animation finishes. - Actor mFadeOutCheckedImage; ///< Stores a foreground image, which is in a fade out animation, to be removed when the animation finishes. - - // Actions - bool mClickActionPerforming; + Animation mTransitionAnimation; ///< Animation used in the state transitions. + ShaderEffect mTickUVEffect; ///< ImageRegionEffect to expand the tick across }; } // namespace Internal