Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / radio-button-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
2 #define __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
3
4 /*
5  * Copyright (c) 2014 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/actors/image-actor.h>
23 #include <dali/public-api/common/dali-vector.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
27 #include "button-impl.h"
28
29 namespace Dali
30 {
31 namespace Toolkit
32 {
33 namespace Internal
34 {
35
36 /**
37  * RadioButton implementation class.
38  *
39  * \sa Dali::Toolkit::RadioButton
40  */
41 class RadioButton: public Button
42 {
43 public:
44
45   /**
46    * Create a new RadioButton.
47    *
48    * @return A smart-pointer to the newly allocated PushButton.
49    */
50   static Dali::Toolkit::RadioButton New();
51
52   /**
53    * Construct a new PushButton.
54    */
55   RadioButton();
56
57   /**
58    * Construct a new PushButton with label.
59    */
60   RadioButton( const std::string& label );
61
62   /**
63    * Construct a new PushButton with label.
64    */
65   RadioButton( Actor label );
66
67   /**
68    * A reference counted object may only be deleted by calling Unreference()
69    */
70   virtual ~RadioButton();
71
72 public: // From Button
73
74   /**
75    * @copydoc Toolkit::Internal::Button::SetButtonImage( Actor image )
76    */
77   virtual void SetButtonImage( Actor image );
78
79   /**
80    * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
81    */
82   virtual void SetSelectedImage( Actor image );
83
84 private: // From Button
85
86   /**
87    * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
88    */
89   virtual void OnButtonInitialize();
90
91   /**
92    * @copydoc Toolkit::Internal::Button::OnButtonUp()
93    */
94   virtual void OnButtonUp();
95
96   /**
97    * @copydoc Toolkit::Internal::Button::OnSelected()
98    */
99   virtual void OnSelected( bool selected );
100
101   /**
102    * @copydoc Toolkit::Internal::Button::OnLabelSet()
103    */
104   virtual void OnLabelSet();
105
106 private: // From Control
107
108   /**
109    * @copydoc Dali::Toolkit::Control::OnRelayout()
110    */
111   virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
112
113 private:
114
115   // Undefined
116   RadioButton( const RadioButton& origin );
117
118   // Undefined
119   RadioButton& operator=( const RadioButton& origin );
120 };
121
122 } // namespace Internal
123
124 // Helpers for public-api forwarding methods
125
126 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
127 {
128   DALI_ASSERT_ALWAYS(button);
129
130   Dali::RefObject& handle = button.GetImplementation();
131
132   return static_cast<Toolkit::Internal::RadioButton&> (handle);
133 }
134
135 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
136 {
137   DALI_ASSERT_ALWAYS(button);
138
139   const Dali::RefObject& handle = button.GetImplementation();
140
141   return static_cast<const Toolkit::Internal::RadioButton&> (handle);
142 }
143
144 } // namespace Toolkit
145 } // namespace Dali
146
147 #endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__