X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fbutton.h;h=baad4dc9412d2c3f64de7a8d02fbbbe58fcd2b8d;hb=5cc78df05271786e4c1c18a0eaab32e05612df9d;hp=20784130ac8128d11543f37a21eabd7b4500c37a;hpb=2acdedcc7c7e732a9ec97d08c8cee7423ed6ebf7;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index 2078413..baad4dc 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_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. @@ -41,31 +41,52 @@ class Button; * point doesn't leave the boundary of the button. * * When the \e disabled property is set to \e true, no signal is emitted. + * + * Signals + * | %Signal Name | Method | + * |-------------------|-----------------------------| + * | pressed | @ref PressedSignal() | + * | released | @ref ReleasedSignal() | + * | clicked | @ref ClickedSignal() | + * | state-changed | @ref StateChangedSignal() | + * + * Actions + * | %Action Name | %Button method called | + * |-------------------|-----------------------------| + * | button-click | %DoClickAction() | */ class DALI_IMPORT_API Button : public Control { public: - // Signal Names - static const char* const SIGNAL_PRESSED; ///< name "pressed" - static const char* const SIGNAL_RELEASED; ///< name "released" - static const char* const SIGNAL_CLICKED; ///< name "clicked" - static const char* const SIGNAL_STATE_CHANGED; ///< name "state-changed" - - //Action Names - static const char* const ACTION_BUTTON_CLICK; ///< name "button-click" - - // Properties - static const Property::Index PROPERTY_DISABLED; ///< name "disabled", @see SetDisabled(), type BOOLEAN - static const Property::Index PROPERTY_AUTO_REPEATING; ///< name "auto-repeating", @see SetAutoRepeating(), type BOOLEAN - static const Property::Index PROPERTY_INITIAL_AUTO_REPEATING_DELAY; ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type FLOAT - static const Property::Index PROPERTY_NEXT_AUTO_REPEATING_DELAY; ///< name "next-auto-repeating-delay", @see SetNextAutoRepeatingDelay(), type FLOAT - static const Property::Index PROPERTY_TOGGLABLE; ///< name "togglable", @see SetTogglableButton(), type BOOLEAN - static const Property::Index PROPERTY_SELECTED; ///< name "selected", @see SetSelected(), type BOOLEAN - static const Property::Index PROPERTY_NORMAL_STATE_ACTOR; ///< name "normal-state-actor", @see SetButtonImage(), type MAP - static const Property::Index PROPERTY_SELECTED_STATE_ACTOR; ///< name "selected-state-actor", @see SetSelectedImage(), type MAP - static const Property::Index PROPERTY_DISABLED_STATE_ACTOR; ///< name "disabled-state-actor", @see SetDisabledImage(), type MAP - static const Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabel(), type MAP + /** + * @brief The start and end property ranges for this control. + */ + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices + }; + + /** + * @brief An enumeration of properties belonging to the Button class. + */ + struct Property + { + enum + { + DISABLED = PROPERTY_START_INDEX, ///< name "disabled", @see SetDisabled(), type bool + AUTO_REPEATING, ///< name "auto-repeating", @see SetAutoRepeating(), type bool + INITIAL_AUTO_REPEATING_DELAY, ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type float + NEXT_AUTO_REPEATING_DELAY, ///< name "next-auto-repeating-delay", @see SetNextAutoRepeatingDelay(), type float + TOGGLABLE, ///< name "togglable", @see SetTogglableButton(), type bool + SELECTED, ///< name "selected", @see SetSelected(), type bool + NORMAL_STATE_ACTOR, ///< name "normal-state-actor", @see SetButtonImage(), type Map + SELECTED_STATE_ACTOR, ///< name "selected-state-actor", @see SetSelectedImage(), type Map + DISABLED_STATE_ACTOR, ///< name "disabled-state-actor", @see SetDisabledImage(), type Map + LABEL_ACTOR, ///< name "label-actor", @see SetLabel(), type Map + }; + }; public: @@ -227,6 +248,55 @@ public: */ Actor GetLabel() const; + /** + * @brief Sets the button image. + * + * @param[in] image The button image. + */ + void SetButtonImage( Image image ); + + /** + * @brief Sets the background image. + * + * @param[in] image The background image. + */ + void SetBackgroundImage( Image image ); + + /** + * @brief Sets the selected image. + * + * @param[in] image The selected image. + */ + void SetSelectedImage( Image image ); + + /** + * @brief Sets the selected background image. + * + * @param[in] image The selected background image. + */ + void SetSelectedBackgroundImage( Image image ); + + /** + * @brief Sets the disabled background image. + * + * @param[in] image The disabled background image. + */ + void SetDisabledBackgroundImage( Image image ); + + /** + * @brief Sets the disabled button image. + * + * @param[in] image The disabled button image. + */ + void SetDisabledImage( Image image ); + + /** + * @brief Sets the disabled selected button image. + * + * @param[in] image The disabled selected button image. + */ + void SetDisabledSelectedImage( Image image ); + public: //Signals /**