Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / button.h
index 3b649d1..6bb9991 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_BUTTON_H__
-#define __DALI_TOOLKIT_BUTTON_H__
+#ifndef DALI_TOOLKIT_BUTTON_H
+#define DALI_TOOLKIT_BUTTON_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -61,45 +61,15 @@ class Button;
  *
  * 'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer.
  *
- * The button's appearance can be modified by setting properties for the various images.
+ * The button's appearance can be modified by setting properties for the various visuals/images.
  *
  * It is not mandatory to set all visuals. A button could be defined only by setting its \e background visual or by setting its \e background and \e selected visuals.
  *
- * The \e button visual is shown over the \e background visual..
+ * The \e button visual is shown over the \e background visual.
  * When pressed the unselected visuals are replaced by the \e selected visual. The text label is always placed on the top of all images.
  *
  * When the button is disabled, \e background, \e button and \e selected visuals are replaced by their \e disabled visuals.
  *
-
- *
-  * @brief A control which renders a short text string.
- *
- * Text labels are lightweight, non-editable and do not respond to user input.
- *
- *
- * @section ButtonProperties Properties
- * |%Property enum                                         |String name                             |Type          |Writable|Animatable|
- * |-------------------------------------------------------|----------------------------------------|--------------|--------|----------|
- * | Property::DISABLED                                    | disabled                               |  BOOLEAN     | Y      | N        |
- * | Property::AUTO_REPEATING                              | autoRepeating                          |  BOOLEAN     | Y      | N        |
- * | Property::INITIAL_AUTO_REPEATING_DELAY                | initialAutoRepeatingDelay              |  FLOAT       | Y      | N        |
- * | Property::NEXT_AUTO_REPEATING_DELAY                   | nextAutoRepeatingDelay                 |  FLOAT       | Y      | N        |
- * | Property::TOGGLABLE                                   | togglable                              |  BOOLEAN     | Y      | N        |
- * | Property::SELECTED                                    | selected                               |  BOOLEAN     | Y      | N        |
- * | Property::LABEL                                       | label                                  |  MAP         | Y      | N        |
- * | Property::UNSELECTED_STATE_VISUAL                     | unselectedVisual                       |  MAP         | Y      | N        |
- * | Property::SELECTED_VISUAL                             | selectedVisual                         |  MAP         | Y      | N        |
- * | Property::DISABLED_SELECTED_VISUAL                    | disabledSelectedVisual                 |  MAP         | Y      | N        |
- * | Property::DISABLED_UNSELECTED_VISUAL                  | disabledUnselectedVisual               |  MAP         | Y      | N        |
- * | Property::UNSELECTED_BACKGROUND_VISUAL                | unselectedBackgroundVisual             |  MAP         | Y      | N        |
- * | Property::SELECTED_BACKGROUND_VISUAL                  | selectedBackgroundVisual               |  MAP         | Y      | N        |
- * | Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL       | disabledUnselectedBackgroundVisual     |  MAP         | Y      | N        |
- * | Property::DISABLED_SELECTED_BACKGROUND_VISUAL         | disabledSelectedBackgroundVisual       |  MAP         | Y      | N        |
- * | Property::LABEL_STRUT_LENGTH                          | labelStrutLength                       |  INTEGER     | Y      | N        |
- * | Property::LABEL_RELATIVE_ALIGNMENT                    | labelRelativeAlignment                 |  STRING      | Y      | N        |
- * -------------------------------------------------------------------------------------------------------------------------------------
- *
- * Note, *_VISUAL properties of type MAP can also be passed a uri of type STRING
  *
  * Signals
  * | %Signal Name     | Method                      |
@@ -115,12 +85,12 @@ class Button;
  * | buttonClick      | Doesn't have attributes | Simulates a button click. See @ref DoAction() |
  * @SINCE_1_0.0
  */
-class DALI_IMPORT_API Button : public Control
+class DALI_TOOLKIT_API Button : public Control
 {
 public:
 
   /**
-   * @brief The start and end property ranges for this control.
+   * @brief Enumeration for the start and end property ranges for this control.
    * @SINCE_1_0.0
    */
   enum PropertyRange
@@ -130,13 +100,13 @@ public:
   };
 
   /**
-   * @brief An enumeration of properties belonging to the Button class.
+   * @brief Enumeration for the instance of properties belonging to the Button class.
    * @SINCE_1_0.0
    */
   struct Property
   {
     /**
-     * @brief An enumeration of properties belonging to the Button class.
+     * @brief Enumeration for the instance of properties belonging to the Button class.
      * @SINCE_1_0.0
      */
     enum
@@ -222,7 +192,7 @@ public:
       SELECTED_COLOR,
 
       /**
-       * @brief name "label", type Property::Map
+       * @brief name "label", type Property::Map or std::string
        * @SINCE_1_0.0
        */
       LABEL,
@@ -232,84 +202,14 @@ public:
        * @brief name "labelText", type std::string
        * @SINCE_1_0.0
        */
-      LABEL_TEXT,
-
-      /**
-       * @brief name "unselectedVisual", type string if it is a url, map otherwise
-       * @details Sets the unselected button foreground/icon visual
-       * @SINCE_1_2.XX
-       */
-      UNSELECTED_VISUAL,
-
-      /**
-       * @brief name "selectedImage", type string if it is a url, map otherwise
-       * @details Sets the selected button foreground/icon visual
-       * @SINCE_1_2.XX
-       */
-      SELECTED_VISUAL,
-
-      /**
-       * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise
-       * @details Sets the disabled selected state foreground/icon button visual
-       * @SINCE_1_2.XX
-       */
-      DISABLED_SELECTED_VISUAL,
-
-      /**
-       * @brief name "disabledUnSelectedVisual", type string if it is a url, map otherwise
-       * @details Sets the disabled unselected state foreground/icon visual
-       * @SINCE_1_2.XX
-       */
-      DISABLED_UNSELECTED_VISUAL,
-
-      /**
-       * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise
-       * @details Sets the disabled in the unselected state background, button visual
-       * @SINCE_1_2.XX
-       */
-      UNSELECTED_BACKGROUND_VISUAL,
-
-      /**
-       * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise
-       * @details Sets the selected background button visual
-       * @SINCE_1_2.XX
-       */
-      SELECTED_BACKGROUND_VISUAL,
-
-      /**
-       * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise
-       * @details Sets the disabled while unselected background button visual
-       * @SINCE_1_2.XX
-       */
-      DISABLED_UNSELECTED_BACKGROUND_VISUAL,
-
-      /**
-       * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise
-       * @details Sets the disabled while selected background button visual
-       * @SINCE_1_2.XX
-       */
-      DISABLED_SELECTED_BACKGROUND_VISUAL,
-
-      /**
-       * @brief name "labelStrutLength", type INTEGER
-       * @details Sets the distance between the label and foreground/icon visual if both present
-       * @SINCE_1_2.XX
-       */
-      LABEL_STRUT_LENGTH,  // todo ????? remove
-
-      /**
-       * @brief name "labelRelativeAlignment", type STRING
-       * @details Sets the position of the the label in relation to the foreground/icon if both present
-       * @SINCE_1_2.XX
-       */
-      LABEL_RELATIVE_ALIGNMENT,
+      LABEL_TEXT
     };
   };
 
 public:
 
   /**
-   * @brief Create an uninitialized Button.
+   * @brief Creates an uninitialized Button.
    *
    * Only derived versions can be instantiated.  Calling member
    * functions with an uninitialized Dali::Object is not allowed.
@@ -333,10 +233,10 @@ public:
   Button& operator=( const Button& button );
 
   /**
-   * @brief Downcast a handle to Button handle.
+   * @brief Downcasts a handle to Button handle.
    *
-   * If handle points to a Button the downcast produces valid
-   * handle. If not the returned handle is left uninitialized.
+   * If handle points to a Button, the downcast produces valid handle.
+   * If not the returned handle is left uninitialized.
    *
    * @SINCE_1_0.0
    * @param[in] handle Handle to an object
@@ -345,7 +245,7 @@ public:
   static Button DownCast( BaseHandle handle );
 
   /**
-   * @brief Destructor
+   * @brief Destructor.
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
    * @SINCE_1_0.0
@@ -362,7 +262,7 @@ public:
    * No signals are emitted when the \e disabled property is set.
    *
    * @SINCE_1_0.0
-   * @param[in] disabled property.
+   * @param[in] disabled Disabled property
    */
   void SetDisabled( bool disabled ) DALI_DEPRECATED_API;
 
@@ -371,7 +271,7 @@ public:
    *
    * @brief Returns if the button is disabled.
    * @SINCE_1_0.0
-   * @return \e true if the button is \e disabled.
+   * @return \e true if the button is \e disabled
    */
   bool IsDisabled() const DALI_DEPRECATED_API;
 
@@ -384,7 +284,7 @@ public:
    * but no signal is emitted.
    *
    * @SINCE_1_0.0
-   * @param[in] autoRepeating \e autorepeating property.
+   * @param[in] autoRepeating \e autorepeating property
    */
   void SetAutoRepeating( bool autoRepeating ) DALI_DEPRECATED_API;
 
@@ -393,7 +293,7 @@ public:
    *
    * @brief Returns if the autorepeating property is set.
    * @SINCE_1_0.0
-   * @return \e true if the \e autorepeating property is set.
+   * @return \e true if the \e autorepeating property is set
    */
   bool IsAutoRepeating() const DALI_DEPRECATED_API;
 
@@ -402,10 +302,10 @@ public:
    *
    * @brief Sets the initial autorepeating delay.
    *
-   * By default this value is set to 0.15 seconds.
+   * By default, this value is set to 0.15 seconds.
    *
    * @SINCE_1_0.0
-   * @param[in] initialAutoRepeatingDelay in seconds.
+   * @param[in] initialAutoRepeatingDelay in seconds
    * @pre initialAutoRepeatingDelay must be greater than zero.
    */
   void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) DALI_DEPRECATED_API;
@@ -415,7 +315,7 @@ public:
    *
    * @brief Gets the initial autorepeating delay in seconds.
    * @SINCE_1_0.0
-   * @return the initial autorepeating delay in seconds.
+   * @return The initial autorepeating delay in seconds
    */
   float GetInitialAutoRepeatingDelay() const DALI_DEPRECATED_API;
 
@@ -424,10 +324,10 @@ public:
    *
    * @brief Sets the next autorepeating delay.
    *
-   * By default this value is set to 0.05 seconds.
+   * By default, this value is set to 0.05 seconds.
    *
    * @SINCE_1_0.0
-   * @param[in] nextAutoRepeatingDelay in seconds.
+   * @param[in] nextAutoRepeatingDelay in seconds
    * @pre nextAutoRepeatingDelay must be greater than zero.
    */
   void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) DALI_DEPRECATED_API;
@@ -437,7 +337,7 @@ public:
    *
    * @brief Gets the next autorepeating delay in seconds.
    * @SINCE_1_0.0
-   * @return the next autorepeating delay in seconds.
+   * @return The next autorepeating delay in seconds
    */
   float GetNextAutoRepeatingDelay() const DALI_DEPRECATED_API;
 
@@ -449,7 +349,7 @@ public:
    * If the \e togglable property is set to \e true, then the \e autorepeating property is set to false.
    *
    * @SINCE_1_0.0
-   * @param[in] togglable property.
+   * @param[in] togglable Togglable property
    */
   void SetTogglableButton( bool togglable ) DALI_DEPRECATED_API;
 
@@ -458,7 +358,7 @@ public:
    *
    * @brief Returns if the togglable property is set.
    * @SINCE_1_0.0
-   * @return \e true if the \e togglable property is set.
+   * @return \e true if the \e togglable property is set
    */
   bool IsTogglableButton() const DALI_DEPRECATED_API;
 
@@ -472,7 +372,7 @@ public:
    * Emits a Button::StateChangedSignal() signal.
    *
    * @SINCE_1_0.0
-   * @param[in] selected property.
+   * @param[in] selected Selected property
    */
   void SetSelected( bool selected ) DALI_DEPRECATED_API;
 
@@ -481,7 +381,7 @@ public:
    *
    * @brief Returns if the selected property is set and the button is togglable.
    * @SINCE_1_0.0
-   * @return \e true if the button is \e selected.
+   * @return \e true if the button is \e selected
    */
   bool IsSelected() const DALI_DEPRECATED_API;
 
@@ -491,7 +391,7 @@ public:
    * @brief Sets the animation time.
    *
    * @SINCE_1_0.0
-   * @param[in] animationTime The animation time in seconds.
+   * @param[in] animationTime The animation time in seconds
    */
   void SetAnimationTime( float animationTime ) DALI_DEPRECATED_API;
 
@@ -501,7 +401,7 @@ public:
    * @brief Retrieves button's animation time.
    *
    * @SINCE_1_0.0
-   * @return The animation time in seconds.
+   * @return The animation time in seconds
    */
   float GetAnimationTime() const DALI_DEPRECATED_API;
 
@@ -511,7 +411,7 @@ public:
    * @brief Sets the button's label.
    *
    * @SINCE_1_0.0
-   * @param[in] label The label text.
+   * @param[in] label The label text
    */
   void SetLabelText( const std::string& label ) DALI_DEPRECATED_API;
 
@@ -521,7 +421,7 @@ public:
    * @brief Gets the label.
    *
    * @SINCE_1_0.0
-   * @return The label text.
+   * @return The label text
    */
   std::string GetLabelText() const DALI_DEPRECATED_API;
 
@@ -531,18 +431,18 @@ public:
    * @brief Sets the unselected button image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The button image.
+   * @param[in] filename The button image
    */
   void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
-   * @DEPRECATED_1_1.32 Use styling
-   * Use Property::UNSELECTED_BACKGROUND_VISUAL
+   * @DEPRECATED_1_1.32 Use styling Set Control::Property::BACKGROUND which is same as un-selected background
+   * Or use DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL
    *
-   * @brief Sets the unselected background image.
+   * @brief Sets the background image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The background image.
+   * @param[in] filename The background image
    */
   void SetBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
 
@@ -552,29 +452,29 @@ public:
    * @brief Sets the selected image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The selected image.
+   * @param[in] filename The selected image
    */
   void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
-   * @DEPRECATED_1_2.32 Use styling file
-   * Use Property::SELECTED_BACKGROUND_VISUAL
+   * @DEPRECATED_1_1.32 Set Control::Property::BACKGROUND which is same as un-selected background
+   * Or use DevelButton::Property::SELECTED_BACKGROUND_VISUAL
    *
    * @brief Sets the selected background image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The selected background image.
+   * @param[in] filename The selected background image
    */
   void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
-   * @DEPRECATED_1_1.32 Use styling file
-   * Use Property::DISABLED_SELECTED_BACKGROUND_VISUAL
+   * @DEPRECATED_1_1.32 Only able to set Property::DISABLED_STATE_IMAGE
+   * Or use DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL
    *
    * @brief Sets the disabled background image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The disabled background image.
+   * @param[in] filename The disabled background image
    */
   void SetDisabledBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
 
@@ -584,28 +484,28 @@ public:
    * @brief Sets the disabled button image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The disabled button image.
+   * @param[in] filename The disabled button image
    */
   void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
-   * @DEPRECATED_1_1.32 Use styling file
-   * Use Property::DISABLED_SELECTED_VISUAL
+   * @DEPRECATED_1_1.32 Use Property::DISABLED_STATE_IMAGE which provides same disabled image for un/selected
+   * Or DevelButton::Property::DISABLED_SELECTED_VISUAL to disable selected visual.
    *
    * @brief Sets the disabled selected button image.
    *
    * @SINCE_1_0.0
-   * @param[in] filename The disabled selected button image.
+   * @param[in] filename The disabled selected button image
    */
   void SetDisabledSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
 
   /**
-   * @DEPRECATED_1_0.50. Instead, use SetLabelText.
+   * @DEPRECATED_1_0.50. Instead, use SetLabelText
    *
    * @brief Sets the label with an actor.
    *
    * @SINCE_1_0.0
-   * @param[in]  label The actor to use as a label
+   * @param[in] label The actor to use as a label
    */
   void SetLabel( Actor label ) DALI_DEPRECATED_API;
 
@@ -615,7 +515,7 @@ public:
    * @brief Sets the button image.
    *
    * @SINCE_1_0.0
-   * @param[in]  image The button image.
+   * @param[in] image The button image
    */
   void SetButtonImage( Image image ) DALI_DEPRECATED_API;
 
@@ -625,7 +525,7 @@ public:
    * @brief Sets the selected image.
    *
    * @SINCE_1_0.0
-   * @param[in]  image The selected image.
+   * @param[in] image The selected image
    */
   void SetSelectedImage( Image image ) DALI_DEPRECATED_API;
 
@@ -636,7 +536,7 @@ public:
    *
    * @SINCE_1_0.0
    * @remarks Avoid using this method as it's a legacy code.
-   * @return     An actor with the button image.
+   * @return An actor with the button image
    */
   Actor GetButtonImage() const DALI_DEPRECATED_API;
 
@@ -647,14 +547,14 @@ public:
    *
    * @SINCE_1_0.0
    * @remarks Avoid using this method as it's a legacy code.
-   * @return     An actor with the selected image.
+   * @return An actor with the selected image
    */
   Actor GetSelectedImage() const DALI_DEPRECATED_API;
 
 public: //Signals
 
   /**
-   * @brief Button signal type
+   * @brief Button signal type.
    * @SINCE_1_0.0
    */
   typedef Signal< bool ( Button ) > ButtonSignalType;
@@ -667,7 +567,7 @@ public: //Signals
    *   bool YourCallbackName( Button button );
    * @endcode
    * @SINCE_1_0.0
-   * @return The signal to connect to.
+   * @return The signal to connect to
    */
   ButtonSignalType& PressedSignal();
 
@@ -679,7 +579,7 @@ public: //Signals
    *   bool YourCallbackName( Button button );
    * @endcode
    * @SINCE_1_0.0
-   * @return The signal to connect to.
+   * @return The signal to connect to
    */
   ButtonSignalType& ReleasedSignal();
 
@@ -691,7 +591,7 @@ public: //Signals
    *   bool YourCallbackName( Button button );
    * @endcode
    * @SINCE_1_0.0
-   * @return The signal to connect to.
+   * @return The signal to connect to
    */
   ButtonSignalType& ClickedSignal();
 
@@ -705,7 +605,7 @@ public: //Signals
    *   bool YourCallbackName( Button button );
    * @endcode
    * @SINCE_1_0.0
-   * @return The signal to connect to.
+   * @return The signal to connect to
    */
   ButtonSignalType& StateChangedSignal();
 
@@ -716,7 +616,7 @@ public: // Not intended for application developers
    * @brief Creates a handle using the Toolkit::Internal implementation.
    *
    * @SINCE_1_0.0
-   * @param[in]  implementation  The Control implementation.
+   * @param[in] implementation The Control implementation
    */
   DALI_INTERNAL Button( Internal::Button& implementation );
 
@@ -724,7 +624,7 @@ public: // Not intended for application developers
    * @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.
+   * @param[in] internal A pointer to the internal CustomActor
    */
   DALI_INTERNAL Button( Dali::Internal::CustomActor* internal );
   /// @endcond
@@ -737,4 +637,4 @@ public: // Not intended for application developers
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_BUTTON_H__
+#endif // DALI_TOOLKIT_BUTTON_H