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