X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fpush-button-impl.h;h=b04f6b7da709aab599c71aab6573290034795ff9;hb=9c1f4310db72879676b5aca2875fbf67b97a4b0a;hp=ecc7ac7b01f2e03d547dc22bcb57de0da5a5069f;hpb=6c664b09beef66ee4e223cf30fb17ecdd6889bf7;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.h b/dali-toolkit/internal/controls/buttons/push-button-impl.h index ecc7ac7..b04f6b7 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__ -#define __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__ +#ifndef DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H +#define DALI_TOOLKIT_INTERNAL_PUSH_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. @@ -27,13 +27,10 @@ namespace Dali { - namespace Toolkit { - namespace Internal { - /** * PushButton implementation class. * @@ -42,7 +39,6 @@ namespace Internal class PushButton : public Button { public: - /** * Create a new PushButton. * @return A smart-pointer to the newly allocated PushButton. @@ -50,7 +46,6 @@ public: static Dali::Toolkit::PushButton New(); protected: - /** * Construct a new PushButton. */ @@ -62,7 +57,6 @@ protected: virtual ~PushButton(); public: - // Properties /** @@ -83,7 +77,7 @@ public: * @param[in] index The property index. * @param[in] value The new property value. */ - static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); + static void SetProperty(BaseObject* object, Property::Index index, const Property::Value& value); /** * Called to retrieve a property of an object of this type. @@ -91,23 +85,21 @@ public: * @param[in] index The property index. * @return The current value of the property. */ - static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); + static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex); private: // From Button - /** * @copydoc Toolkit::Internal::Button::OnInitialize */ - virtual void OnInitialize(); + void OnInitialize() override; private: - /** * @brief Sets the alignment mode to use to align the icon to the label. * * @param[in] iconAlignment The alignment mode to use */ - void SetIconAlignment( const PushButton::IconAlignment iconAlignment ); + void SetIconAlignment(const PushButton::IconAlignment iconAlignment); /** * @brief Gets the alignment mode used to align the icon to the label. @@ -117,42 +109,54 @@ private: const PushButton::IconAlignment GetIconAlignment() const; private: - // Undefined - PushButton( const PushButton& ); + PushButton(const PushButton&); // Undefined - PushButton& operator=( const PushButton& ); + PushButton& operator=(const PushButton&); private: + IconAlignment mIconAlignment; ///< The alignment of the icon against the label. + +protected: + class PushButtonAccessible : public Button::ButtonAccessible + { + public: + using Button::ButtonAccessible::ButtonAccessible; + + /** + * @copydoc Dali::Toolkit::DevelControl::ControlAccessible::CalculateStates() + */ + Dali::Accessibility::States CalculateStates() override; + }; - IconAlignment mIconAlignment; ///< The alignment of the icon against the label. + void OnStateChange(State newState) override; }; } // namespace Internal // Helpers for public-api forwarding methods -inline Toolkit::Internal::PushButton& GetImplementation( Toolkit::PushButton& button ) +inline Toolkit::Internal::PushButton& GetImplementation(Toolkit::PushButton& button) { - DALI_ASSERT_ALWAYS( button ); + DALI_ASSERT_ALWAYS(button); Dali::RefObject& handle = button.GetImplementation(); - return static_cast( handle ); + return static_cast(handle); } -inline const Toolkit::Internal::PushButton& GetImplementation( const Toolkit::PushButton& button ) +inline const Toolkit::Internal::PushButton& GetImplementation(const Toolkit::PushButton& button) { - DALI_ASSERT_ALWAYS( button ); + DALI_ASSERT_ALWAYS(button); const Dali::RefObject& handle = button.GetImplementation(); - return static_cast( handle ); + return static_cast(handle); } } // namespace Toolkit } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__ +#endif // DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H