1 #ifndef __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__
2 #define __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/public-api/animation/animation.h>
24 #include <dali/public-api/shader-effects/shader-effect.h>
28 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
30 #include "button-impl.h"
42 * CheckBoxButton implementation class.
44 * \sa Dali::Toolkit::CheckBoxButton
46 class CheckBoxButton : public Button
51 * Create a new CheckBoxButton.
52 * @return A smart-pointer to the newly allocated CheckBoxButton.
54 static Dali::Toolkit::CheckBoxButton New();
59 * Construct a new CheckBoxButton.
64 * A reference counted object may only be deleted by calling Unreference()
66 virtual ~CheckBoxButton();
68 private: // From Button
72 * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
74 virtual void OnButtonInitialize();
77 * @copydoc Toolkit::Internal::Button::OnLabelSet()
79 virtual void OnLabelSet();
82 * @copydoc Toolkit::Internal::Button::OnSelected()
84 virtual bool OnSelected();
87 * @copydoc Toolkit::Internal::Button::OnDisabled()
89 virtual bool OnDisabled();
92 * @copydoc Toolkit::Internal::Button::StopAllAnimations()
94 virtual void StopAllAnimations();
99 * Adds the actor to the transition animation.
100 * It creates a transition animation if needed and starts the animation.
101 * @param[in] actor The actor.
103 void StartTransitionAnimation( Actor& actor );
106 * Stops the transition animation.
107 * @param[in] remove If true, removes the fadeout actor from root.
109 void StopTransitionAnimation( bool remove = true );
114 * Called when the transition animation finishes.
116 void TransitionAnimationFinished( Dali::Animation& source );
121 CheckBoxButton( const CheckBoxButton& );
124 CheckBoxButton& operator=( const CheckBoxButton& );
127 Animation mTransitionAnimation; ///< Animation used in the state transitions.
128 ShaderEffect mTickUVEffect; ///< ImageRegionEffect to expand the tick across
131 } // namespace Internal
133 // Helpers for public-api forwarding methods
135 inline Toolkit::Internal::CheckBoxButton& GetImplementation( Toolkit::CheckBoxButton& button )
137 DALI_ASSERT_ALWAYS( button );
139 Dali::RefObject& handle = button.GetImplementation();
141 return static_cast<Toolkit::Internal::CheckBoxButton&>( handle );
144 inline const Toolkit::Internal::CheckBoxButton& GetImplementation( const Toolkit::CheckBoxButton& button )
146 DALI_ASSERT_ALWAYS( button );
148 const Dali::RefObject& handle = button.GetImplementation();
150 return static_cast<const Toolkit::Internal::CheckBoxButton&>( handle );
153 } // namespace Toolkit
157 #endif // __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__