Merge "Fix TableView::GetNextKeyboardFocusableActor function by returning a valid...
[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/common/dali-vector.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
26 #include <dali-toolkit/public-api/controls/table-view/table-view.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 RadioButton.
49    */
50   static Dali::Toolkit::RadioButton New();
51
52 private:
53
54   /**
55    * Construct a new RadioButton.
56    */
57   RadioButton();
58
59   /**
60    * A reference counted object may only be deleted by calling Unreference()
61    */
62   virtual ~RadioButton();
63
64 private: // From Button
65
66   /**
67    * @copydoc Toolkit::Internal::Button::OnInitialize
68    */
69   virtual void OnInitialize();
70
71   /**
72    * @copydoc Toolkit::Internal::Button::OnStateChange
73    */
74   virtual void OnStateChange( State newState );
75
76   /**
77    * @copydoc Toolkit::Internal::Button::OnToggleReleased
78    */
79   virtual bool OnToggleReleased();
80
81 private:
82
83   // Undefined
84   RadioButton( const RadioButton& origin );
85
86   // Undefined
87   RadioButton& operator=( const RadioButton& origin );
88 };
89
90 } // namespace Internal
91
92 // Helpers for public-api forwarding methods
93
94 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
95 {
96   DALI_ASSERT_ALWAYS(button);
97
98   Dali::RefObject& handle = button.GetImplementation();
99
100   return static_cast<Toolkit::Internal::RadioButton&> (handle);
101 }
102
103 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
104 {
105   DALI_ASSERT_ALWAYS(button);
106
107   const Dali::RefObject& handle = button.GetImplementation();
108
109   return static_cast<const Toolkit::Internal::RadioButton&> (handle);
110 }
111
112 } // namespace Toolkit
113 } // namespace Dali
114
115 #endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__