1 #ifndef DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H
2 #define DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/common/dali-vector.h>
25 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
27 #include "button-impl.h"
36 * CheckBoxButton implementation class.
38 * \sa Dali::Toolkit::CheckBoxButton
40 class CheckBoxButton : public Button
44 * Create a new CheckBoxButton.
45 * @return A smart-pointer to the newly allocated CheckBoxButton.
47 static Dali::Toolkit::CheckBoxButton New();
51 * Construct a new CheckBoxButton.
56 * A reference counted object may only be deleted by calling Unreference()
58 virtual ~CheckBoxButton();
60 private: // From Button
62 * @copydoc Toolkit::Internal::Button::OnInitialize
64 void OnInitialize() override;
68 CheckBoxButton(const CheckBoxButton&);
71 CheckBoxButton& operator=(const CheckBoxButton&);
74 struct AccessibleImpl : public Button::AccessibleImpl
76 using Button::AccessibleImpl::AccessibleImpl;
78 Dali::Accessibility::States CalculateStates() override;
80 void OnStateChange(State newState) override;
83 } // namespace Internal
85 // Helpers for public-api forwarding methods
87 inline Toolkit::Internal::CheckBoxButton& GetImplementation(Toolkit::CheckBoxButton& button)
89 DALI_ASSERT_ALWAYS(button);
91 Dali::RefObject& handle = button.GetImplementation();
93 return static_cast<Toolkit::Internal::CheckBoxButton&>(handle);
96 inline const Toolkit::Internal::CheckBoxButton& GetImplementation(const Toolkit::CheckBoxButton& button)
98 DALI_ASSERT_ALWAYS(button);
100 const Dali::RefObject& handle = button.GetImplementation();
102 return static_cast<const Toolkit::Internal::CheckBoxButton&>(handle);
105 } // namespace Toolkit
109 #endif // DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H