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>
29 #include <dali-toolkit/devel-api/shader-effects/image-region-effect.h>
31 #include "button-impl.h"
43 * CheckBoxButton implementation class.
45 * \sa Dali::Toolkit::CheckBoxButton
47 class CheckBoxButton : public Button
52 * Create a new CheckBoxButton.
53 * @return A smart-pointer to the newly allocated CheckBoxButton.
55 static Dali::Toolkit::CheckBoxButton New();
60 * Construct a new CheckBoxButton.
65 * A reference counted object may only be deleted by calling Unreference()
67 virtual ~CheckBoxButton();
69 private: // From Button
73 * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
75 virtual void OnButtonInitialize();
78 * @copydoc Toolkit::Internal::Button::OnLabelSet()
80 virtual void OnLabelSet();
83 * @copydoc Toolkit::Internal::Button::OnSelected()
85 virtual bool OnSelected();
88 * @copydoc Toolkit::Internal::Button::OnDisabled()
90 virtual bool OnDisabled();
93 * @copydoc Toolkit::Internal::Button::StopAllAnimations()
95 virtual void StopAllAnimations();
100 * Adds the actor to the transition animation.
101 * It creates a transition animation if needed and starts the animation.
102 * @param[in] actor The actor.
104 void StartTransitionAnimation( Actor& actor );
107 * Stops the transition animation.
108 * @param[in] remove If true, removes the fadeout actor from root.
110 void StopTransitionAnimation( bool remove = true );
115 * Called when the transition animation finishes.
117 void TransitionAnimationFinished( Dali::Animation& source );
122 CheckBoxButton( const CheckBoxButton& );
125 CheckBoxButton& operator=( const CheckBoxButton& );
128 Animation mTransitionAnimation; ///< Animation used in the state transitions.
129 ShaderEffect mTickUVEffect; ///< ImageRegionEffect to expand the tick across
132 } // namespace Internal
134 // Helpers for public-api forwarding methods
136 inline Toolkit::Internal::CheckBoxButton& GetImplementation( Toolkit::CheckBoxButton& button )
138 DALI_ASSERT_ALWAYS( button );
140 Dali::RefObject& handle = button.GetImplementation();
142 return static_cast<Toolkit::Internal::CheckBoxButton&>( handle );
145 inline const Toolkit::Internal::CheckBoxButton& GetImplementation( const Toolkit::CheckBoxButton& button )
147 DALI_ASSERT_ALWAYS( button );
149 const Dali::RefObject& handle = button.GetImplementation();
151 return static_cast<const Toolkit::Internal::CheckBoxButton&>( handle );
154 } // namespace Toolkit
158 #endif // __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__