[AT-SPI] Remove SetAccessibilityConstructor()
[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) 2021 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/devel-api/controls/table-view/table-view.h>
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  * RadioButton implementation class.
37  *
38  * \sa Dali::Toolkit::RadioButton
39  */
40 class RadioButton : public Button
41 {
42 public:
43   /**
44    * Create a new RadioButton.
45    *
46    * @return A smart-pointer to the newly allocated RadioButton.
47    */
48   static Dali::Toolkit::RadioButton New();
49
50 private:
51   /**
52    * Construct a new RadioButton.
53    */
54   RadioButton();
55
56   /**
57    * A reference counted object may only be deleted by calling Unreference()
58    */
59   virtual ~RadioButton();
60
61 private: // From Button
62   /**
63    * @copydoc Toolkit::Internal::Button::OnInitialize
64    */
65   void OnInitialize() override;
66
67   /**
68    * @copydoc Toolkit::Internal::Control::CreateAccessibleObject()
69    */
70   DevelControl::ControlAccessible* CreateAccessibleObject() override;
71
72   /**
73    * @copydoc Toolkit::Internal::Button::OnStateChange
74    */
75   void OnStateChange(State newState) override;
76
77   /**
78    * @copydoc Toolkit::Internal::Button::OnToggleReleased
79    */
80   bool OnToggleReleased() override;
81
82 private:
83   // Undefined
84   RadioButton(const RadioButton& origin);
85
86   // Undefined
87   RadioButton& operator=(const RadioButton& origin);
88
89 protected:
90   class RadioButtonAccessible : public Button::ButtonAccessible
91   {
92   public:
93     using Button::ButtonAccessible::ButtonAccessible;
94
95     /**
96      * @copydoc Dali::Toolkit::DevelControl::ControlAccessible::CalculateStates()
97      */
98     Dali::Accessibility::States CalculateStates() override;
99   };
100 };
101
102 } // namespace Internal
103
104 // Helpers for public-api forwarding methods
105
106 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
107 {
108   DALI_ASSERT_ALWAYS(button);
109
110   Dali::RefObject& handle = button.GetImplementation();
111
112   return static_cast<Toolkit::Internal::RadioButton&>(handle);
113 }
114
115 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
116 {
117   DALI_ASSERT_ALWAYS(button);
118
119   const Dali::RefObject& handle = button.GetImplementation();
120
121   return static_cast<const Toolkit::Internal::RadioButton&>(handle);
122 }
123
124 } // namespace Toolkit
125 } // namespace Dali
126
127 #endif // DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H