ec0ac2c824e6b03b5e31473bac82210036688c35
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / check-box-button-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__
2 #define __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/devel-api/shader-effects/shader-effect.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
27
28 #include "button-impl.h"
29
30 namespace Dali
31 {
32
33 namespace Toolkit
34 {
35
36 namespace Internal
37 {
38
39 /**
40  * CheckBoxButton implementation class.
41  *
42  * \sa Dali::Toolkit::CheckBoxButton
43  */
44 class CheckBoxButton : public Button
45 {
46 public:
47
48   /**
49    * Create a new CheckBoxButton.
50    * @return A smart-pointer to the newly allocated CheckBoxButton.
51    */
52   static Dali::Toolkit::CheckBoxButton New();
53
54 private:
55
56   /**
57    * Construct a new CheckBoxButton.
58    */
59   CheckBoxButton();
60
61   /**
62    * A reference counted object may only be deleted by calling Unreference()
63    */
64   virtual ~CheckBoxButton();
65
66   /**
67    * Setup the ticking effect to the selected image.
68    */
69   void SetTickUVEffect();
70
71 private: // From Button
72
73
74   /**
75    * @copydoc Toolkit::Internal::Button::OnInitialize
76    */
77   virtual void OnInitialize();
78
79   /**
80    * @copydoc Toolkit::Internal::Button::OnLabelSet
81    */
82   virtual void OnLabelSet( bool noPadding );
83
84   /**
85    * @copydoc Toolkit::Internal::Button::OnDisabled
86    */
87   virtual void OnDisabled();
88
89   /**
90    * @copydoc Toolkit::Internal::Button::PrepareForTranstionIn( Actor actor )
91    */
92   virtual void PrepareForTranstionIn( Actor actor );
93
94   /**
95    * @copydoc Toolkit::Internal::Button::PrepareForTranstionOut( Actor actor )
96    */
97   virtual void PrepareForTranstionOut( Actor actor );
98
99   /**
100    * @copydoc Toolkit::Internal::Button::OnTransitionInImage( Actor actor )
101    */
102   virtual void OnTransitionIn( Actor actor );
103
104 private:
105
106   // Undefined
107   CheckBoxButton( const CheckBoxButton& );
108
109   // Undefined
110   CheckBoxButton& operator=( const CheckBoxButton& );
111
112 private:
113   Actor         mSelectedImage;
114 };
115
116 } // namespace Internal
117
118 // Helpers for public-api forwarding methods
119
120 inline Toolkit::Internal::CheckBoxButton& GetImplementation( Toolkit::CheckBoxButton& button )
121 {
122   DALI_ASSERT_ALWAYS( button );
123
124   Dali::RefObject& handle = button.GetImplementation();
125
126   return static_cast<Toolkit::Internal::CheckBoxButton&>( handle );
127 }
128
129 inline const Toolkit::Internal::CheckBoxButton& GetImplementation( const Toolkit::CheckBoxButton& button )
130 {
131   DALI_ASSERT_ALWAYS( button );
132
133   const Dali::RefObject& handle = button.GetImplementation();
134
135   return static_cast<const Toolkit::Internal::CheckBoxButton&>( handle );
136 }
137
138 } // namespace Toolkit
139
140 } // namespace Dali
141
142 #endif // __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__