X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fpush-button-impl.h;h=1db13d50a4a932262ef67a19d5ebf09533775f16;hp=730b7466f1ee66f483f8a791ca9c9addf18cc358;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=1db0a8becea3dbdebaa942d934d91824a92434e7 diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.h b/dali-toolkit/internal/controls/buttons/push-button-impl.h index 730b746..1db13d5 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) 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,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include // INTERNAL INCLUDES #include @@ -49,29 +49,72 @@ public: */ static Dali::Toolkit::PushButton New(); -protected: // From Button +protected: /** - * Sets the Leave signal. + * Construct a new PushButton. + */ + PushButton(); + + /** + * A reference counted object may only be deleted by calling Unreference() */ - virtual void OnButtonInitialize(); + virtual ~PushButton(); -protected: // From Control +public: + + // Properties /** - * @copydoc Control::GetNaturalSize() + * Enum for the alignment modes of the icon. */ - virtual Vector3 GetNaturalSize(); + enum IconAlignment + { + LEFT, + RIGHT, + TOP, + BOTTOM, + DEFAULT = RIGHT + }; /** - * Construct a new PushButton. + * Called when a property of an object of this type is set. + * @param[in] object The object whose property is set. + * @param[in] index The property index. + * @param[in] value The new property value. */ - PushButton(); + static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); /** - * A reference counted object may only be deleted by calling Unreference() + * Called to retrieve a property of an object of this type. + * @param[in] object The object whose property is to be retrieved. + * @param[in] index The property index. + * @return The current value of the property. */ - virtual ~PushButton(); + static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); + +private: // From Button + + /** + * @copydoc Toolkit::Internal::Button::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 ); + + /** + * @brief Gets the alignment mode used to align the icon to the label. + * + * @return The alignment mode in use + */ + const PushButton::IconAlignment GetIconAlignment() const; private: @@ -80,6 +123,19 @@ private: // Undefined PushButton& operator=( const PushButton& ); + +private: + + IconAlignment mIconAlignment; ///< The alignment of the icon against the label. + +protected: + struct AccessibleImpl : public Button::AccessibleImpl + { + using Button::AccessibleImpl::AccessibleImpl; + + Dali::Accessibility::States CalculateStates() override; + }; + void OnStateChange( State newState ) override; }; } // namespace Internal @@ -108,4 +164,4 @@ inline const Toolkit::Internal::PushButton& GetImplementation( const Toolkit::Pu } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__ +#endif // DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H