1 #ifndef __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
2 #define __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
5 * Copyright (c) 2014 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/dali.h>
24 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
26 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
28 #include <dali/public-api/common/dali-vector.h>
30 #include "button-impl.h"
40 * RadioButton implementation class.
42 * \sa Dali::Toolkit::RadioButton
44 class RadioButton: public Button
49 * Create a new RadioButton.
51 * @return A smart-pointer to the newly allocated PushButton.
53 static Dali::Toolkit::RadioButton New();
56 * Construct a new PushButton.
61 * Construct a new PushButton with label.
63 RadioButton(const std::string& label);
66 * Construct a new PushButton with label.
68 RadioButton(Actor label);
71 * A reference counted object may only be deleted by calling Unreference()
73 virtual ~RadioButton();
76 * @copydoc Dali::Toolkit::RadioButton::SetLabel(const std::string& label)
78 void SetLabel(const std::string& label);
81 * @copydoc Dali::Toolkit::RadioButton::SetLabel(Actor label)
83 void SetLabel(Actor label);
86 * @copydoc Dali::Toolkit::RadioButton::GetLabel()
88 Actor GetLabel() const;
91 * @copydoc Dali::Toolkit::RadioButton::SetActive(bool active)
93 void SetActive(bool active);
96 * @copydoc Dali::Toolkit::RadioButton::IsActive()
101 * @copydoc Dali::Toolkit::RadioButton::ToggleState()
109 * @copydoc Button::SetProperty
111 static void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value);
114 * @copydoc Button::GetProperty
116 static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
118 protected: // From Control
121 * Sets the relative position of image and label.
123 virtual void OnInitialize();
125 protected: // From Button
127 * Change button state when the button is pressed.
129 virtual void OnButtonUp();
134 RadioButton(const RadioButton& origin);
137 RadioButton& operator=(const RadioButton& origin);
139 Image mInactiveImage; ///< Stores the inactive image
140 Image mActiveImage; ///< Stores the active image
141 ImageActor mImageActor; ///< Stores the current image
142 Actor mLabel; ///< Stores the button label
143 bool mActive; ///< Stores the active state
146 } // namespace Internal
148 // Helpers for public-api forwarding methods
150 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
152 DALI_ASSERT_ALWAYS(button);
154 Dali::RefObject& handle = button.GetImplementation();
156 return static_cast<Toolkit::Internal::RadioButton&> (handle);
159 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
161 DALI_ASSERT_ALWAYS(button);
163 const Dali::RefObject& handle = button.GetImplementation();
165 return static_cast<const Toolkit::Internal::RadioButton&> (handle);
168 } // namespace Toolkit
171 #endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__