Add an environment variable for long press gesture
[platform/core/uifw/dali-core.git] / dali / internal / event / events / gesture-event-processor.h
index 903f5a6..9ae5d6f 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__
-#define __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__
+#ifndef DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H
+#define DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H
 
 /*
- * Copyright (c) 2018 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.
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
-#include <dali/internal/event/events/long-press-gesture-processor.h>
-#include <dali/internal/event/events/pan-gesture-processor.h>
-#include <dali/internal/event/events/pinch-gesture-processor.h>
-#include <dali/internal/event/events/tap-gesture-processor.h>
+#include <dali/internal/event/events/long-press-gesture/long-press-gesture-processor.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-processor.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-processor.h>
+#include <dali/internal/event/events/rotation-gesture/rotation-gesture-processor.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-processor.h>
 
 namespace Dali
 {
@@ -33,8 +34,7 @@ struct Gesture;
 
 namespace Integration
 {
-struct GestureEvent;
-class GestureManager;
+
 class RenderController;
 }
 
@@ -62,10 +62,9 @@ public:
   /**
    * Create a gesture event processor.
    * @param[in] updateManager The update manager
-   * @param[in] gestureManager The gesture manager
    * @param[in] renderController The render controller
    */
-  GestureEventProcessor( SceneGraph::UpdateManager& updateManager, Integration::GestureManager& gestureManager, Integration::RenderController& renderController );
+  GestureEventProcessor( SceneGraph::UpdateManager& updateManager, Integration::RenderController& renderController );
 
   /**
    * Non-virtual destructor; GestureProcessor is not a base class
@@ -75,10 +74,11 @@ public:
 public: // To be called by EventProcessor
 
   /**
-   * This function is called by Core whenever a gesture event occurs.
-   * @param[in] event The event that has occurred.
+   * This function is called by Core whenever a touch event occurs
+   * @param[in] scene The scene
+   * @param[in] event The event that has occurred
    */
-  void ProcessGestureEvent( Scene& scene, const Integration::GestureEvent& event );
+  void ProcessTouchEvent( Scene& scene, const Integration::TouchEvent& event);
 
 public: // To be called by gesture detectors
 
@@ -86,7 +86,7 @@ public: // To be called by gesture detectors
    * This method adds the specified gesture detector to the relevant gesture processor.
    * @param[in]  gestureDetector  The gesture detector to add
    */
-  void AddGestureDetector(GestureDetector* gestureDetector);
+  void AddGestureDetector(GestureDetector* gestureDetector, Scene& scene);
 
   /**
    * This method removes the specified gesture detector from the relevant gesture processor.
@@ -101,12 +101,6 @@ public: // To be called by gesture detectors
   void GestureDetectorUpdated(GestureDetector* gestureDetector);
 
   /**
-   * This method is called by GestureDetectors on Started or Continue state events.
-   * Status is queried and reset by Core in ProcessEvents
-   */
-  void SetUpdateRequired();
-
-  /**
    * Called by GestureDetectors to set the gesture properties in the update thread.
    * @param[in]  gesture  The gesture whose values will be used in the Update object.
    * @note If we are in the middle of processing the gesture being set, then this call is ignored.
@@ -237,6 +231,39 @@ public: // Called by Core
    */
   void SetPanGestureMultitapSmoothingRange( int32_t value );
 
+  /**
+   * @brief Sets the minimum distance required to start a pan event
+   *
+   * @param[in] value Distance in pixels
+   */
+  void SetPanGestureMinimumDistance( int32_t value );
+
+  /**
+   * @brief Sets the minimum number of touch events required to start a pan
+   *
+   * @param[in] value Number of touch events
+   */
+  void SetPanGestureMinimumPanEvents( int32_t value );
+
+  /**
+   * @brief Sets the minimum distance required to start a pinch event
+   *
+   * @param[in] value Distance in pixels
+   */
+  void SetPinchGestureMinimumDistance( float value);
+
+  /**
+   * @brief Sets the minimum holding time required to be recognized as a long press gesture
+   *
+   * @param[in] value The time value in milliseconds
+   */
+  void SetLongPressMinimumHoldingTime( uint32_t value );
+
+  /**
+   * @return The minimum holding time required to be recognized as a long press gesture in milliseconds
+   */
+  uint32_t GetLongPressMinimumHoldingTime() const;
+
 public: // needed for PanGesture
 
   /**
@@ -252,19 +279,19 @@ private:
 
 private:
 
-  Integration::GestureManager& mGestureManager;
-
   LongPressGestureProcessor mLongPressGestureProcessor;
   PanGestureProcessor mPanGestureProcessor;
   PinchGestureProcessor mPinchGestureProcessor;
   TapGestureProcessor mTapGestureProcessor;
+  RotationGestureProcessor mRotationGestureProcessor;
   Integration::RenderController& mRenderController;
 
-  bool mUpdateRequired;     ///< set to true by gesture detectors if they require a Core::Update
+  int32_t envOptionMinimumPanDistance;
+  int32_t envOptionMinimumPanEvents;
 };
 
 } // namespace Internal
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__
+#endif // DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H