X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fbutton.h;h=cce1c66adb23a75f975c2981cbb8105acf10a238;hp=a49a9e02f3a15b6b023e45ed86c39f9320ffdba7;hb=f3da11c2818c6d17706fbb2417f21b602b3190f5;hpb=030e7c680a6eb0e8d87bfdb8ec359a0267ef7db2 diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index a49a9e0..cce1c66 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -31,29 +31,55 @@ namespace Internal DALI_INTERNAL { class Button; } +/** + * @addtogroup dali_toolkit_controls_buttons + * @{ + */ /** * @brief Button is a base class for different kind of buttons. * * This class provides the disabled property and the clicked signal. * - * A ClickedSignal() is emitted when the button is touched and the touch - * point doesn't leave the boundary of the button. + * A ClickedSignal() is emitted when the button is touched and the touch point doesn't leave the boundary of the button. * * When the \e disabled property is set to \e true, no signal is emitted. * + * Button provides the following properties which modify the signals emitted: + * + * + * The button's appearance can be modified by setting properties for the various image filenames. + * + * The \e background is always shown and doesn't change if the button is pressed or released. The \e button image is shown over the \e background image when the + * button is not pressed and is replaced by the \e selected image when the button is pressed. The text label is placed always on the top of all images. + * + * When the button is disabled, \e background, \e button and \e selected images are replaced by their \e disabled images. + * + * Is not mandatory set all images. A button could be defined only by setting its \e background image or by setting its \e background and \e selected images. + * * Signals - * | %Signal Name | Method | - * |-------------------|-----------------------------| - * | pressed | @ref PressedSignal() | - * | released | @ref ReleasedSignal() | - * | clicked | @ref ClickedSignal() | - * | state-changed | @ref StateChangedSignal() | + * | %Signal Name | Method | + * |------------------|-----------------------------| + * | pressed | @ref PressedSignal() | + * | released | @ref ReleasedSignal() | + * | clicked | @ref ClickedSignal() | + * | stateChanged | @ref StateChangedSignal() | * * Actions - * | %Action Name | %Button method called | - * |-------------------|-----------------------------| - * | button-click | %DoClickAction() | + * | %Action Name | %Button method called | + * |------------------|-----------------------------| + * | buttonClick | %DoClickAction() | */ class DALI_IMPORT_API Button : public Control { @@ -76,15 +102,20 @@ public: 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 + AUTO_REPEATING, ///< name "autoRepeating", @see SetAutoRepeating(), type bool + INITIAL_AUTO_REPEATING_DELAY, ///< name "initialAutoRepeatingDelay", @see SetInitialAutoRepeatingDelay(), type float + NEXT_AUTO_REPEATING_DELAY, ///< name "nextAutoRepeatingDelay", @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 + UNSELECTED_STATE_IMAGE, ///< name "unselectedStateImage", @see SetUnselectedImage(), type std::string + SELECTED_STATE_IMAGE, ///< name "selectedStateImage", @see SetSelectedImage(), type std::string + DISABLED_STATE_IMAGE, ///< name "disabledStateImage", @see SetDisabledImage(), type std::string + UNSELECTED_COLOR, ///< name "unselectedColor", type Vector4 + SELECTED_COLOR, ///< name "selectedColor", type Vector4 + LABEL, ///< name "label", type Property::Map + + // Deprecated properties: + LABEL_TEXT, ///< name "labelText", @see SetLabelText(), type std::string }; }; @@ -218,7 +249,7 @@ public: /** * @brief Sets the animation time. * - * @param [in] animationTime The animation time in seconds. + * @param[in] animationTime The animation time in seconds. */ void SetAnimationTime( float animationTime ); @@ -230,23 +261,114 @@ public: float GetAnimationTime() const; /** - * @brief Sets the button label. + * @brief Sets the button's label. + * + * @param[in] label The label text. + */ + void SetLabelText( const std::string& label ); + + /** + * @brief Gets the label. + * + * @return The label text. + */ + std::string GetLabelText() const; + + /** + * @brief Sets the unselected button image. + * + * @param[in] filename The button image. + */ + void SetUnselectedImage( const std::string& filename ); + + /** + * @brief Sets the background image. + * + * @param[in] filename The background image. + */ + void SetBackgroundImage( const std::string& filename ); + + /** + * @brief Sets the selected image. + * + * @param[in] filename The selected image. + */ + void SetSelectedImage( const std::string& filename ); + + /** + * @brief Sets the selected background image. + * + * @param[in] filename The selected background image. + */ + void SetSelectedBackgroundImage( const std::string& filename ); + + /** + * @brief Sets the disabled background image. + * + * @param[in] filename The disabled background image. + */ + void SetDisabledBackgroundImage( const std::string& filename ); + + /** + * @brief Sets the disabled button image. + * + * @param[in] filename The disabled button image. + */ + void SetDisabledImage( const std::string& filename ); + + /** + * @brief Sets the disabled selected button image. * - * @param[in] label The button label. + * @param[in] filename The disabled selected button image. */ - void SetLabel( const std::string& label ); + void SetDisabledSelectedImage( const std::string& filename ); + + // Deprecated API /** - * @copydoc SetLabel( const std::string& label ) + * @deprecated DALi 1.0.50 + * + * @brief Sets the label with an actor. + * + * @param[in] label The actor to use as a label */ void SetLabel( Actor label ); /** - * @brief Gets the label. + * @deprecated DALi 1.0.50 + * + * @brief Sets the button image. + * + * @param[in] image The button image. + */ + void SetButtonImage( Image image ); + + /** + * @deprecated DALi 1.0.50 + * + * @brief Sets the selected image. + * + * @param[in] image The selected image. + */ + void SetSelectedImage( Image image ); + + /** + * @deprecated DALi 1.0.50 * - * @return An actor with the label. + * @brief Gets the button image. + * + * @return An actor with the button image. + */ + Actor GetButtonImage() const; + + /** + * @deprecated DALi 1.0.50 + * + * @brief Gets the selected image. + * + * @return An actor with the selected image. */ - Actor GetLabel() const; + Actor GetSelectedImage() const; public: //Signals @@ -317,6 +439,9 @@ public: // Not intended for application developers DALI_INTERNAL Button( Dali::Internal::CustomActor* internal ); }; +/** + * @} + */ } // namespace Toolkit } // namespace Dali