Add ReceiveAllTapEvents(bool)
[platform/core/uifw/dali-core.git] / dali / public-api / events / tap-gesture-detector.h
index 02406c2..7782231 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TAP_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -37,7 +37,7 @@ namespace Internal DALI_INTERNAL
 class TapGestureDetector;
 }
 
-struct TapGesture;
+class TapGesture;
 
 /**
  * @brief This class emits a signal when a tap gesture occurs that meets the requirements set by the
@@ -70,15 +70,13 @@ struct TapGesture;
 class DALI_CORE_API TapGestureDetector : public GestureDetector
 {
 public: // Typedefs
-
   /**
    * @brief Signal type for detected signal.
    * @SINCE_1_0.0
    */
-  typedef Signal< void ( Actor, const TapGesture& ) > DetectedSignalType;
+  using DetectedSignalType = Signal<void(Actor, const TapGesture&)>;
 
 public: // Creation & Destruction
-
   /**
    * @brief Creates an uninitialized TapGestureDetector; this can be initialized with TapGestureDetector::New().
    *
@@ -103,7 +101,7 @@ public: // Creation & Destruction
    * @param[in] tapsRequired The minimum & maximum number of taps required
    * @return A handle to a newly allocated Dali resource
    */
-  static TapGestureDetector New( uint32_t tapsRequired );
+  static TapGestureDetector New(uint32_t tapsRequired);
 
   /**
    * @brief Downcasts a handle to TapGestureDetector handle.
@@ -114,7 +112,7 @@ public: // Creation & Destruction
    * @param[in] handle Handle to an object
    * @return Handle to a TapGestureDetector object or an uninitialized handle
    */
-  static TapGestureDetector DownCast( BaseHandle handle );
+  static TapGestureDetector DownCast(BaseHandle handle);
 
   /**
    * @brief Destructor.
@@ -142,7 +140,6 @@ public: // Creation & Destruction
   TapGestureDetector& operator=(const TapGestureDetector& rhs);
 
 public: // Setters
-
   /**
    * @brief Sets the minimum number of taps required.
    *
@@ -151,8 +148,9 @@ public: // Setters
    * @param[in] minimumTaps The minimum taps required
    * @pre The gesture detector has been initialized.
    * @note The default is '1', the maximum is 2.
+   * @see ReceiveAllTapEvents
    */
-  void SetMinimumTapsRequired( uint32_t minimumTaps );
+  void SetMinimumTapsRequired(uint32_t minimumTaps);
 
   /**
    * @brief Sets the maximum number of taps required.
@@ -162,11 +160,20 @@ public: // Setters
    * @param[in] maximumTaps The maximum taps required
    * @pre The gesture detector has been initialized.
    * @note The default is '1', the maximum is 2.
+   * @see ReceiveAllTapEvents
    */
-  void SetMaximumTapsRequired( uint32_t maximumTaps );
+  void SetMaximumTapsRequired(uint32_t maximumTaps);
 
-public: // Getters
+  /**
+   * @brief When set to true, all tap gestures will be received when multiple taps are supported by the gesture detector.
+   *
+   * @param[in] receive The receiving all tap events flag
+   * @pre The gesture detector has been initialized.
+   * @note The default is false.
+   */
+  void ReceiveAllTapEvents(bool receive);
 
+public: // Getters
   /**
    * @brief Retrieves the minimum number of taps required.
    *
@@ -186,7 +193,6 @@ public: // Getters
   uint32_t GetMaximumTapsRequired() const;
 
 public: // Signals
-
   /**
    * @brief This signal is emitted when the specified tap is detected on the attached actor.
    *
@@ -201,7 +207,6 @@ public: // Signals
   DetectedSignalType& DetectedSignal();
 
 public: // Not intended for Application developers
-
   /// @cond internal
   /**
    * @brief This constructor is used by TapGestureDetector::New() methods.