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>
26 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
27 #include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
29 #include "button-impl.h"
41 * CheckBoxButton implementation class.
43 * \sa Dali::Toolkit::CheckBoxButton
45 class CheckBoxButton : public Button
50 * Create a new CheckBoxButton.
51 * @return A smart-pointer to the newly allocated CheckBoxButton.
53 static Dali::Toolkit::CheckBoxButton New();
58 * Construct a new CheckBoxButton.
63 * A reference counted object may only be deleted by calling Unreference()
65 virtual ~CheckBoxButton();
67 private: // From Button
71 * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
73 virtual void OnButtonInitialize();
76 * @copydoc Toolkit::Internal::Button::OnLabelSet()
78 virtual void OnLabelSet();
81 * @copydoc Toolkit::Internal::Button::OnSelected()
83 virtual bool OnSelected();
86 * @copydoc Toolkit::Internal::Button::OnDisabled()
88 virtual bool OnDisabled();
91 * @copydoc Toolkit::Internal::Button::StopAllAnimations()
93 virtual void StopAllAnimations();
98 * Adds the actor to the transition animation.
99 * It creates a transition animation if needed and starts the animation.
100 * @param[in] actor The actor.
102 void StartTransitionAnimation( Actor& actor );
105 * Stops the transition animation.
106 * @param[in] remove If true, removes the fadeout actor from root.
108 void StopTransitionAnimation( bool remove = true );
113 * Called when the transition animation finishes.
115 void TransitionAnimationFinished( Dali::Animation& source );
120 CheckBoxButton( const CheckBoxButton& );
123 CheckBoxButton& operator=( const CheckBoxButton& );
126 Animation mTransitionAnimation; ///< Animation used in the state transitions.
127 ImageRegionEffect mTickUVEffect; ///< ImageRegionEffect to expand the tick across
130 } // namespace Internal
132 // Helpers for public-api forwarding methods
134 inline Toolkit::Internal::CheckBoxButton& GetImplementation( Toolkit::CheckBoxButton& button )
136 DALI_ASSERT_ALWAYS( button );
138 Dali::RefObject& handle = button.GetImplementation();
140 return static_cast<Toolkit::Internal::CheckBoxButton&>( handle );
143 inline const Toolkit::Internal::CheckBoxButton& GetImplementation( const Toolkit::CheckBoxButton& button )
145 DALI_ASSERT_ALWAYS( button );
147 const Dali::RefObject& handle = button.GetImplementation();
149 return static_cast<const Toolkit::Internal::CheckBoxButton&>( handle );
152 } // namespace Toolkit
156 #endif // __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__