PlatformTouchEvent.h [plain text]
#ifndef PlatformTouchEvent_h
#define PlatformTouchEvent_h
#include <wtf/Platform.h>
#ifdef __OBJC__
@class WebEvent;
#else
class WebEvent;
#endif
#include <wtf/Vector.h>
#include "IntPoint.h"
namespace WebCore {
enum TouchEventType { TouchEventBegin, TouchEventChange, TouchEventEnd, TouchEventCancel };
enum TouchPhaseType { TouchPhaseBegan, TouchPhaseMoved, TouchPhaseStationary, TouchPhaseEnded, TouchPhaseCancelled };
class PlatformTouchEvent {
public:
PlatformTouchEvent(WebEvent *);
TouchEventType eventType() const { return m_type; }
unsigned touchCount() const { return m_touchCount; }
IntPoint touchLocationAtIndex(unsigned i) const { return m_touchLocations[i]; }
IntPoint globalTouchLocationAtIndex(unsigned i) const { return m_touchGlobalLocations[i]; }
unsigned touchIdentifierAtIndex(unsigned i) const { return m_touchIdentifiers[i]; }
TouchPhaseType touchPhaseAtIndex(unsigned i) const { return m_touchPhases[i]; }
bool isGesture() const { return m_isGesture; }
float scale() const { return m_gestureScale; }
float rotation() const { return m_gestureRotation; }
protected:
TouchEventType m_type;
unsigned m_touchCount;
Vector<IntPoint> m_touchLocations;
Vector<IntPoint> m_touchGlobalLocations;
Vector<unsigned> m_touchIdentifiers;
Vector<TouchPhaseType> m_touchPhases;
bool m_isGesture;
float m_gestureScale;
float m_gestureRotation;
};
}
#endif // PlatformTouchEvent_h