Changed Toolkit shader effects to be a static function returning a
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / check-box-button-impl.h
index 9d4335a..aacf221 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/animation/animation.h>
+#include <dali/public-api/shader-effects/shader-effect.h>
+
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
-#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
 
 #include "button-impl.h"
 
@@ -52,29 +53,25 @@ public:
    */
   static Dali::Toolkit::CheckBoxButton New();
 
-public: // From Button
+private:
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
+   * Construct a new CheckBoxButton.
    */
-  virtual void SetSelectedImage( Actor image );
+  CheckBoxButton();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetBackgroundImage( Actor image )
+   * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual void SetBackgroundImage( Actor image );
+  virtual ~CheckBoxButton();
+
+private: // From Button
 
-  /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledSelectedImage( Actor image )
-   */
-  virtual void SetDisabledSelectedImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledBackgroundImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
    */
-  virtual void SetDisabledBackgroundImage( Actor image );
-
-private: // From Button
+  virtual void OnButtonInitialize();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnLabelSet()
@@ -84,63 +81,39 @@ private: // From Button
   /**
    * @copydoc Toolkit::Internal::Button::OnSelected()
    */
-  virtual void OnSelected( bool selected );
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnDisabled( bool disabled )
-   */
-  virtual void OnDisabled( bool disabled );
-
-private: // From Control
-
-  /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
-   */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
-
-private:
+  virtual bool OnSelected();
 
   /**
-   * Construct a new CheckBoxButton.
+   * @copydoc Toolkit::Internal::Button::OnDisabled()
    */
-  CheckBoxButton();
+  virtual bool OnDisabled();
 
   /**
-   * A reference counted object may only be deleted by calling Unreference()
+   * @copydoc Toolkit::Internal::Button::StopAllAnimations()
    */
-  virtual ~CheckBoxButton();
+  virtual void StopAllAnimations();
 
 private:
 
   /**
-   * Adds the actor to the button.
-   */
-  void AddChild( Actor& actor );
-
-  /**
-   * Removes the actor from the button.
-   */
-  void RemoveChild( Actor& actor );
-
-  /**
-   * Adds the actor to the check in animation.
-   * It creates a check in animation if needed and starts the check in animation.
+   * Adds the actor to the transition animation.
+   * It creates a transition animation if needed and starts the animation.
    * @param[in] actor The actor.
    */
-  void StartCheckInAnimation( Actor& actor );
+  void StartTransitionAnimation( Actor& actor );
 
   /**
-   * Stops the check in animation.
+   * Stops the transition animation.
+   * @param[in] remove If true, removes the fadeout actor from root.
    */
-  void StopCheckInAnimation();
+  void StopTransitionAnimation( bool remove = true );
 
   // slots
 
   /**
-   * Called when the check in animation finishes.
-   * It changes the check button paint state.
+   * Called when the transition animation finishes.
    */
-  void CheckInAnimationFinished( Dali::Animation& source );
+  void TransitionAnimationFinished( Dali::Animation& source );
 
 private:
 
@@ -151,10 +124,8 @@ private:
   CheckBoxButton& operator=( const CheckBoxButton& );
 
 private:
-  Animation                 mCheckInAnimation;  ///< Animation used in the state transitions.
-  ImageRegionEffect         mTickUVEffect;      ///< ImageRegionEffect to expand the tick across
-
-  PaintState                mPaintState;        ///< The paint state.
+  Animation                 mTransitionAnimation;  ///< Animation used in the state transitions.
+  ShaderEffect              mTickUVEffect;         ///< ImageRegionEffect to expand the tick across
 };
 
 } // namespace Internal