Add SetTapRecognizerTime
[platform/core/uifw/dali-core.git] / dali / internal / event / events / tap-gesture / tap-gesture-processor.h
index b15e0fe..726d77e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TAP_GESTURE_EVENT_PROCESSOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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/internal/event/events/tap-gesture/tap-gesture-detector-impl.h>
-#include <dali/internal/event/events/gesture-processor.h>
 #include <dali/internal/event/events/actor-observer.h>
+#include <dali/internal/event/events/gesture-processor.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 class Scene;
 class Stage;
 class Actor;
@@ -46,7 +44,6 @@ struct TapGestureEvent;
 class TapGestureProcessor : public GestureProcessor, public RecognizerObserver<TapGestureEvent>
 {
 public:
-
   /**
    * Create a tap gesture processor.
    */
@@ -58,13 +55,12 @@ public:
   ~TapGestureProcessor() override;
 
 public: // To be called by GestureEventProcessor
-
   /**
    * This method is called whenever a tap gesture event occurs.
    * @param[in] scene The scene the tap gesture event occurs in.
    * @param[in] tapEvent The event that has occurred.
    */
-  void Process( Scene& scene, const TapGestureEvent& event) override;
+  void Process(Scene& scene, const TapGestureEvent& event) override;
 
   /**
    * Adds a gesture detector to this gesture processor.
@@ -88,14 +84,28 @@ public: // To be called by GestureEventProcessor
    */
   void GestureDetectorUpdated(TapGestureDetector* gestureDetector);
 
-private:
+  /**
+   * @brief This method sets the maximum allowed time required to be recognized as a multi tap gesture (millisecond)
+   *
+   * @param[in] time The time value in milliseconds
+   */
+  void SetMaximumAllowedTime(uint32_t time);
+
+  /**
+   * @brief This method sets the recognizer time required to be recognized as a tap gesture (millisecond)
+   *
+   * This time is from touch down to touch up to recognize the tap gesture.
+   *
+   * @param[in] time The time value in milliseconds
+   */
+  void SetRecognizerTime(uint32_t time);
 
+private:
   // Undefined
   TapGestureProcessor(const TapGestureProcessor&);
   TapGestureProcessor& operator=(const TapGestureProcessor& rhs);
 
 private:
-
   /**
    * Iterates through our GestureDetectors and determines if we need to ask the adaptor to update
    * its detection policy.  If it does, it sends the appropriate gesture update request to adaptor.
@@ -107,20 +117,21 @@ private:
   /**
    * @copydoc GestureProcessor::OnGesturedActorStageDisconnection()
    */
-  void OnGesturedActorStageDisconnection() override { /* Nothing to do */ }
+  void OnGesturedActorStageDisconnection() override
+  { /* Nothing to do */
+  }
 
   /**
    * @copydoc GestureProcessor::CheckGestureDetector()
    */
-  bool CheckGestureDetector( GestureDetector* detector, Actor* actor ) override;
+  bool CheckGestureDetector(GestureDetector* detector, Actor* actor) override;
 
   /**
    * @copydoc GestureProcessor::EmitGestureSignal()
    */
-  void EmitGestureSignal( Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates ) override;
+  void EmitGestureSignal(Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates) override;
 
 private:
-
   TapGestureDetectorContainer mTapGestureDetectors;
 
   unsigned int mMinTapsRequired;
@@ -128,9 +139,12 @@ private:
   unsigned int mMinTouchesRequired;
   unsigned int mMaxTouchesRequired;
 
-  ActorObserver mCurrentTapActor; ///< Observer for the current gesture actor
-  const TapGestureEvent* mCurrentTapEvent; ///< Pointer to current TapEvent, used when calling ProcessAndEmit()
-  bool mPossibleProcessed; ///< Indication of whether we've processed a touch down for this gestuee
+  ActorObserver          mCurrentTapActor;   ///< Observer for the current gesture actor
+  const TapGestureEvent* mCurrentTapEvent;   ///< Pointer to current TapEvent, used when calling ProcessAndEmit()
+  bool                   mPossibleProcessed; ///< Indication of whether we've processed a touch down for this gestuee
+
+  uint32_t mMaximumAllowedTime; ///< The maximum allowed time required to be recognized as a multi tap gesture (millisecond)
+  uint32_t mRecognizerTime;     ///< The recognizer time required to be recognized as a tap gesture (millisecond)
 };
 
 } // namespace Internal