X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fradio-button-impl.h;h=b1727502c673b2fbddfd3a04f638728d85c9849b;hb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;hp=07c622ba6c97c6448e0fb223104572ebd94f0c76;hpb=57869973578f6a0b0f836d396c7232ddb8302c6b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/buttons/radio-button-impl.h b/dali-toolkit/internal/controls/buttons/radio-button-impl.h index 07c622b..b172750 100644 --- a/dali-toolkit/internal/controls/buttons/radio-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/radio-button-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ -#define __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ +#ifndef DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H +#define DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -19,11 +19,10 @@ */ // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES -#include +#include #include #include "button-impl.h" @@ -33,118 +32,63 @@ namespace Toolkit { namespace Internal { - /** * RadioButton implementation class. * * \sa Dali::Toolkit::RadioButton */ -class RadioButton: public Button +class RadioButton : public Button { - public: - +public: /** * Create a new RadioButton. * - * @return A smart-pointer to the newly allocated PushButton. + * @return A smart-pointer to the newly allocated RadioButton. */ static Dali::Toolkit::RadioButton New(); +private: /** - * Construct a new PushButton. + * Construct a new RadioButton. */ RadioButton(); /** - * Construct a new PushButton with label. - */ - RadioButton(const std::string& label); - - /** - * Construct a new PushButton with label. - */ - RadioButton(Actor label); - - /** * A reference counted object may only be deleted by calling Unreference() */ virtual ~RadioButton(); +private: // From Button /** - * @copydoc Dali::Toolkit::RadioButton::SetLabel(const std::string& label) - */ - void SetLabel(const std::string& label); - - /** - * @copydoc Dali::Toolkit::RadioButton::SetLabel(Actor label) - */ - void SetLabel(Actor label); - - /** - * @copydoc Dali::Toolkit::RadioButton::GetLabel() - */ - Actor GetLabel() const; - - /** - * @copydoc Dali::Toolkit::RadioButton::SetSelected(bool selected) - */ - void SetSelected(bool selected); - - /** - * @copydoc Dali::Toolkit::RadioButton::IsSelected() - */ - bool IsSelected()const; - - /** - * @copydoc Dali::Toolkit::RadioButton::ToggleState() - */ - void ToggleState(); - - /** - * @copydoc Dali::Toolkit::Control::OnRelayout() - */ - virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container ); - - public: - // Properties - - /** - * @copydoc Button::SetProperty + * @copydoc Toolkit::Internal::Button::OnInitialize */ - static void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value); + void OnInitialize() override; /** - * @copydoc Button::GetProperty + * @copydoc Toolkit::Internal::Button::OnStateChange */ - static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex); - - protected: // From Control + void OnStateChange(State newState) override; /** - * Sets the relative position of image and label. + * @copydoc Toolkit::Internal::Button::OnToggleReleased */ - virtual void OnInitialize(); - - protected: // From Button - /** - * Change button state when the button is pressed. - */ - virtual void OnButtonUp(); - - private: + bool OnToggleReleased() override; +private: // Undefined RadioButton(const RadioButton& origin); // Undefined RadioButton& operator=(const RadioButton& origin); - Image mUnselectedImage; ///< Stores the unselected image - Image mSelectedImage; ///< Stores the selected image - ImageActor mRadioIcon; ///< Stores the current image - Actor mLabel; ///< Stores the button label - bool mSelected; ///< Stores the selected state -} ; +protected: + struct AccessibleImpl : public Button::AccessibleImpl + { + using Button::AccessibleImpl::AccessibleImpl; + + Dali::Accessibility::States CalculateStates() override; + }; +}; } // namespace Internal @@ -156,7 +100,7 @@ inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& b Dali::RefObject& handle = button.GetImplementation(); - return static_cast (handle); + return static_cast(handle); } inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button) @@ -165,10 +109,10 @@ inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::Ra const Dali::RefObject& handle = button.GetImplementation(); - return static_cast (handle); + return static_cast(handle); } } // namespace Toolkit } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ +#endif // DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H