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/public-api/actors/image-actor.h>
23 #include <dali/public-api/common/dali-vector.h>
26 #include <dali-toolkit/public-api/controls/buttons/radio-button.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 PushButton.
50 static Dali::Toolkit::RadioButton New();
53 * Construct a new PushButton.
58 * Construct a new PushButton with label.
60 RadioButton( const std::string& label );
63 * Construct a new PushButton with label.
65 RadioButton( Actor label );
68 * A reference counted object may only be deleted by calling Unreference()
70 virtual ~RadioButton();
73 * @copydoc Dali::Toolkit::Button::SetLabel( Actor label )
75 virtual void SetLabel( Actor label ); // TODO: After refactoring painter, this will be removed
78 * @copydoc Dali::Toolkit::Button::SetSelected( bool selected )
80 virtual void SetSelected( bool selected );
83 * @copydoc Dali::Toolkit::Control::OnRelayout()
85 virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
87 protected: // From Control
90 * Sets the relative position of image and label.
92 virtual void OnInitialize();
94 protected: // From Button
96 * Change button state when the button is pressed.
98 virtual void OnButtonUp();
103 RadioButton( const RadioButton& origin );
106 RadioButton& operator=( const RadioButton& origin );
108 Image mUnselectedImage; ///< Stores the unselected image
109 Image mSelectedImage; ///< Stores the selected image
110 ImageActor mRadioIcon; ///< Stores the current image
113 } // namespace Internal
115 // Helpers for public-api forwarding methods
117 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
119 DALI_ASSERT_ALWAYS(button);
121 Dali::RefObject& handle = button.GetImplementation();
123 return static_cast<Toolkit::Internal::RadioButton&> (handle);
126 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
128 DALI_ASSERT_ALWAYS(button);
130 const Dali::RefObject& handle = button.GetImplementation();
132 return static_cast<const Toolkit::Internal::RadioButton&> (handle);
135 } // namespace Toolkit
138 #endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__