1 #ifndef DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H
2 #define DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H
5 * Copyright (c) 2019 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/radio-button.h>
26 #include <dali-toolkit/devel-api/controls/table-view/table-view.h>
27 #include "button-impl.h"
37 * RadioButton implementation class.
39 * \sa Dali::Toolkit::RadioButton
41 class RadioButton: public Button
46 * Create a new RadioButton.
48 * @return A smart-pointer to the newly allocated RadioButton.
50 static Dali::Toolkit::RadioButton New();
55 * Construct a new RadioButton.
60 * A reference counted object may only be deleted by calling Unreference()
62 virtual ~RadioButton();
64 private: // From Button
67 * @copydoc Toolkit::Internal::Button::OnInitialize
69 void OnInitialize() override;
72 * @copydoc Toolkit::Internal::Button::OnStateChange
74 void OnStateChange( State newState ) override;
77 * @copydoc Toolkit::Internal::Button::OnToggleReleased
79 bool OnToggleReleased() override;
84 RadioButton( const RadioButton& origin );
87 RadioButton& operator=( const RadioButton& origin );
90 struct AccessibleImpl : public Button::AccessibleImpl
92 using Button::AccessibleImpl::AccessibleImpl;
94 Dali::Accessibility::States CalculateStates() override;
98 } // namespace Internal
100 // Helpers for public-api forwarding methods
102 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
104 DALI_ASSERT_ALWAYS(button);
106 Dali::RefObject& handle = button.GetImplementation();
108 return static_cast<Toolkit::Internal::RadioButton&> (handle);
111 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
113 DALI_ASSERT_ALWAYS(button);
115 const Dali::RefObject& handle = button.GetImplementation();
117 return static_cast<const Toolkit::Internal::RadioButton&> (handle);
120 } // namespace Toolkit
123 #endif // DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H