Rearrange doxygen tags for recently deprecated or new APIs
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / push-button.h
index 09c480c..c887574 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PUSH_BUTTON_H__
 
 /*
 #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.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,56 +35,46 @@ namespace Internal DALI_INTERNAL
 
 class PushButton;
 }
 
 class PushButton;
 }
+/**
+ * @addtogroup dali_toolkit_controls_buttons
+ * @{
+ */
 
 /**
  * @brief A PushButton changes its appearance when is pressed and returns to its original when is released.
  *
 
 /**
  * @brief A PushButton changes its appearance when is pressed and returns to its original when is released.
  *
- * By default a PushButton emits a PushButton::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when it's clicked
- * and a PushButton::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:
- * <ul>
- *   <li>\e autorepeating
- *
- *       When \e autorepeating is set to \e true, a PushButton::PressedSignal(), PushButton::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 toggle button can't be \e autorepeating. If the \e autorepeating property is set to \e true, then the \e toggled property is set to
- *       false but no signal is emitted.
- *
- *   <li>\e toggle
- *
- *       When \e toggle is set to \e true, a Button::StateChangedSignal() signal is emitted, with the toggle state, every time the button is touched instead
- *       of emit PushButton::PressedSignal(), Button::ClickedSignal() and PushButton::ReleasedSignal() signals.
- *
- *       An \e autorepeating button can't be \e toggle. If the \e toggled property is set to \e true, then the \e autorepeating property is set to false.
- * </ul>
- *
- * 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.
+ * 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.
  *
  *
- * 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:
 
  */
 class DALI_IMPORT_API PushButton : public Button
 {
 public:
 
-  //Signal Names
-  static const char* const SIGNAL_PRESSED; ///< name "pressed"
-  static const char* const SIGNAL_RELEASED; ///< name "released"
+  /**
+   * @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
+  };
 
 
-  //Action Names
-  static const char* const ACTION_PUSH_BUTTON_CLICK; ///< name "push-button-click"
+  /**
+   * @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:
 
 
 public:
 
@@ -130,212 +120,86 @@ public:
    */
   static PushButton DownCast( BaseHandle handle );
 
    */
   static PushButton DownCast( BaseHandle handle );
 
-  /**
-   * @brief Sets the \e autorepeating property.
-   *
-   * If the \e autorepeating property is set to \e true, then the \e toggled property is set to false
-   * but no signal is emitted.
-   *
-   * @param[in] autoRepeating \e autorepeating property.
-   */
-  void SetAutoRepeating( bool autoRepeating );
 
 
-  /**
-   * @return \e true if the \e autorepeating property is set.
-   */
-  bool IsAutoRepeating() const;
+  // Deprecated API
 
 
-  /**
-   * @brief Sets the initial autorepeating delay.
-   *
-   * By default this value is set to 0.15 seconds.
-   *
-   * @pre initialAutoRepeatingDelay must be greater than zero.
-   * @param[in] initialAutoRepeatingDelay in seconds.
-   */
-  void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay );
-
-  /**
-   * @return the initial autorepeating delay in seconds.
-   */
-  float GetInitialAutoRepeatingDelay() const;
-
-  /**
-   * @brief Sets the next autorepeating delay.
-   *
-   * By default this value is set to 0.05 seconds.
-   *
-   * @pre nextAutoRepeatingDelay must be greater than zero.
-   * @param[in] nextAutoRepeatingDelay in seconds.
-   */
-  void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay );
-
-  /**
-   * @return the next autorepeating delay in seconds.
-   */
-  float GetNextAutoRepeatingDelay() const;
+  using Button::SetButtonImage;
 
   /**
 
   /**
-   * @brief Sets the \e toggled property.
+   * @deprecated DALi 1.0.50
    *
    *
-   * If the \e toggled property is set to \e true, then the \e autorepeating property is set to false.
+   * @brief Sets the unselected image with an Actor.
    *
    *
-   * @param[in] toggle property.
+   * @param[in] image The Actor to use.
    */
    */
-  void SetToggleButton( bool toggle );
+  void SetButtonImage( Actor image );
 
 
-  /**
-   * @return \e true if the \e toggled property is set.
-   */
-  bool IsToggleButton() const;
+  using Button::SetBackgroundImage;
 
   /**
 
   /**
-   * @brief Sets the button as toggled or not toggled.
-   *
-   * \e toggled property must be set to \e true.
-   *
-   * Emits a Button::StateChangedSignal() signal.
+   * @deprecated DALi 1.0.50
    *
    *
-   * @param[in] toggle state.
-   */
-  void SetToggled( bool toggle );
-
-  /**
-   * @return \e true if the \e toggled property is set and the button is toggled.
-   */
-  bool IsToggled() const;
-
-  /**
-   * @brief Sets the button image.
+   * @brief Sets the background image with an Actor.
    *
    *
-   * @param[in] image The button image.
+   * @param[in] image The Actor to use.
    */
    */
-  void SetButtonImage( Image image );
+  void SetBackgroundImage( Actor image );
 
 
-  /**
-   * @copydoc SetButtonImage( Image image )
-   */
-  void SetButtonImage( Actor image );
+  using Button::SetSelectedImage;
 
   /**
 
   /**
-   * @brief Gets the button image.
+   * @deprecated DALi 1.0.50
    *
    *
-   * @return An actor with the button image.
-   */
-  Actor GetButtonImage() const;
-
-  /**
-   * @brief Sets the background image.
+   * @brief Sets the selected image with an Actor.
    *
    *
-   * @param[in] image The background image.
+   * @param[in] image The Actor to use.
    */
    */
-  void SetBackgroundImage( Image image );
+  void SetSelectedImage( Actor image );
 
 
-  /**
-   * @copydoc SetBackgroundImage( Image image )
-   */
-  void SetBackgroundImage( Actor image );
+  using Button::SetSelectedBackgroundImage;
 
   /**
 
   /**
-   * @brief Gets the background image.
+   * @deprecated DALi 1.0.50
    *
    *
-   * @return An actor with the background image.
-   */
-  Actor GetBackgroundImage() const;
-
-  /**
-   * @brief Sets the selected image.
+   * @brief Sets the selected background image with an Actor.
    *
    *
-   * @param[in] image The selected image.
+   * @param[in] image The Actor to use.
    */
    */
-  void SetSelectedImage( Image image );
+  void SetSelectedBackgroundImage( Actor image );
 
 
-  /**
-   * @copydoc SetSelectedImage( Image image )
-   */
-  void SetSelectedImage( Actor image );
+  using Button::SetDisabledBackgroundImage;
 
   /**
 
   /**
-   * @brief Gets the selected image.
+   * @deprecated DALi 1.0.50
    *
    *
-   * @return An actor with the selected image.
-   */
-  Actor GetSelectedImage() const;
-
-  /**
-   * @brief Sets the disabled background image.
+   * @brief Sets the disabled background image with an Actor.
    *
    *
-   * @param[in] image The disabled background image.
-   */
-  void SetDisabledBackgroundImage( Image image );
-
-  /**
-   * @copydoc SetDisabledBackgroundImage( Image image )
+   * @param[in] image The Actor to use.
    */
   void SetDisabledBackgroundImage( Actor image );
 
    */
   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 );
 
    */
   void SetDisabledImage( Actor image );
 
-  /**
-   * @brief Gets the disabled image.
-   *
-   * @return An actor with the disabled image.
-   */
-  Actor GetDisabledImage() const;
+  using Button::SetDisabledSelectedImage;
 
   /**
 
   /**
-   * @brief Sets the button label.
+   * @deprecated DALi 1.0.50
    *
    *
-   * @param[in] label The button label.
-   */
-  void SetLabel( const std::string& label );
-
-  /**
-   * @copydoc SetLabel( const std::string& label )
-   */
-  void SetLabel( Actor label );
-
-  /**
-   * @brief Gets the label.
+   * @brief Sets the disabled selected image with an Actor.
    *
    *
-   * @return An actor with the label.
-   */
-  Actor GetLabel() const;
-
-public: //Signals
-
-  /// @brief PushButton Pressed signal type.
-  typedef Signal< bool ( Button ) > PressedSignalType;
-
-  /// @brief PushButton Released signal type.
-  typedef Signal< bool ( Button ) > ReleasedSignalType;
-
-  /**
-   * @brief Signal emitted when the button is touched.
+   * @param[in] image The Actor to use.
    */
    */
-  PressedSignalType& PressedSignal();
+  void SetDisabledSelectedImage( Actor image );
 
 
-  /**
-   * @brief Signal emitted when the button is touched and the touch point leaves the boundary of the button.
-   */
-  ReleasedSignalType& ReleasedSignal();
 
 public: // Not intended for application developers
 
 
 public: // Not intended for application developers
 
@@ -354,6 +218,9 @@ public: // Not intended for application developers
   DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
 };
 
   DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
 };
 
+/**
+ * @}
+ */
 } // namespace Toolkit
 
 } // namespace Dali
 } // namespace Toolkit
 
 } // namespace Dali