*
* 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.
+ * 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.
*
* Signals
* | %Signal Name | Method |
* | stateChanged | @ref StateChangedSignal() |
*
* Actions
- * | %Action Name | %Button method called |
- * |------------------|-----------------------------|
- * | buttonClick | %DoClickAction() |
+ * | %Action Name | Attributes | Description |
+ * |------------------|-------------------------|-----------------------------------------------|
+ * | buttonClick | Doesn't have attributes | Simulates a button click. See @ref DoAction() |
+ * @SINCE_1_0.0
*/
class DALI_IMPORT_API Button : public Control
{
/**
* @brief The start and end property ranges for this control.
+ * @SINCE_1_0.0
*/
enum PropertyRange
{
- PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_0.0
};
/**
* @brief An enumeration of properties belonging to the Button class.
+ * @SINCE_1_0.0
*/
struct Property
{
enum
{
- DISABLED = PROPERTY_START_INDEX, ///< name "disabled", @see SetDisabled(), type bool
- 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
- 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
+ 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
+ LABEL_TEXT, ///< name "labelText", @see SetLabelText(), type std::string @SINCE_1_0.0
};
};
*
* Only derived versions can be instantiated. Calling member
* functions with an uninitialized Dali::Object is not allowed.
+ * @SINCE_1_0.0
*/
Button();
/**
* @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 );
/**
- * @brief Downcast an Object handle to Button.
+ * @brief Downcast a handle to Button handle.
*
* If handle points to a Button the downcast produces valid
* handle. If not the returned handle is left uninitialized.
*
+ * @SINCE_1_0.0
* @param[in] handle Handle to an object
- * @return handle to a Button or an uninitialized handle
+ * @return A handle to a Button or an uninitialized handle
*/
static Button DownCast( BaseHandle handle );
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
+ * @SINCE_1_0.0
*/
~Button();
+ // Deprecated API
+
/**
+ * @DEPRECATED_1_1.32 Use SetProperty DISABLED or Styling file
+ *
* @brief Sets the button as \e disabled.
*
* No signals are emitted when the \e disabled property is set.
*
+ * @SINCE_1_0.0
* @param[in] disabled property.
*/
void SetDisabled( bool disabled );
/**
+ * @DEPRECATED_1_1.32 Use GetProperty DISABLED
+ *
+ * @brief Returns if the button is disabled.
+ * @SINCE_1_0.0
* @return \e true if the button is \e disabled.
*/
bool IsDisabled() const;
/**
+ * @DEPRECATED_1_1.32 SetProperty AUTO_REPEATING or Styling file
+ *
* @brief Sets the \e autorepeating property.
*
* If the \e autorepeating property is set to \e true, then the \e togglable property is set to false
* but no signal is emitted.
*
+ * @SINCE_1_0.0
* @param[in] autoRepeating \e autorepeating property.
*/
void SetAutoRepeating( bool autoRepeating );
/**
+ * @DEPRECATED_1_1.32 GetProperty AUTO_REPEATING
+ *
+ * @brief Returns if the autorepeating property is set.
+ * @SINCE_1_0.0
* @return \e true if the \e autorepeating property is set.
*/
bool IsAutoRepeating() const;
/**
+ * @DEPRECATED_1_1.32 SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file
+ *
* @brief Sets the initial autorepeating delay.
*
* By default this value is set to 0.15 seconds.
*
- * @pre initialAutoRepeatingDelay must be greater than zero.
+ * @SINCE_1_0.0
* @param[in] initialAutoRepeatingDelay in seconds.
+ * @pre initialAutoRepeatingDelay must be greater than zero.
*/
void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay );
/**
+ * @DEPRECATED_1_1.32 GetProperty INITIAL_AUTO_REPEATING_DELAY
+ *
+ * @brief Gets the initial autorepeating delay in seconds.
+ * @SINCE_1_0.0
* @return the initial autorepeating delay in seconds.
*/
float GetInitialAutoRepeatingDelay() const;
/**
+ * @DEPRECATED_1_1.32 SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file
+ *
* @brief Sets the next autorepeating delay.
*
* By default this value is set to 0.05 seconds.
*
- * @pre nextAutoRepeatingDelay must be greater than zero.
+ * @SINCE_1_0.0
* @param[in] nextAutoRepeatingDelay in seconds.
+ * @pre nextAutoRepeatingDelay must be greater than zero.
*/
void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay );
/**
+ * @DEPRECATED_1_1.32 GetProperty NEXT_AUTO_REPEATING_DELAY
+ *
+ * @brief Gets the next autorepeating delay in seconds.
+ * @SINCE_1_0.0
* @return the next autorepeating delay in seconds.
*/
float GetNextAutoRepeatingDelay() const;
/**
+ * @DEPRECATED_1_1.32 SetProperty TOGGLABLE or Styling file
+ *
* @brief Sets the \e togglable property.
*
* If the \e togglable property is set to \e true, then the \e autorepeating property is set to false.
*
+ * @SINCE_1_0.0
* @param[in] togglable property.
*/
void SetTogglableButton( bool togglable );
/**
+ * @DEPRECATED_1_1.32 GetProperty TOGGLABLE
+ *
+ * @brief Returns if the togglable property is set.
+ * @SINCE_1_0.0
* @return \e true if the \e togglable property is set.
*/
bool IsTogglableButton() const;
/**
- * Sets the button as selected or unselected.
+ * @DEPRECATED_1_1.32 SetProperty SELECTED
+ *
+ * @brief Sets the button as selected or unselected.
*
* \e togglable property must be set to \e true.
*
* Emits a Button::StateChangedSignal() signal.
*
+ * @SINCE_1_0.0
* @param[in] selected property.
*/
void SetSelected( bool selected );
/**
- * @return \e true if the \e selected property is set and the button is togglable.
+ * DEPRECATED_1_1.32 SetProperty 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;
/**
+ * @DEPRECATED_1_1.32 Use Styling file to set animation
+ *
* @brief Sets the animation time.
*
+ * @SINCE_1_0.0
* @param[in] animationTime The animation time in seconds.
*/
void SetAnimationTime( float animationTime );
/**
+ * DEPRECATED_1_1.32 Use Styling file to set animation
+ *
* @brief Retrieves button's animation time.
*
+ * @SINCE_1_0.0
* @return The animation time in seconds.
*/
float GetAnimationTime() const;
/**
+ * @DEPRECATED_1_1.32 SetProperty 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 );
/**
+ * DEPRECATED_1_1.32 GetProperty LABEL
+ *
* @brief Gets the label.
*
+ * @SINCE_1_0.0
* @return The label text.
*/
std::string GetLabelText() const;
/**
+ * @DEPRECATED_1_1.32 Use Styling file
+ *
* @brief Sets the unselected button image.
*
+ * @SINCE_1_0.0
* @param[in] filename The button image.
*/
void SetUnselectedImage( const std::string& filename );
/**
+ * @DEPRECATED_1_1.32 Use styling
+ *
* @brief Sets the background image.
*
+ * @SINCE_1_0.0
* @param[in] filename The background image.
*/
void SetBackgroundImage( const std::string& filename );
/**
+ * @DEPRECATED_1_1.32 Use styling file
+ *
* @brief Sets the selected image.
*
+ * @SINCE_1_0.0
* @param[in] filename The selected image.
*/
void SetSelectedImage( const std::string& filename );
/**
+ * @DEPRECATED_1_1.32 Use styling file
+ *
* @brief Sets the selected background image.
*
+ * @SINCE_1_0.0
* @param[in] filename The selected background image.
*/
void SetSelectedBackgroundImage( const std::string& filename );
/**
+ * @DEPRECATED_1_1.32 Use styling file
+ *
* @brief Sets the disabled background image.
*
+ * @SINCE_1_0.0
* @param[in] filename The disabled background image.
*/
void SetDisabledBackgroundImage( const std::string& filename );
/**
+ * @DEPRECATED_1_1.32 Use styling file
+ *
* @brief Sets the disabled button image.
*
+ * @SINCE_1_0.0
* @param[in] filename The disabled button image.
*/
void SetDisabledImage( const std::string& filename );
/**
+ * @DEPRECATED_1_1.32 Use styling file
+ *
* @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 );
- // Deprecated API
-
/**
- * @deprecated DALi 1.0.50
+ * @DEPRECATED_1_0.50. Instead, use SetLabelText.
*
* @brief Sets the label with an actor.
*
+ * @SINCE_1_0.0
* @param[in] label The actor to use as a label
*/
void SetLabel( Actor label );
/**
- * @deprecated DALi 1.0.50
+ * @DEPRECATED_1_0.50. Instead, use SetUnselectedImage.
*
* @brief Sets the button image.
*
+ * @SINCE_1_0.0
* @param[in] image The button image.
*/
void SetButtonImage( Image image );
/**
- * @deprecated DALi 1.0.50
+ * @DEPRECATED_1_0.50. Instead, use SetSelectedImage( const std::string& filename ).
*
* @brief Sets the selected image.
*
+ * @SINCE_1_0.0
* @param[in] image The selected image.
*/
void SetSelectedImage( Image image );
/**
- * @deprecated DALi 1.0.50
+ * @DEPRECATED_1_0.50
*
* @brief Gets the button image.
*
+ * @SINCE_1_0.0
+ * @remarks Avoid using this method as it's a legacy code.
* @return An actor with the button image.
*/
Actor GetButtonImage() const;
/**
- * @deprecated DALi 1.0.50
+ * @DEPRECATED_1_0.50
*
* @brief Gets the selected image.
*
+ * @SINCE_1_0.0
+ * @remarks Avoid using this method as it's a legacy code.
* @return An actor with the selected image.
*/
Actor GetSelectedImage() const;
/**
* @brief Button signal type
+ * @SINCE_1_0.0
*/
typedef Signal< bool ( Button ) > ButtonSignalType;
* @code
* bool YourCallbackName( Button button );
* @endcode
+ * @SINCE_1_0.0
* @return The signal to connect to.
*/
ButtonSignalType& PressedSignal();
* @code
* bool YourCallbackName( Button button );
* @endcode
+ * @SINCE_1_0.0
* @return The signal to connect to.
*/
ButtonSignalType& ReleasedSignal();
* @code
* bool YourCallbackName( Button button );
* @endcode
+ * @SINCE_1_0.0
* @return The signal to connect to.
*/
ButtonSignalType& ClickedSignal();
/**
* @brief This signal is emitted when the button's state is changed.
+ *
* The application can get the state by calling IsSelected().
*
* A callback of the following type may be connected:
* @code
* bool YourCallbackName( Button button );
* @endcode
+ * @SINCE_1_0.0
* @return The signal to connect to.
*/
ButtonSignalType& StateChangedSignal();
public: // Not intended for application developers
+ /// @cond internal
/**
* @brief Creates a handle using the Toolkit::Internal implementation.
*
+ * @SINCE_1_0.0
* @param[in] implementation The Control implementation.
*/
DALI_INTERNAL Button( Internal::Button& implementation );
/**
* @brief Allows the creation of this Control from an Internal::CustomActor pointer.
*
+ * @SINCE_1_0.0
* @param[in] internal A pointer to the internal CustomActor.
*/
DALI_INTERNAL Button( Dali::Internal::CustomActor* internal );
+ /// @endcond
};
/**