Refactored Button and derived classes, moving state change and transition logic to...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / check-box-button-impl.h
index 47b91ae..25945d2 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 <dali-toolkit/devel-api/shader-effects/image-region-effect.h>
 
 #include "button-impl.h"
 
@@ -52,27 +52,17 @@ public:
    */
   static Dali::Toolkit::CheckBoxButton New();
 
-public: // From Button
-
-  /**
-   * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
-   */
-  virtual void SetSelectedImage( Actor image );
-
-  /**
-   * @copydoc Toolkit::Internal::Button::SetBackgroundImage( Actor image )
-   */
-  virtual void SetBackgroundImage( Actor image );
+private:
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledSelectedImage( Actor image )
+   * Construct a new CheckBoxButton.
    */
-  virtual void SetDisabledSelectedImage( Actor image );
+  CheckBoxButton();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledBackgroundImage( Actor image )
+   * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual void SetDisabledBackgroundImage( Actor image );
+  virtual ~CheckBoxButton();
 
 private: // From Button
 
@@ -88,58 +78,24 @@ private: // From Button
   virtual void OnLabelSet();
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnSelected()
-   */
-  virtual void OnSelected( bool selected );
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnDisabled( bool disabled )
-   */
-  virtual void OnDisabled( bool disabled );
-
-private:
-
-  /**
-   * Construct a new CheckBoxButton.
-   */
-  CheckBoxButton();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~CheckBoxButton();
-
-private:
-
-  /**
-   * Adds the actor to the button.
+   * @copydoc Toolkit::Internal::Button::OnDisabled()
    */
-  void AddChild( Actor& actor );
+  virtual void OnDisabled();
 
   /**
-   * Removes the actor from the button.
+   * @copydoc Toolkit::Internal::Button::PrepareForTranstionIn( Actor actor )
    */
-  void RemoveChild( Actor& actor );
+  virtual void PrepareForTranstionIn( Actor actor );
 
   /**
-   * Adds the actor to the check in animation.
-   * It creates a check in animation if needed and starts the check in animation.
-   * @param[in] actor The actor.
+   * @copydoc Toolkit::Internal::Button::PrepareForTranstionOut( Actor actor )
    */
-  void StartCheckInAnimation( Actor& actor );
+  virtual void PrepareForTranstionOut( Actor actor );
 
   /**
-   * Stops the check in animation.
+   * @copydoc Toolkit::Internal::Button::OnTransitionInImage( Actor actor )
    */
-  void StopCheckInAnimation();
-
-  // slots
-
-  /**
-   * Called when the check in animation finishes.
-   * It changes the check button paint state.
-   */
-  void CheckInAnimationFinished( Dali::Animation& source );
+  virtual void OnTransitionIn( Actor actor );
 
 private:
 
@@ -150,10 +106,7 @@ 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.
+  ShaderEffect              mTickUVEffect;         ///< ImageRegionEffect to expand the tick across
 };
 
 } // namespace Internal