X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fradio-button-impl.h;h=075f8bd69d28a5c57a082aa4b33a911e6e91e321;hp=dc31882572e17ef412ad42bc0b9b211aaa34321f;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=2acdedcc7c7e732a9ec97d08c8cee7423ed6ebf7 diff --git a/dali-toolkit/internal/controls/buttons/radio-button-impl.h b/dali-toolkit/internal/controls/buttons/radio-button-impl.h index dc31882..075f8bd 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) 2019 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,12 +19,11 @@ */ // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES -#include #include +#include #include "button-impl.h" namespace Dali @@ -41,64 +40,45 @@ namespace Internal */ 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(); - /** - * Construct a new PushButton. - */ - RadioButton(); +private: /** - * Construct a new PushButton with label. + * Construct a new RadioButton. */ - RadioButton( const std::string& label ); - - /** - * Construct a new PushButton with label. - */ - RadioButton( Actor label ); + RadioButton(); /** * A reference counted object may only be deleted by calling Unreference() */ virtual ~RadioButton(); - /** - * @copydoc Dali::Toolkit::Button::SetLabel( Actor label ) - */ - virtual void SetLabel( Actor label ); // TODO: After refactoring painter, this will be removed +private: // From Button /** - * @copydoc Dali::Toolkit::Button::SetSelected( bool selected ) + * @copydoc Toolkit::Internal::Button::OnInitialize */ - virtual void SetSelected( bool selected ); + void OnInitialize() override; /** - * @copydoc Dali::Toolkit::Control::OnRelayout() + * @copydoc Toolkit::Internal::Button::OnStateChange */ - virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container ); - - protected: // From Control + void OnStateChange( State newState ) override; /** - * Sets the relative position of image and label. + * @copydoc Toolkit::Internal::Button::OnToggleReleased */ - virtual void OnInitialize(); + bool OnToggleReleased() override; - protected: // From Button - /** - * Change button state when the button is pressed. - */ - virtual void OnButtonUp(); - - private: +private: // Undefined RadioButton( const RadioButton& origin ); @@ -106,9 +86,13 @@ class RadioButton: public Button // Undefined RadioButton& operator=( const RadioButton& origin ); - Image mUnselectedImage; ///< Stores the unselected image - Image mSelectedImage; ///< Stores the selected image - ImageActor mRadioIcon; ///< Stores the current image +protected: + struct AccessibleImpl : public Button::AccessibleImpl + { + using Button::AccessibleImpl::AccessibleImpl; + + Dali::Accessibility::States CalculateStates() override; + }; }; } // namespace Internal @@ -136,4 +120,4 @@ inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::Ra } // namespace Toolkit } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ +#endif // DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H