X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fradio-button.h;h=3dcd111e3690c67f739dc24df6fdcf747797c6df;hp=5f461b6043ba7a30b308ee877e7fb846120db4d9;hb=6b7c807d4a72e4fae1bbcc7aa64c024f5f84944d;hpb=57869973578f6a0b0f836d396c7232ddb8302c6b diff --git a/dali-toolkit/public-api/controls/buttons/radio-button.h b/dali-toolkit/public-api/controls/buttons/radio-button.h index 5f461b6..3dcd111 100644 --- a/dali-toolkit/public-api/controls/buttons/radio-button.h +++ b/dali-toolkit/public-api/controls/buttons/radio-button.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_RADIO_BUTTON_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,15 +35,19 @@ namespace Internal DALI_INTERNAL class RadioButton; } +/** + * @addtogroup dali_toolkit_controls_buttons + * @{ + */ /** * @brief A RadioButton provides a radio button which two states \e selected or \e unselected. * * Radio buttons are designed to select one of many option at the same time. * - * Every button have its own \e label and \e state, which can be modified by RadioButton::SetLabel and RadioButton::SetSelected. + * Every button have its own \e label and \e state, which can be modified by Button::SetLabelText and Button::SetSelected. * - * RadioButton can change its current state using RadioButton::ToggleState. + * RadioButton can change its current state using Button::SetSelected. * * RadioButtons can be grouped. * Two or more RadioButtons are in one group when they have this same parent. @@ -51,7 +55,34 @@ class RadioButton; * So when RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected. * When \e selected RadioButton is set to \e unselected no other RadioButtons in his group is set to \e selected. * - * A Button::ClickedSignal() is emitted when the RadioButton change its state to \e selected or \e unselected. + * A Button::StateChangedSignal() is emitted when the RadioButton change its state to \e selected or \e unselected. + * + * Usage example: - + * + * @code + * // in Creating a DALi Application + * + * // Create a group to bind two or more RadioButtons together + * Actor radioGroup = Actor::New(); + * radioGroup.SetParentOrigin( ParentOrigin::CENTER ); + * Stage::GetCurrent().Add( radioGroup ); + * + * // Make the first RadioButton and add it to its parent + * RadioButton button1 = RadioButton::New(); + * button1.SetLabelText( "button1" ); + * button1.SetBackgroundColor( Color::WHITE ); + * button1.SetPosition( 0, -40 ); + * radioGroup.Add( button1 ); + * + * // Make more RadioButtons and add them to their parent + * RadioButton button2 = RadioButton::New(); + * button2.SetLabelText( "button2" ); + * button2.SetBackgroundColor( Color::WHITE ); + * button2.SetPosition( 0, 40 ); + * radioGroup.Add( button2 ); + * + * @endcode + * @SINCE_1_0.0 */ class DALI_IMPORT_API RadioButton: public Button { @@ -60,29 +91,34 @@ class DALI_IMPORT_API RadioButton: public Button * @brief Create an uninitialized RadioButton; this can be initialized with RadioButton::New(). * * Calling member functions with an uninitialized Dali::Object is not allowed. + * @SINCE_1_0.0 */ RadioButton(); /** * @brief Copy constructor. + * @SINCE_1_0.0 */ - RadioButton(const RadioButton& radioButton); + RadioButton( const RadioButton& radioButton ); /** * @brief Assignment operator. + * @SINCE_1_0.0 */ - RadioButton& operator=(const RadioButton& radioButton); + RadioButton& operator=( const RadioButton& radioButton ); /** * @brief Destructor * * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_0.0 */ ~RadioButton(); /** * @brief Create an initialized RadioButton. * + * @SINCE_1_0.0 * @return A handle to a newly allocated Dali resource. */ static RadioButton New(); @@ -90,90 +126,49 @@ class DALI_IMPORT_API RadioButton: public Button /** * @brief Create an initialized RadioButton with given label. * + * @SINCE_1_0.0 * @param[in] label The button label. * * @return A handle to a newly allocated Dali resource. */ - static RadioButton New(const std::string& label); + static RadioButton New( const std::string& label ); /** - * @brief Create an initialized RadioButton with existing Actor. - * - * @param[in] label An Actor with the label. - * - * @return A handle to a newly allocated Dali resource. - */ - static RadioButton New(Actor label); - - /** - * @brief Downcast an Object handle to RadioButton. + * @brief Downcast a handle to RadioButton handle. * * If handle points to a RadioButton the downcast produces valid * handle. If not the returned handle is left uninitialized. * + * @SINCE_1_0.0 * @param[in] handle Handle to an object - * @return handle to a RadioButton or an uninitialized handle - */ - static RadioButton DownCast(BaseHandle handle); - - /** - * @brief Sets the button label. - * - * @param[in] label The button label. + * @return A handle to a RadioButton or an uninitialized handle */ - void SetLabel(const std::string& label); - - /** - * @brief Sets the button label using existing Actor. - * - * @param[in] label An Actor with the label. - */ - void SetLabel(Actor label); - - /** - * @brief Gets the label. - * - * @return An Actor with the label. - */ - Actor GetLabel() const; - - /** - * @brief Sets the button as selected or unselected. - * - * @param[in] selected property - */ - void SetSelected(bool selected); - - /** - * @return true if button is selected, false if button is unselected. - */ - bool IsSelected()const; - - /** - * @brief Change button state. - * - * If button is selected unselect it. If button is unselected select it. - */ - void ToggleState(); + static RadioButton DownCast( BaseHandle handle ); public: // Not intended for application developers + /// @cond internal /** * @brief Creates a handle using the Toolkit::Internal implementation. * + * @SINCE_1_0.0 * @param[in] implementation The Control implementation. */ - DALI_INTERNAL RadioButton(Internal::RadioButton& implementation); + DALI_INTERNAL RadioButton( Internal::RadioButton& implementation ); /** * @brief Allows the creation of this Control from an Internal::CustomActor pointer. * + * @SINCE_1_0.0 * @param[in] internal A pointer to the internal CustomActor. */ - DALI_INTERNAL RadioButton(Dali::Internal::CustomActor* internal); - + DALI_INTERNAL RadioButton( Dali::Internal::CustomActor* internal ); + /// @endcond }; +/** + * @} + */ } // namespace Toolkit } // namespace Dali