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=68b256791fe182666575d9565824a855d229347c;hp=8893d88fbf093bf31d16252494d51d6b7c309646;hb=abbf60ed35112186269d2fe93b949eb8abd4283d;hpb=3e8075bf5e85c5e0151b79bddc66bf03faa8d826 diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index 8893d88..68b2567 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -37,7 +37,7 @@ class Button; */ /** - * @brief Button is a base class for different kind of buttons. + * @brief Button is a base class for different kinds of buttons. * * This class provides the disabled property and the clicked signal. * @@ -59,14 +59,46 @@ class Button; * When \e togglable is set to \e true, a Button::StateChangedSignal() signal is emitted, with the selected state. * * - * The button's appearance can be modified by setting properties for the various image filenames. + * 'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer. * - * 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. + * The button's appearance can be modified by setting properties for the various images. * - * When the button is disabled, \e background, \e button and \e selected images are replaced by their \e disabled images. + * It is not mandatory to set all visuals. A button could be defined only by setting its \e background visual or by setting its \e background and \e selected visuals. * - * Is not mandatory to 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. + * The \e button visual is shown over the \e background visual.. + * When pressed the unselected visuals are replaced by the \e selected visual. The text label is always placed on the top of all images. + * + * When the button is disabled, \e background, \e button and \e selected visuals are replaced by their \e disabled visuals. + * + + * + * @brief A control which renders a short text string. + * + * Text labels are lightweight, non-editable and do not respond to user input. + * + * + * @section ButtonProperties Properties + * |%Property enum |String name |Type |Writable|Animatable| + * |-------------------------------------------------------|----------------------------------------|--------------|--------|----------| + * | Property::DISABLED | disabled | BOOLEAN | Y | N | + * | Property::AUTO_REPEATING | autoRepeating | BOOLEAN | Y | N | + * | Property::INITIAL_AUTO_REPEATING_DELAY | initialAutoRepeatingDelay | FLOAT | Y | N | + * | Property::NEXT_AUTO_REPEATING_DELAY | nextAutoRepeatingDelay | FLOAT | Y | N | + * | Property::TOGGLABLE | togglable | BOOLEAN | Y | N | + * | Property::SELECTED | selected | BOOLEAN | Y | N | + * | Property::LABEL | label | MAP | Y | N | + * | Property::UNSELECTED_STATE_VISUAL | unselectedVisual | MAP | Y | N | + * | Property::SELECTED_VISUAL | selectedVisual | MAP | Y | N | + * | Property::DISABLED_SELECTED_VISUAL | disabledSelectedVisual | MAP | Y | N | + * | Property::DISABLED_UNSELECTED_VISUAL | disabledUnselectedVisual | MAP | Y | N | + * | Property::UNSELECTED_BACKGROUND_VISUAL | unselectedBackgroundVisual | MAP | Y | N | + * | Property::SELECTED_BACKGROUND_VISUAL | selectedBackgroundVisual | MAP | Y | N | + * | Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL | disabledUnselectedBackgroundVisual | MAP | Y | N | + * | Property::DISABLED_SELECTED_BACKGROUND_VISUAL | disabledSelectedBackgroundVisual | MAP | Y | N | + * | Property::LABEL_RELATIVE_ALIGNMENT | labelRelativeAlignment | STRING | Y | N | + * ------------------------------------------------------------------------------------------------------------------------------------- + * + * Note, *_VISUAL properties of type MAP can also be passed a uri of type STRING * * Signals * | %Signal Name | Method | @@ -102,23 +134,167 @@ public: */ struct Property { + /** + * @brief An enumeration of properties belonging to the Button class. + * @SINCE_1_0.0 + */ enum { - DISABLED = PROPERTY_START_INDEX, ///< name "disabled", @see SetDisabled(), type bool @SINCE_1_0.0 - AUTO_REPEATING, ///< name "autoRepeating", @see SetAutoRepeating(), type bool @SINCE_1_0.0 - INITIAL_AUTO_REPEATING_DELAY, ///< name "initialAutoRepeatingDelay", @see SetInitialAutoRepeatingDelay(), type float @SINCE_1_0.0 - NEXT_AUTO_REPEATING_DELAY, ///< name "nextAutoRepeatingDelay", @see SetNextAutoRepeatingDelay(), type float @SINCE_1_0.0 - TOGGLABLE, ///< name "togglable", @see SetTogglableButton(), type bool @SINCE_1_0.0 - SELECTED, ///< name "selected", @see SetSelected(), type bool @SINCE_1_0.0 - UNSELECTED_STATE_IMAGE, ///< name "unselectedStateImage", @see SetUnselectedImage(), type std::string @SINCE_1_0.0 - SELECTED_STATE_IMAGE, ///< name "selectedStateImage", @see SetSelectedImage(), type std::string @SINCE_1_0.0 - DISABLED_STATE_IMAGE, ///< name "disabledStateImage", @see SetDisabledImage(), type std::string @SINCE_1_0.0 - UNSELECTED_COLOR, ///< name "unselectedColor", type Vector4 @SINCE_1_0.0 - SELECTED_COLOR, ///< name "selectedColor", type Vector4 @SINCE_1_0.0 - LABEL, ///< name "label", type Property::Map @SINCE_1_0.0 - - // Deprecated properties: - LABEL_TEXT, ///< name "labelText", @see SetLabelText(), type std::string @SINCE_1_0.0 + /** + * @brief name "disabled", type bool + * @details Sets the button as \e disabled. + * @SINCE_1_0.0 + */ + DISABLED = PROPERTY_START_INDEX, + + /** + * @brief name "autoRepeating", type bool + * @details If the \e autorepeating property is set to \e true then the \e togglable property is set to false + * @SINCE_1_0.0 + */ + AUTO_REPEATING, + + /** + * @brief name "initialAutoRepeatingDelay", type float + * @details By default this value is set to 0.15 seconds. + * @SINCE_1_0.0 + */ + INITIAL_AUTO_REPEATING_DELAY, + + /** + * @brief name "nextAutoRepeatingDelay", type float + * @details default this value is set to 0.05 seconds + * @SINCE_1_0.0 + */ + NEXT_AUTO_REPEATING_DELAY, + + /** + * @brief name "togglable", type bool + * @details If the \e togglable property is set to \e true, then the \e autorepeating property is set to false. + * @SINCE_1_0.0 + */ + TOGGLABLE, + + /** + * @brief name "selected", type bool + * @details Sets the togglable button as either selected or unselected, \e togglable property must be set to \e true. + * @SINCE_1_0.0 + */ + SELECTED, + + /** + * @DEPRECATED_1_1.XX Use UNSELECTED_VISUAL + * @brief name "unselectedStateImage", type string if it is a url, map otherwise + * @details Sets the unselected button foreground image + * @SINCE_1_0.0 + */ + UNSELECTED_STATE_IMAGE, + + /** + * @DEPRECATED_1_1.XX Use SELECTED_VISUAL + * @brief name "selectedStateImage", type string if it is a url, map otherwise + * @details Sets the selected button foreground image + * @SINCE_1_0.0 + */ + SELECTED_STATE_IMAGE, + + /** + * @DEPRECATED_1_1.XX Use DISABLED_UNSELECTED_VISUAL + * @brief name "disabledStateImage", type string if it is a url, map otherwise + * @details Sets the disabled whilst unselected foreground button visual + * @SINCE_1_0.0 + */ + DISABLED_STATE_IMAGE, + + /** + * @DEPRECATED_1_1.XX Use UNSELECTED_BACKGROUND_VISUAL + * @brief name "unselectedColor", type Vector4 + * @SINCE_1_0.0 + */ + UNSELECTED_COLOR, + + /** + * @DEPRECATED_1_1.XX Use SELECTED_BACKGROUND_VISUAL + * @brief name "selectedColor", type Vector4 + * @SINCE_1_0.0 + */ + SELECTED_COLOR, + + /** + * @brief name "label", type Property::Map + * @SINCE_1_0.0 + */ + LABEL, + + /** + * @DEPRECATED_1_1.32 Use LABEL + * @brief name "labelText", type std::string + * @SINCE_1_0.0 + */ + LABEL_TEXT, + + /** + * @brief name "unselectedVisual", type string if it is a url, map otherwise + * @details Sets the unselected button foreground/icon visual + * @SINCE_1_2.XX + */ + UNSELECTED_VISUAL, + + /** + * @brief name "selectedImage", type string if it is a url, map otherwise + * @details Sets the selected button foreground/icon visual + * @SINCE_1_2.XX + */ + SELECTED_VISUAL, + + /** + * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise + * @details Sets the disabled selected state foreground/icon button visual + * @SINCE_1_2.XX + */ + DISABLED_SELECTED_VISUAL, + + /** + * @brief name "disabledUnSelectedVisual", type string if it is a url, map otherwise + * @details Sets the disabled unselected state foreground/icon visual + * @SINCE_1_2.XX + */ + DISABLED_UNSELECTED_VISUAL, + + /** + * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the disabled in the unselected state background, button visual + * @SINCE_1_2.XX + */ + UNSELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the selected background button visual + * @SINCE_1_2.XX + */ + SELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the disabled while unselected background button visual + * @SINCE_1_2.XX + */ + DISABLED_UNSELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the disabled while selected background button visual + * @SINCE_1_2.XX + */ + DISABLED_SELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "labelRelativeAlignment", type STRING + * @details Sets the position of the the label in relation to the foreground/icon if both present + * @SINCE_1_2.XX + */ + LABEL_RELATIVE_ALIGNMENT, }; }; @@ -136,12 +312,15 @@ public: /** * @brief Copy constructor. * @SINCE_1_0.0 + * @param[in] button Handle to an object */ Button( const Button& button ); /** * @brief Assignment operator. * @SINCE_1_0.0 + * @param[in] button Handle to an object + * @return A reference to this */ Button& operator=( const Button& button ); @@ -177,7 +356,7 @@ public: * @SINCE_1_0.0 * @param[in] disabled property. */ - void SetDisabled( bool disabled ); + void SetDisabled( bool disabled ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 Use GetProperty DISABLED @@ -186,7 +365,7 @@ public: * @SINCE_1_0.0 * @return \e true if the button is \e disabled. */ - bool IsDisabled() const; + bool IsDisabled() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 SetProperty AUTO_REPEATING or Styling file @@ -199,7 +378,7 @@ public: * @SINCE_1_0.0 * @param[in] autoRepeating \e autorepeating property. */ - void SetAutoRepeating( bool autoRepeating ); + void SetAutoRepeating( bool autoRepeating ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 GetProperty AUTO_REPEATING @@ -208,7 +387,7 @@ public: * @SINCE_1_0.0 * @return \e true if the \e autorepeating property is set. */ - bool IsAutoRepeating() const; + bool IsAutoRepeating() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file @@ -221,7 +400,7 @@ public: * @param[in] initialAutoRepeatingDelay in seconds. * @pre initialAutoRepeatingDelay must be greater than zero. */ - void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ); + void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 GetProperty INITIAL_AUTO_REPEATING_DELAY @@ -230,7 +409,7 @@ public: * @SINCE_1_0.0 * @return the initial autorepeating delay in seconds. */ - float GetInitialAutoRepeatingDelay() const; + float GetInitialAutoRepeatingDelay() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file @@ -243,7 +422,7 @@ public: * @param[in] nextAutoRepeatingDelay in seconds. * @pre nextAutoRepeatingDelay must be greater than zero. */ - void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ); + void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 GetProperty NEXT_AUTO_REPEATING_DELAY @@ -252,7 +431,7 @@ public: * @SINCE_1_0.0 * @return the next autorepeating delay in seconds. */ - float GetNextAutoRepeatingDelay() const; + float GetNextAutoRepeatingDelay() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 SetProperty TOGGLABLE or Styling file @@ -264,7 +443,7 @@ public: * @SINCE_1_0.0 * @param[in] togglable property. */ - void SetTogglableButton( bool togglable ); + void SetTogglableButton( bool togglable ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 GetProperty TOGGLABLE @@ -273,7 +452,7 @@ public: * @SINCE_1_0.0 * @return \e true if the \e togglable property is set. */ - bool IsTogglableButton() const; + bool IsTogglableButton() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 SetProperty SELECTED @@ -287,16 +466,16 @@ public: * @SINCE_1_0.0 * @param[in] selected property. */ - void SetSelected( bool selected ); + void SetSelected( bool selected ) DALI_DEPRECATED_API; /** - * DEPRECATED_1_1.32 SetProperty SELECTED + * DEPRECATED_1_1.32 GetProperty SELECTED * * @brief Returns if the selected property is set and the button is togglable. * @SINCE_1_0.0 * @return \e true if the button is \e selected. */ - bool IsSelected() const; + bool IsSelected() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 Use Styling file to set animation @@ -306,7 +485,7 @@ public: * @SINCE_1_0.0 * @param[in] animationTime The animation time in seconds. */ - void SetAnimationTime( float animationTime ); + void SetAnimationTime( float animationTime ) DALI_DEPRECATED_API; /** * DEPRECATED_1_1.32 Use Styling file to set animation @@ -316,17 +495,17 @@ public: * @SINCE_1_0.0 * @return The animation time in seconds. */ - float GetAnimationTime() const; + float GetAnimationTime() const DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 SetProperty LABEL or Styling file + * @DEPRECATED_1_1.32 SetProperty Property::LABEL or Styling file * * @brief Sets the button's label. * * @SINCE_1_0.0 * @param[in] label The label text. */ - void SetLabelText( const std::string& label ); + void SetLabelText( const std::string& label ) DALI_DEPRECATED_API; /** * DEPRECATED_1_1.32 GetProperty LABEL @@ -336,77 +515,81 @@ public: * @SINCE_1_0.0 * @return The label text. */ - std::string GetLabelText() const; + std::string GetLabelText() const DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use Styling file + * @DEPRECATED_1_1.32 Use Styling file Property::UNSELECTED_STATE_IMAGE * * @brief Sets the unselected button image. * * @SINCE_1_0.0 * @param[in] filename The button image. */ - void SetUnselectedImage( const std::string& filename ); + void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 Use styling + * Use Property::UNSELECTED_BACKGROUND_VISUAL * - * @brief Sets the background image. + * @brief Sets the unselected background image. * * @SINCE_1_0.0 * @param[in] filename The background image. */ - void SetBackgroundImage( const std::string& filename ); + void SetBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use styling file + * @DEPRECATED_1_1.32 Use styling file, Property::SELECTED_STATE_IMAGE * * @brief Sets the selected image. * * @SINCE_1_0.0 * @param[in] filename The selected image. */ - void SetSelectedImage( const std::string& filename ); + void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use styling file + * @DEPRECATED_1_2.32 Use styling file + * Use Property::SELECTED_BACKGROUND_VISUAL * * @brief Sets the selected background image. * * @SINCE_1_0.0 * @param[in] filename The selected background image. */ - void SetSelectedBackgroundImage( const std::string& filename ); + void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 Use styling file + * Use Property::DISABLED_SELECTED_BACKGROUND_VISUAL * * @brief Sets the disabled background image. * * @SINCE_1_0.0 * @param[in] filename The disabled background image. */ - void SetDisabledBackgroundImage( const std::string& filename ); + void SetDisabledBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use styling file + * @DEPRECATED_1_1.32 Use styling file Property::DISABLED_STATE_IMAGE * * @brief Sets the disabled button image. * * @SINCE_1_0.0 * @param[in] filename The disabled button image. */ - void SetDisabledImage( const std::string& filename ); + void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.32 Use styling file + * Use Property::DISABLED_SELECTED_VISUAL * * @brief Sets the disabled selected button image. * * @SINCE_1_0.0 * @param[in] filename The disabled selected button image. */ - void SetDisabledSelectedImage( const std::string& filename ); + void SetDisabledSelectedImage( const std::string& filename ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_0.50. Instead, use SetLabelText. @@ -416,7 +599,7 @@ public: * @SINCE_1_0.0 * @param[in] label The actor to use as a label */ - void SetLabel( Actor label ); + void SetLabel( Actor label ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_0.50. Instead, use SetUnselectedImage. @@ -426,7 +609,7 @@ public: * @SINCE_1_0.0 * @param[in] image The button image. */ - void SetButtonImage( Image image ); + void SetButtonImage( Image image ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_0.50. Instead, use SetSelectedImage( const std::string& filename ). @@ -436,7 +619,7 @@ public: * @SINCE_1_0.0 * @param[in] image The selected image. */ - void SetSelectedImage( Image image ); + void SetSelectedImage( Image image ) DALI_DEPRECATED_API; /** * @DEPRECATED_1_0.50 @@ -447,7 +630,7 @@ public: * @remarks Avoid using this method as it's a legacy code. * @return An actor with the button image. */ - Actor GetButtonImage() const; + Actor GetButtonImage() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_0.50 @@ -458,7 +641,7 @@ public: * @remarks Avoid using this method as it's a legacy code. * @return An actor with the selected image. */ - Actor GetSelectedImage() const; + Actor GetSelectedImage() const DALI_DEPRECATED_API; public: //Signals @@ -520,6 +703,7 @@ public: //Signals public: // Not intended for application developers + /// @cond internal /** * @brief Creates a handle using the Toolkit::Internal implementation. * @@ -535,6 +719,7 @@ public: // Not intended for application developers * @param[in] internal A pointer to the internal CustomActor. */ DALI_INTERNAL Button( Dali::Internal::CustomActor* internal ); + /// @endcond }; /**