[dali_1.0.36] Merge branch 'tizen'
[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/text-view/text-view.h>
27 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
28 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
29 #include "button-impl.h"
30
31 namespace Dali
32 {
33 namespace Toolkit
34 {
35 namespace Internal
36 {
37
38 /**
39  * RadioButton implementation class.
40  *
41  * \sa Dali::Toolkit::RadioButton
42  */
43 class RadioButton: public Button
44 {
45 public:
46
47   /**
48    * Create a new RadioButton.
49    *
50    * @return A smart-pointer to the newly allocated RadioButton.
51    */
52   static Dali::Toolkit::RadioButton New();
53
54 private:
55
56   /**
57    * Construct a new RadioButton.
58    */
59   RadioButton();
60
61   /**
62    * A reference counted object may only be deleted by calling Unreference()
63    */
64   virtual ~RadioButton();
65
66 private: // From Button
67
68   /**
69    * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
70    */
71   virtual void OnButtonInitialize();
72
73   /**
74    * @copydoc Toolkit::Internal::Button::OnButtonUp()
75    */
76   virtual void OnButtonUp();
77
78   /**
79    * @copydoc Toolkit::Internal::Button::OnSelected()
80    */
81   virtual bool OnSelected();
82
83   /**
84    * @copydoc Toolkit::Internal::Button::OnLabelSet()
85    */
86   virtual void OnLabelSet();
87
88 private:
89
90   // Undefined
91   RadioButton( const RadioButton& origin );
92
93   // Undefined
94   RadioButton& operator=( const RadioButton& origin );
95 };
96
97 } // namespace Internal
98
99 // Helpers for public-api forwarding methods
100
101 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
102 {
103   DALI_ASSERT_ALWAYS(button);
104
105   Dali::RefObject& handle = button.GetImplementation();
106
107   return static_cast<Toolkit::Internal::RadioButton&> (handle);
108 }
109
110 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
111 {
112   DALI_ASSERT_ALWAYS(button);
113
114   const Dali::RefObject& handle = button.GetImplementation();
115
116   return static_cast<const Toolkit::Internal::RadioButton&> (handle);
117 }
118
119 } // namespace Toolkit
120 } // namespace Dali
121
122 #endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__