// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
-namespace Dali DALI_IMPORT_API
+namespace Dali
{
-namespace Internal DALI_INTERNAL
-{
-class CustomActor;
-}
-
namespace Toolkit
{
/**
* @brief Button is a base class for different kind of buttons.
*
- * This class provides the dimmed property and the clicked signal.
+ * 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.
*
- * When the \e dimmed property is set to \e true, no signal is emitted.
+ * When the \e disabled property is set to \e true, no signal is emitted.
*/
-class Button : public Control
+class DALI_IMPORT_API Button : public Control
{
public:
// Signal Names
- static const char* const SIGNAL_CLICKED; ///< name "clicked"
+ static const char* const SIGNAL_CLICKED; ///< name "clicked"
+ static const char* const SIGNAL_STATE_CHANGED; ///< name "state-changed"
// Properties
- static const Property::Index PROPERTY_DIMMED; ///< name "dimmed", @see SetDimmed(), type BOOLEAN
+ 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 SetToggleButton(), type BOOLEAN
+ static const Property::Index PROPERTY_TOGGLED; ///< name "toggled", @see SetToggled(), type BOOLEAN
+ static const Property::Index PROPERTY_NORMAL_STATE_ACTOR; ///< name "button-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
public:
~Button();
/**
- * @brief Sets the button as \e dimmed.
+ * @brief Sets the button as \e disabled.
*
- * No signals are emitted when the \e dimmed property is set.
+ * No signals are emitted when the \e disabled property is set.
*
- * @param[in] dimmed property.
+ * @param[in] disabled property.
*/
- void SetDimmed( bool dimmed );
+ void SetDisabled( bool disabled );
/**
- * @return \e true if the button is \e dimmed.
+ * @return \e true if the button is \e disabled.
*/
- bool IsDimmed() const;
+ bool IsDisabled() const;
/**
* @brief Sets the animation time.
/**
* @brief Button Clicked signal type
*/
- typedef SignalV2< bool ( Button ) > ClickedSignalV2;
+ typedef Signal< bool ( Button ) > ClickedSignalType;
+
+ /**
+ * @brief Button state changed signal type
+ */
+ typedef Signal< bool ( Button, bool ) > StateChangedSignalType;
/**
* @brief Signal emitted when the button is touched and the touch point doesn't leave the boundary of the button.
*/
- ClickedSignalV2& ClickedSignal();
+ ClickedSignalType& ClickedSignal();
+
+ /**
+ * @brief Signal emitted when the button's state is changed.
+ */
+ StateChangedSignalType& StateChangedSignal();
public: // Not intended for application developers
*
* @param[in] implementation The Control implementation.
*/
- Button( Internal::Button& implementation );
+ DALI_INTERNAL Button( Internal::Button& implementation );
/**
* @brief Allows the creation of this Control from an Internal::CustomActor pointer.
*
* @param[in] internal A pointer to the internal CustomActor.
*/
- Button( Dali::Internal::CustomActor* internal );
+ DALI_INTERNAL Button( Dali::Internal::CustomActor* internal );
};
} // namespace Toolkit