Moved Gesture::State and -::Type to gesture-enumerations.h.
[platform/core/uifw/dali-core.git] / dali / internal / event / events / pinch-gesture / pinch-gesture-recognizer.h
index 008d7ff..235a38b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_PINCH_GESTURE_RECOGNIZER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -48,9 +48,12 @@ public:
   /**
    * Constructor
    * @param[in] screenSize The size of the screen.
+   * @param[in] screenDpi The dpi value of the screen
    * @param[in] minimumPinchDistance in pixels
+   * @param[in] minimumTouchEvents The number of touch events required
+   * @param[in] minimumTouchEventsAfterStart The number of touch events required after a gesture started
    */
-  PinchGestureRecognizer(Observer& observer, Vector2 screenSize, float minimumPinchDistance);
+  PinchGestureRecognizer( Observer& observer, Vector2 screenSize, Vector2 screenDpi, float minimumPinchDistance, uint32_t minimumTouchEvents, uint32_t minimumTouchEventsAfterStart );
 
   /**
    * Virtual destructor.
@@ -62,6 +65,18 @@ public:
   void SetMinimumPinchDistance(float value);
 
   /**
+   * Sets the minimum touch events required before a pinch can be started
+   * @param[in] value The number of touch events
+   */
+  void SetMinimumTouchEvents( uint32_t value );
+
+  /**
+   * Sets the minimum touch events required after a pinch started
+   * @param[in] value The number of touch events
+   */
+  void SetMinimumTouchEventsAfterStart( uint32_t value );
+
+  /**
    * @copydoc Dali::Internal::GestureDetector::SendEvent(const Integration::TouchEvent&)
    */
   virtual void SendEvent(const Integration::TouchEvent& event);
@@ -78,7 +93,7 @@ private:
    * @param[in]  state         The state of the pinch (whether it's starting, continuing or finished).
    * @param[in]  currentEvent  The latest touch event.
    */
-  void SendPinch(Gesture::State state, const Integration::TouchEvent& currentEvent);
+  void SendPinch(GestureState state, const Integration::TouchEvent& currentEvent);
 
 private:
 
@@ -90,17 +105,23 @@ private:
    */
   enum State
   {
-    Clear,    ///< No gesture detected.
-    Possible, ///< The current touch event data suggests that a gesture is possible.
-    Started,  ///< A gesture has been detected.
+    CLEAR,    ///< No gesture detected.
+    POSSIBLE, ///< The current touch event data suggests that a gesture is possible.
+    STARTED,  ///< A gesture has been detected.
   };
 
   State mState; ///< The current state of the detector.
   std::vector<Integration::TouchEvent> mTouchEvents; ///< The touch events since initial touch down.
 
+  float mDefaultMinimumDistanceDelta; ///< The default value of the mMinimumDistanceDelta.
+
   float mMinimumDistanceDelta; ///< The minimum distance before a pinch is applicable.
 
   float mStartingDistance; ///< The distance between the two touch points when the pinch is first detected.
+
+  uint32_t mMinimumTouchEvents; ///< The minimum touch events required before a pinch can be started.
+
+  uint32_t mMinimumTouchEventsAfterStart; ///< The minimum touch events required after a pinch started.
 };
 
 } // namespace Internal