#ifndef Touch_h
#define Touch_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/events/EventTarget.h"
#include "heap/Handle.h"
#include "platform/geometry/LayoutPoint.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class LocalFrame;
class Touch : public RefCountedWillBeGarbageCollectedFinalized<Touch>, public ScriptWrappable {
public:
static PassRefPtrWillBeRawPtr<Touch> create(LocalFrame* frame, EventTarget* target,
unsigned identifier, int screenX, int screenY, int pageX, int pageY,
int radiusX, int radiusY, float rotationAngle, float force)
{
return adoptRefWillBeNoop(new Touch(frame, target, identifier, screenX,
screenY, pageX, pageY, radiusX, radiusY, rotationAngle, force));
}
EventTarget* target() const { return m_target.get(); }
unsigned identifier() const { return m_identifier; }
int clientX() const { return m_clientX; }
int clientY() const { return m_clientY; }
int screenX() const { return m_screenX; }
int screenY() const { return m_screenY; }
int pageX() const { return m_pageX; }
int pageY() const { return m_pageY; }
int webkitRadiusX() const { return m_radiusX; }
int webkitRadiusY() const { return m_radiusY; }
float webkitRotationAngle() const { return m_rotationAngle; }
float webkitForce() const { return m_force; }
const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
PassRefPtrWillBeRawPtr<Touch> cloneWithNewTarget(EventTarget*) const;
void trace(Visitor*) { }
private:
Touch(LocalFrame* frame, EventTarget* target, unsigned identifier,
int screenX, int screenY, int pageX, int pageY,
int radiusX, int radiusY, float rotationAngle, float force);
Touch(EventTarget*, unsigned identifier, int clientX, int clientY,
int screenX, int screenY, int pageX, int pageY,
int radiusX, int radiusY, float rotationAngle, float force, LayoutPoint absoluteLocation);
RefPtr<EventTarget> m_target;
unsigned m_identifier;
int m_clientX;
int m_clientY;
int m_screenX;
int m_screenY;
int m_pageX;
int m_pageY;
int m_radiusX;
int m_radiusY;
float m_rotationAngle;
float m_force;
LayoutPoint m_absoluteLocation;
};
}
#endif