Add descriptions and example codes
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / push-button.h
index c887574..603601d 100644 (file)
@@ -46,7 +46,44 @@ 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.
  *
  * 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.
  *
+ * Usage example: -
+ *
+ * @code
+ * // in Creating a DALi Application
+ * void HelloWorldExample::Create( Application& application )
+ * {
+ *   PushButton button = PushButton::New();
+ *   button.SetParentOrigin( ParentOrigin::CENTER );
+ *   button.SetLabelText( "Press" );
+ *   Stage::GetCurrent().Add( button );
+ *
+ *   // Connect to button signals emitted by the button
+ *   button.ClickedSignal().Connect( this, &HelloWorldExample::OnButtonClicked );
+ *   button.PressedSignal().Connect( this, &HelloWorldExample::OnButtonPressed );
+ *   button.ReleasedSignal().Connect( this, &HelloWorldExample::OnButtonReleased );
+ * }
+ *
+ * bool HelloWorldExample::OnButtonClicked( Button button )
+ * {
+ *   // Do something when the button is clicked
+ *   return true;
+ * }
+ *
+ * bool HelloWorldExample::OnButtonPressed( Button button )
+ * {
+ *   // Do something when the button is pressed
+ *   return true;
+ * }
+ *
+ * bool HelloWorldExample::OnButtonReleased( Button button )
+ * {
+ *   // Do something when the button is released
+ *   return true;
+ * }
+ * @endcode
+ *
  * See Button for more detail on signals and modifying appearance via properties.
  * See Button for more detail on signals and modifying appearance via properties.
+ * @SINCE_1_0.0
  */
 class DALI_IMPORT_API PushButton : public Button
 {
  */
 class DALI_IMPORT_API PushButton : public Button
 {
@@ -54,25 +91,27 @@ public:
 
   /**
    * @brief The start and end property ranges for this control.
 
   /**
    * @brief The start and end property ranges for this control.
+   * @SINCE_1_0.0
    */
   enum PropertyRange
   {
    */
   enum PropertyRange
   {
-    PROPERTY_START_INDEX = Button::PROPERTY_END_INDEX + 1,
-    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserving 1000 property indices
+    PROPERTY_START_INDEX = Button::PROPERTY_END_INDEX + 1,          ///< @SINCE_1_0.0
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserving 1000 property indices @SINCE_1_0.0
   };
 
   /**
    * @brief An enumeration of properties belonging to the PushButton class.
   };
 
   /**
    * @brief An enumeration of properties belonging to the PushButton class.
+   * @SINCE_1_0.0
    */
   struct Property
   {
     enum
     {
    */
   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
+      UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselectedIcon",  type std::string @SINCE_1_0.0
+      SELECTED_ICON,                          ///< Property, name "selectedIcon",    type std::string @SINCE_1_0.0
+      ICON_ALIGNMENT,                         ///< Property, name "iconAlignment",   type std::string @SINCE_1_0.0
+      LABEL_PADDING,                          ///< Property, name "labelPadding",    type Vector4 @SINCE_1_0.0
+      ICON_PADDING,                           ///< Property, name "iconPadding",     type Vector4 @SINCE_1_0.0
     };
   };
 
     };
   };
 
@@ -82,16 +121,19 @@ public:
    * @brief Create an uninitialized PushButton; this can be initialized with PushButton::New().
    *
    * Calling member functions with an uninitialized Dali::Object is not allowed.
    * @brief Create an uninitialized PushButton; this can be initialized with PushButton::New().
    *
    * Calling member functions with an uninitialized Dali::Object is not allowed.
+   * @SINCE_1_0.0
    */
   PushButton();
 
   /**
    * @brief Copy constructor.
    */
   PushButton();
 
   /**
    * @brief Copy constructor.
+   * @SINCE_1_0.0
    */
   PushButton( const PushButton& pushButton );
 
   /**
    * @brief Assignment operator.
    */
   PushButton( const PushButton& pushButton );
 
   /**
    * @brief Assignment operator.
+   * @SINCE_1_0.0
    */
   PushButton& operator=( const PushButton& pushButton );
 
    */
   PushButton& operator=( const PushButton& pushButton );
 
@@ -99,22 +141,25 @@ public:
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   * @SINCE_1_0.0
    */
   ~PushButton();
 
   /**
    * @brief Create an initialized PushButton.
    *
    */
   ~PushButton();
 
   /**
    * @brief Create an initialized PushButton.
    *
+   * @SINCE_1_0.0
    * @return A handle to a newly allocated Dali resource.
    */
   static PushButton New();
 
   /**
    * @return A handle to a newly allocated Dali resource.
    */
   static PushButton New();
 
   /**
-   * @brief Downcast an Object handle to PushButton.
+   * @brief Downcast a handle to PushButton handle.
    *
    * If handle points to a PushButton the downcast produces valid
    * handle. If not the returned handle is left uninitialized.
    *
    *
    * If handle points to a PushButton 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 PushButton or an uninitialized handle
    */
    * @param[in] handle Handle to an object
    * @return handle to a PushButton or an uninitialized handle
    */
@@ -126,10 +171,11 @@ public:
   using Button::SetButtonImage;
 
   /**
   using Button::SetButtonImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetUnselectedImage.
    *
    * @brief Sets the unselected image with an Actor.
    *
    *
    * @brief Sets the unselected image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetButtonImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetButtonImage( Actor image );
@@ -137,10 +183,11 @@ public:
   using Button::SetBackgroundImage;
 
   /**
   using Button::SetBackgroundImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetBackgroundImage.
    *
    * @brief Sets the background image with an Actor.
    *
    *
    * @brief Sets the background image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetBackgroundImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetBackgroundImage( Actor image );
@@ -148,10 +195,11 @@ public:
   using Button::SetSelectedImage;
 
   /**
   using Button::SetSelectedImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetSelectedImage( const std::string& filename ).
    *
    * @brief Sets the selected image with an Actor.
    *
    *
    * @brief Sets the selected image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetSelectedImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetSelectedImage( Actor image );
@@ -159,10 +207,11 @@ public:
   using Button::SetSelectedBackgroundImage;
 
   /**
   using Button::SetSelectedBackgroundImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetSelectedBackgroundImage.
    *
    * @brief Sets the selected background image with an Actor.
    *
    *
    * @brief Sets the selected background image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetSelectedBackgroundImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetSelectedBackgroundImage( Actor image );
@@ -170,10 +219,11 @@ public:
   using Button::SetDisabledBackgroundImage;
 
   /**
   using Button::SetDisabledBackgroundImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledBackgroundImage.
    *
    * @brief Sets the disabled background image with an Actor.
    *
    *
    * @brief Sets the disabled background image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetDisabledBackgroundImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetDisabledBackgroundImage( Actor image );
@@ -181,10 +231,11 @@ public:
   using Button::SetDisabledImage;
 
   /**
   using Button::SetDisabledImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledImage.
    *
    * @brief Sets the disabled image with an Actor.
    *
    *
    * @brief Sets the disabled image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetDisabledImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetDisabledImage( Actor image );
@@ -192,10 +243,11 @@ public:
   using Button::SetDisabledSelectedImage;
 
   /**
   using Button::SetDisabledSelectedImage;
 
   /**
-   * @deprecated DALi 1.0.50
+   * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledSelectedImage.
    *
    * @brief Sets the disabled selected image with an Actor.
    *
    *
    * @brief Sets the disabled selected image with an Actor.
    *
+   * @SINCE_1_0.0
    * @param[in] image The Actor to use.
    */
   void SetDisabledSelectedImage( Actor image );
    * @param[in] image The Actor to use.
    */
   void SetDisabledSelectedImage( Actor image );
@@ -203,9 +255,11 @@ public:
 
 public: // Not intended for application developers
 
 
 public: // Not intended for application developers
 
+  /// @cond internal
   /**
    * @brief Creates a handle using the Toolkit::Internal implementation.
    *
   /**
    * @brief Creates a handle using the Toolkit::Internal implementation.
    *
+   * @SINCE_1_0.0
    * @param[in]  implementation  The Control implementation.
    */
   DALI_INTERNAL PushButton( Internal::PushButton& implementation );
    * @param[in]  implementation  The Control implementation.
    */
   DALI_INTERNAL PushButton( Internal::PushButton& implementation );
@@ -213,9 +267,11 @@ public: // Not intended for application developers
   /**
    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
    *
   /**
    * @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 PushButton( Dali::Internal::CustomActor* internal );
    * @param[in]  internal  A pointer to the internal CustomActor.
    */
   DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
+  /// @endcond
 };
 
 /**
 };
 
 /**