#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.
/**
* 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.
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);
* @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:
*/
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