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/text-view/text-view.h>
27 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
28 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
29 #include "button-impl.h"
39 * RadioButton implementation class.
41 * \sa Dali::Toolkit::RadioButton
43 class RadioButton: public Button
48 * Create a new RadioButton.
50 * @return A smart-pointer to the newly allocated PushButton.
52 static Dali::Toolkit::RadioButton New();
55 * Construct a new PushButton.
60 * Construct a new PushButton with label.
62 RadioButton( const std::string& label );
65 * Construct a new PushButton with label.
67 RadioButton( Actor label );
70 * A reference counted object may only be deleted by calling Unreference()
72 virtual ~RadioButton();
74 public: // From Button
77 * @copydoc Toolkit::Internal::Button::SetButtonImage( Actor image )
79 virtual void SetButtonImage( Actor image );
82 * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
84 virtual void SetSelectedImage( Actor image );
86 private: // From Button
89 * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
91 virtual void OnButtonInitialize();
94 * @copydoc Toolkit::Internal::Button::OnButtonUp()
96 virtual void OnButtonUp();
99 * @copydoc Toolkit::Internal::Button::OnSelected()
101 virtual void OnSelected( bool selected );
104 * @copydoc Toolkit::Internal::Button::OnLabelSet()
106 virtual void OnLabelSet();
111 * @brief Set the image to display
113 * @param[in] image The image to set
115 void SetImage( Actor image );
120 RadioButton( const RadioButton& origin );
123 RadioButton& operator=( const RadioButton& origin );
127 Toolkit::TableView mLayoutContainer; ///< Container to position button images and labels
131 } // namespace Internal
133 // Helpers for public-api forwarding methods
135 inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
137 DALI_ASSERT_ALWAYS(button);
139 Dali::RefObject& handle = button.GetImplementation();
141 return static_cast<Toolkit::Internal::RadioButton&> (handle);
144 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
146 DALI_ASSERT_ALWAYS(button);
148 const Dali::RefObject& handle = button.GetImplementation();
150 return static_cast<const Toolkit::Internal::RadioButton&> (handle);
153 } // namespace Toolkit
156 #endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__