Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / events / gesture-detector.h
index 7360064..b866818 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_GESTURE_DETECTOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/handle.h>
 
-namespace Dali DALI_IMPORT_API
+namespace Dali
 {
+/**
+ * @addtogroup dali_core_events
+ * @{
+ */
 
 namespace Internal DALI_INTERNAL
 {
@@ -41,61 +44,59 @@ class Actor;
  * This is the base class for different gesture detectors available and provides functionality that is common
  * to all the gesture detectors.
  *
+ * @SINCE_1_0.0
  * @see Gesture
  */
-class GestureDetector : public Handle
+class DALI_CORE_API GestureDetector : public Handle
 {
 public: // Creation & Destruction
 
   /**
-   * @brief Create an uninitialized GestureDetector; this can be initialized with one of the derived gestures' New() methods.
+   * @brief Creates an uninitialized GestureDetector.
    *
-   * Calling member functions with an uninitialized Dali::Object is not allowed.
+   * This can be initialized with one of the derived gesture detectors' New() methods. For example, PanGestureDetector::New().
+   *
+   * Calling member functions with an uninitialized Dali::GestureDetector handle is not allowed.
+   * @SINCE_1_0.0
    */
   GestureDetector();
 
   /**
-   * @brief Downcast an Object handle to GestureDetector handle.
+   * @brief Downcasts a handle to GestureDetector handle.
    *
-   * If handle points to a GestureDetector object the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle to An object
-   * @return handle to a GestureDetector object or an uninitialized handle
+   * If handle points to a GestureDetector object, 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 GestureDetector object or an uninitialized handle
    */
   static GestureDetector DownCast( BaseHandle handle );
 
   /**
-   * @brief Dali::GestureDetector is intended as a base class
+   * @brief Dali::GestureDetector is intended as a base class.
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   * @SINCE_1_0.0
    */
   ~GestureDetector();
 
   /**
    * @brief This copy constructor is required for (smart) pointer semantics.
    *
-   * @param [in] handle A reference to the copied handle
+   * @SINCE_1_0.0
+   * @param[in] handle A reference to the copied handle
    */
   GestureDetector(const GestureDetector& handle);
 
   /**
    * @brief This assignment operator is required for (smart) pointer semantics.
    *
-   * @param [in] rhs  A reference to the copied handle
+   * @SINCE_1_0.0
+   * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   GestureDetector& operator=(const GestureDetector& rhs);
 
-  /**
-   * @brief This method is defined to allow assignment of the NULL value,
-   * and will throw an exception if passed any other value.
-   *
-   * Assigning to NULL is an alias for Reset().
-   * @param [in] rhs  A NULL pointer
-   * @return A reference to this handle
-   */
-  GestureDetector& operator=(BaseHandle::NullType* rhs);
-
 public: // Actor related
 
   /**
@@ -103,16 +104,18 @@ public: // Actor related
    *
    * The detected signal will be dispatched when the gesture occurs on
    * the attached actor.
-   * @note You can attach several actors to a gesture detector.
-   * @param[in]  actor  The actor to attach to the gesture detector
+   * @SINCE_1_0.0
+   * @param[in] actor The actor to attach to the gesture detector
    * @pre The gesture detector has been initialized.
+   * @note You can attach several actors to a gesture detector.
    */
   void Attach(Actor actor);
 
   /**
    * @brief Detaches the attached actor from the gesture detector.
    *
-   * @param[in]  actor  The actor to detach from the gesture detector.
+   * @SINCE_1_0.0
+   * @param[in] actor The actor to detach from the gesture detector
    * @pre The gesture detector has been initialized.
    * @pre The specified actor has been attached to the gesture detector.
    */
@@ -121,29 +124,47 @@ public: // Actor related
   /**
    * @brief Detaches all the actors that have been attached to the gesture detector.
    *
+   * @SINCE_1_0.0
    * @pre The gesture detector has been initialized.
    * @pre At least one actor has been attached to the gesture detector.
    */
   void DetachAll();
 
   /**
-   * @brief Returns a vector of actors attached to the gesture detector.
+   * @brief Returns the number of actors attached to the gesture detector.
+   *
+   * @SINCE_1_0.0
+   * @return The count
+   * @pre The gesture detector has been initialized.
+   */
+  size_t GetAttachedActorCount() const;
+
+  /**
+   * @brief Returns an actor by index. An empty handle if the index is not valid.
    *
-   * @return The attached actor vector.
+   * @SINCE_1_0.0
+   * @param[in] index The attached actor's index
+   * @return The attached actor or an empty handle
    * @pre The gesture detector has been initialized.
    */
-  std::vector<Actor> GetAttachedActors() const;
+  Actor GetAttachedActor(size_t index) const;
 
 protected:
 
+  /// @cond internal
   /**
-   * @brief This constructor is used by Dali New() methods of derived classes.
+   * @brief This constructor is used by New() methods of derived classes (For example, PanGestureDetector::New()).
    *
-   * @param [in]  internal  A pointer to a newly allocated Dali resource.
+   * @SINCE_1_0.0
+   * @param[in] internal A pointer to a newly allocated Dali resource
    */
   explicit DALI_INTERNAL GestureDetector(Internal::GestureDetector* internal);
+  /// @endcond
 };
 
+/**
+ * @}
+ */
 } // namespace Dali
 
 #endif // __DALI_GESTURE_DETECTOR_H__