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%2Fpush-button.h;h=c887574a298a247fc9a5c67dcee78fa9449eb801;hp=0b4fa5fbf2e6883faf76c9891f2a3a21a45dfdfb;hb=615572d21ca43c37388d9de980a8d1265e8c21fd;hpb=d04c5bdbb95cc98f90848c7a98b0b2804df6e5b8;ds=sidebyside
diff --git a/dali-toolkit/public-api/controls/buttons/push-button.h b/dali-toolkit/public-api/controls/buttons/push-button.h
index 0b4fa5f..c887574 100644
--- a/dali-toolkit/public-api/controls/buttons/push-button.h
+++ b/dali-toolkit/public-api/controls/buttons/push-button.h
@@ -2,7 +2,7 @@
#define __DALI_TOOLKIT_PUSH_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.
@@ -35,6 +35,10 @@ namespace Internal DALI_INTERNAL
class PushButton;
}
+/**
+ * @addtogroup dali_toolkit_controls_buttons
+ * @{
+ */
/**
* @brief A PushButton changes its appearance when is pressed and returns to its original when is released.
@@ -42,44 +46,39 @@ class PushButton;
* By default a PushButton emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when it's clicked
* and a Button::ReleasedSignal() signal when it's released or having pressed it, the touch point leaves the boundary of the button.
*
- * PushButton provides the following properties which modify signals emitted:
- *
- * - \e autorepeating
- *
- * When \e autorepeating is set to \e true, a Button::PressedSignal(), Button::ReleasedSignal() and Button::ClickedSignal() signals are emitted at regular
- * intervals while the button is touched.
- *
- * The intervals could be modified with the PushButton::SetInitialAutoRepeatingDelay and PushButton::SetNextAutoRepeatingDelay methods.
- *
- * A \e togglable button can't be \e autorepeating. If the \e autorepeating property is set to \e true, then the \e togglable property is set to
- * false but no signal is emitted.
- *
- *
- \e togglable
- *
- * When \e togglable is set to \e true, a Button::StateChangedSignal() signal is emitted, with the selected state, every time the button is touched instead
- * of emit Button::PressedSignal(), Button::ClickedSignal() and Button::ReleasedSignal() signals.
- *
- * An \e autorepeating button can't be \e togglable. If the \e togglable property is set to \e true, then the \e autorepeating property is set to false.
- *
- *
- * The button's appearance could be modified by setting images or actors with PushButton::SetButtonImage, PushButton::SetBackgroundImage,
- * PushButton::SetSelectedImage, PushButton::SetDisabledBackgroundImage and PushButton::SetDisabledImage or setting a text with
- * PushButton::SetLabel.
- *
- * 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.
- *
- * The methods used to modify the button's appearance could receive Dali::Actor objects as a parameter, so more complex images could be defined.
- *
- * 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.
+ * See Button for more detail on signals and modifying appearance via properties.
*/
class DALI_IMPORT_API PushButton : public Button
{
public:
/**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Button::PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the PushButton class.
+ */
+ struct Property
+ {
+ enum
+ {
+ UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselected-icon", type std::string
+ SELECTED_ICON, ///< Property, name "selected-icon", type std::string
+ ICON_ALIGNMENT, ///< Property, name "icon-alignment", type std::string
+ LABEL_PADDING, ///< Property, name "label-padding", type Vector4
+ ICON_PADDING, ///< Property, name "icon-padding", type Vector4
+ };
+ };
+
+public:
+
+ /**
* @brief Create an uninitialized PushButton; this can be initialized with PushButton::New().
*
* Calling member functions with an uninitialized Dali::Object is not allowed.
@@ -121,129 +120,86 @@ public:
*/
static PushButton DownCast( BaseHandle handle );
- /**
- * @brief Sets the button image.
- *
- * @param[in] image The button image.
- */
- void SetButtonImage( Image image );
+
+ // Deprecated API
+
+ using Button::SetButtonImage;
/**
- * @brief SetButtonImage
+ * @deprecated DALi 1.0.50
*
- * @param[in] image The Actor to be used as the button image.
+ * @brief Sets the unselected image with an Actor.
*
- * The natural size of the button would be the size of this Actor
- * if it's larger than the background and label
+ * @param[in] image The Actor to use.
*/
void SetButtonImage( Actor image );
- /**
- * @brief Gets the button image.
- *
- * @return An actor with the button image.
- */
- Actor GetButtonImage() const;
-
- /**
- * @brief Sets the background image.
- *
- * @param[in] image The background image.
- */
- void SetBackgroundImage( Image image );
+ using Button::SetBackgroundImage;
/**
- * @brief SetBackgroundImage
+ * @deprecated DALi 1.0.50
*
- * @param[in] image The Actor to be used as the background image.
+ * @brief Sets the background image with an Actor.
*
- * The natural size of the button would be the size of this Actor
- * if it's larger than the button and label
+ * @param[in] image The Actor to use.
*/
void SetBackgroundImage( Actor image );
- /**
- * @brief Gets the background image.
- *
- * @return An actor with the background image.
- */
- Actor GetBackgroundImage() const;
+ using Button::SetSelectedImage;
/**
- * @brief Sets the selected image.
+ * @deprecated DALi 1.0.50
*
- * @param[in] image The selected image.
- */
- void SetSelectedImage( Image image );
-
- /**
- * @copydoc SetSelectedImage( Image image )
+ * @brief Sets the selected image with an Actor.
+ *
+ * @param[in] image The Actor to use.
*/
void SetSelectedImage( Actor image );
- /**
- * @brief Gets the selected image.
- *
- * @return An actor with the selected image.
- */
- Actor GetSelectedImage() const;
+ using Button::SetSelectedBackgroundImage;
/**
- * @brief Sets the selected background image.
+ * @deprecated DALi 1.0.50
*
- * @param[in] image The selected background image.
- */
- void SetSelectedBackgroundImage( Image image );
-
- /**
- * @copydoc SetSelectedBackgroundImage( Image image )
+ * @brief Sets the selected background image with an Actor.
+ *
+ * @param[in] image The Actor to use.
*/
void SetSelectedBackgroundImage( Actor image );
- /**
- * @brief Gets the selected background image.
- *
- * @return An actor with the selected background image.
- */
- Actor GetSelectedBackgroundImage() const;
+ using Button::SetDisabledBackgroundImage;
/**
- * @brief Sets the disabled background image.
+ * @deprecated DALi 1.0.50
*
- * @param[in] image The disabled background image.
- */
- void SetDisabledBackgroundImage( Image image );
-
- /**
- * @copydoc SetDisabledBackgroundImage( Image image )
+ * @brief Sets the disabled background image with an Actor.
+ *
+ * @param[in] image The Actor to use.
*/
void SetDisabledBackgroundImage( Actor image );
- /**
- * @brief Gets the disabled background image.
- *
- * @return An actor with the disabled background image.
- */
- Actor GetDisabledBackgroundImage() const;
+ using Button::SetDisabledImage;
/**
- * @brief Sets the disabled button image.
+ * @deprecated DALi 1.0.50
*
- * @param[in] image The disabled button image.
- */
- void SetDisabledImage( Image image );
-
- /**
- * @copydoc SetDisabledImage( Image image )
+ * @brief Sets the disabled image with an Actor.
+ *
+ * @param[in] image The Actor to use.
*/
void SetDisabledImage( Actor image );
+ using Button::SetDisabledSelectedImage;
+
/**
- * @brief Gets the disabled image.
+ * @deprecated DALi 1.0.50
*
- * @return An actor with the disabled image.
+ * @brief Sets the disabled selected image with an Actor.
+ *
+ * @param[in] image The Actor to use.
*/
- Actor GetDisabledImage() const;
+ void SetDisabledSelectedImage( Actor image );
+
public: // Not intended for application developers
@@ -262,6 +218,9 @@ public: // Not intended for application developers
DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
};
+/**
+ * @}
+ */
} // namespace Toolkit
} // namespace Dali