1 #ifndef __DALI_TOOLKIT_RADIO_BUTTON_H__
2 #define __DALI_TOOLKIT_RADIO_BUTTON_H__
5 * Copyright (c) 2015 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.
30 // Forward declarations
32 namespace Internal DALI_INTERNAL
34 // Forward declarations
40 * @brief A RadioButton provides a radio button which two states \e selected or \e unselected.
42 * Radio buttons are designed to select one of many option at the same time.
44 * Every button have its own \e label and \e state, which can be modified by RadioButton::SetLabel and Button::SetSelected.
46 * RadioButton can change its current state using Button::SetSelected.
48 * RadioButtons can be grouped.
49 * Two or more RadioButtons are in one group when they have this same parent.
50 * In each groups only one RadioButton can be \e selected at a given time.
51 * So when RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.
52 * When \e selected RadioButton is set to \e unselected no other RadioButtons in his group is set to \e selected.
54 * A Button::StateChangedSignal() is emitted when the RadioButton change its state to \e selected or \e unselected.
56 class DALI_IMPORT_API RadioButton: public Button
60 * @brief Create an uninitialized RadioButton; this can be initialized with RadioButton::New().
62 * Calling member functions with an uninitialized Dali::Object is not allowed.
67 * @brief Copy constructor.
69 RadioButton( const RadioButton& radioButton );
72 * @brief Assignment operator.
74 RadioButton& operator=( const RadioButton& radioButton );
79 * This is non-virtual since derived Handle types must not contain data or virtual methods.
84 * @brief Create an initialized RadioButton.
86 * @return A handle to a newly allocated Dali resource.
88 static RadioButton New();
91 * @brief Create an initialized RadioButton with given label.
93 * @param[in] label The button label.
95 * @return A handle to a newly allocated Dali resource.
97 static RadioButton New( const std::string& label );
100 * @brief Create an initialized RadioButton with existing Actor.
102 * @param[in] label An Actor with the label.
104 * @return A handle to a newly allocated Dali resource.
106 static RadioButton New( Actor label );
109 * @brief Downcast an Object handle to RadioButton.
111 * If handle points to a RadioButton the downcast produces valid
112 * handle. If not the returned handle is left uninitialized.
114 * @param[in] handle Handle to an object
115 * @return handle to a RadioButton or an uninitialized handle
117 static RadioButton DownCast( BaseHandle handle );
119 public: // Not intended for application developers
122 * @brief Creates a handle using the Toolkit::Internal implementation.
124 * @param[in] implementation The Control implementation.
126 DALI_INTERNAL RadioButton( Internal::RadioButton& implementation );
129 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
131 * @param[in] internal A pointer to the internal CustomActor.
133 DALI_INTERNAL RadioButton( Dali::Internal::CustomActor* internal );
136 } // namespace Toolkit
140 #endif // __DALI_TOOLKIT_RADIO_BUTTON_H__