[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / push-button.h
index 66dcab4..f761a21 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_PUSH_BUTTON_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 // Forward declarations
 
 namespace Internal DALI_INTERNAL
@@ -34,7 +32,7 @@ namespace Internal DALI_INTERNAL
 // Forward declarations
 
 class PushButton;
-}
+} // namespace DALI_INTERNAL
 /**
  * @addtogroup dali_toolkit_controls_buttons
  * @{
@@ -53,7 +51,7 @@ class PushButton;
  * void HelloWorldExample::Create( Application& application )
  * {
  *   PushButton button = PushButton::New();
- *   button.SetParentOrigin( ParentOrigin::CENTER );
+ *   button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
  *   button.SetProperty( Button::Property::LABEL, "Press" );
  *   Stage::GetCurrent().Add( button );
  *
@@ -88,15 +86,14 @@ class PushButton;
 class DALI_TOOLKIT_API PushButton : public Button
 {
 public:
-
   /**
    * @brief Enumeration for the start and end property ranges for this control.
    * @SINCE_1_0.0
    */
   enum PropertyRange
   {
-    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
+    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
   };
 
   /**
@@ -111,16 +108,12 @@ public:
      */
     enum
     {
-      UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselectedIcon",  type std::string @SINCE_1_0.0 @DEPRECATED_1_2.XX Button::Property::UNSELECTED_VISUAL
-      SELECTED_ICON,                          ///< Property, name "selectedIcon",    type std::string @SINCE_1_0.0 @DEPRECATED_1_2.XX Button::Property::SELECTED_VISUAL
-      ICON_ALIGNMENT,                         ///< Property, name "iconAlignment",   type std::string @SINCE_1_0.0 @DEPRECATED_1_2.XX Use Button::Property::LABEL_RELATIVE_ALIGNMENT
-      LABEL_PADDING,                          ///< Property, name "labelPadding",    type Vector4 @SINCE_1_0.0
-      ICON_PADDING,                           ///< Property, name "iconPadding",     type Vector4 @SINCE_1_0.0
+      LABEL_PADDING = PROPERTY_START_INDEX, ///< Property, name "labelPadding",    type Vector4 @SINCE_1_0.0
+      ICON_PADDING,                         ///< Property, name "iconPadding",     type Vector4 @SINCE_1_0.0
     };
   };
 
 public:
-
   /**
    * @brief Creates an uninitialized PushButton; this can be initialized with PushButton::New().
    *
@@ -134,7 +127,15 @@ public:
    * @SINCE_1_0.0
    * @param[in] pushButton Handle to an object
    */
-  PushButton( const PushButton& pushButton );
+  PushButton(const PushButton& pushButton);
+
+  /**
+   * @brief Move constructor
+   * @SINCE_1_9.23
+   *
+   * @param[in] rhs A reference to the moved handle
+   */
+  PushButton(PushButton&& rhs) noexcept;
 
   /**
    * @brief Assignment operator.
@@ -142,7 +143,16 @@ public:
    * @param[in] pushButton Handle to an object
    * @return A reference to this
    */
-  PushButton& operator=( const PushButton& pushButton );
+  PushButton& operator=(const PushButton& pushButton);
+
+  /**
+   * @brief Move assignment
+   * @SINCE_1_9.23
+   *
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  PushButton& operator=(PushButton&& rhs) noexcept;
 
   /**
    * @brief Destructor.
@@ -170,98 +180,9 @@ public:
    * @param[in] handle Handle to an object
    * @return handle to a PushButton or an uninitialized handle
    */
-  static PushButton DownCast( BaseHandle handle );
-
-  ///////////////////////////////////////////////////////////////////////////
-  // Deprecated API
-
-  using Button::SetButtonImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetUnselectedImage.
-   *
-   * @brief Sets the unselected image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetButtonImage( Actor image ) DALI_DEPRECATED_API;
-
-  using Button::SetBackgroundImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetBackgroundImage.
-   *
-   * @brief Sets the background image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetBackgroundImage( Actor image ) DALI_DEPRECATED_API;
-
-  using Button::SetSelectedImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetSelectedImage( const std::string& filename ).
-   *
-   * @brief Sets the selected image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetSelectedImage( Actor image ) DALI_DEPRECATED_API;
-
-  using Button::SetSelectedBackgroundImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetSelectedBackgroundImage.
-   *
-   * @brief Sets the selected background image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetSelectedBackgroundImage( Actor image ) DALI_DEPRECATED_API;
-
-  using Button::SetDisabledBackgroundImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledBackgroundImage.
-   *
-   * @brief Sets the disabled background image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetDisabledBackgroundImage( Actor image ) DALI_DEPRECATED_API;
-
-  using Button::SetDisabledImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledImage.
-   *
-   * @brief Sets the disabled image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetDisabledImage( Actor image ) DALI_DEPRECATED_API;
-
-  using Button::SetDisabledSelectedImage;
-
-  /**
-   * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledSelectedImage.
-   *
-   * @brief Sets the disabled selected image with an Actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Actor to use
-   */
-  void SetDisabledSelectedImage( Actor image ) DALI_DEPRECATED_API;
-
+  static PushButton DownCast(BaseHandle handle);
 
 public: // Not intended for application developers
-
   /// @cond internal
   /**
    * @brief Creates a handle using the Toolkit::Internal implementation.
@@ -269,7 +190,7 @@ public: // Not intended for application developers
    * @SINCE_1_0.0
    * @param[in] implementation The Control implementation
    */
-  DALI_INTERNAL PushButton( Internal::PushButton& implementation );
+  DALI_INTERNAL PushButton(Internal::PushButton& implementation);
 
   /**
    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
@@ -277,7 +198,7 @@ public: // Not intended for application developers
    * @SINCE_1_0.0
    * @param[in] internal A pointer to the internal CustomActor
    */
-  DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
+  DALI_INTERNAL PushButton(Dali::Internal::CustomActor* internal);
   /// @endcond
 };