GestureRecognizer.h [plain text]
#ifndef GestureRecognizer_h
#define GestureRecognizer_h
#if ENABLE(TOUCH_EVENTS)
#include "EflTypedefs.h"
#include <WebCore/IntPoint.h>
#include <WebKit/WKEventEfl.h>
class EwkView;
namespace WebKit {
class GestureHandler;
class GestureRecognizer {
public:
explicit GestureRecognizer(EwkView*);
~GestureRecognizer();
void processTouchEvent(WKTouchEventRef);
void reset();
private:
static Eina_Bool doubleTapTimerCallback(void*);
static Eina_Bool tapAndHoldTimerCallback(void*);
bool exceedsPanThreshold(const WebCore::IntPoint& first, const WebCore::IntPoint& last) const;
bool exceedsDoubleTapThreshold(const WebCore::IntPoint& first, const WebCore::IntPoint& last) const;
void noGesture(WKTouchEventRef);
void singleTapGesture(WKTouchEventRef);
void doubleTapGesture(WKTouchEventRef);
void panGesture(WKTouchEventRef);
void pinchGesture(WKTouchEventRef);
void stopTapTimers();
static const double s_doubleTapTimeoutInSeconds;
static const double s_tapAndHoldTimeoutInSeconds;
static const int s_squaredDoubleTapThreshold;
static const int s_squaredPanThreshold;
typedef void (GestureRecognizer::*RecognizerFunction)(WKTouchEventRef);
RecognizerFunction m_recognizerFunction;
std::unique_ptr<WebKit::GestureHandler> m_gestureHandler;
Ecore_Timer* m_tapAndHoldTimer;
Ecore_Timer* m_doubleTapTimer;
WebCore::IntPoint m_firstPressedPoint;
};
}
#endif // ENABLE(TOUCH_EVENTS)
#endif // GestureRecognizer_h