#ifndef MouseRelatedEvent_h
#define MouseRelatedEvent_h
#include "core/events/UIEventWithKeyState.h"
#include "platform/geometry/LayoutPoint.h"
namespace WebCore {
class MouseRelatedEvent : public UIEventWithKeyState {
public:
int screenX() const { return m_screenLocation.x(); }
int screenY() const { return m_screenLocation.y(); }
const IntPoint& screenLocation() const { return m_screenLocation; }
int clientX() const { return m_clientLocation.x(); }
int clientY() const { return m_clientLocation.y(); }
int webkitMovementX() const { return m_movementDelta.x(); }
int webkitMovementY() const { return m_movementDelta.y(); }
const LayoutPoint& clientLocation() const { return m_clientLocation; }
virtual int layerX() OVERRIDE FINAL;
virtual int layerY() OVERRIDE FINAL;
int offsetX();
int offsetY();
bool isSimulated() const { return m_isSimulated; }
virtual int pageX() const OVERRIDE FINAL;
virtual int pageY() const OVERRIDE FINAL;
int x() const;
int y() const;
const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; }
virtual void trace(Visitor*) OVERRIDE;
protected:
MouseRelatedEvent();
MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>,
int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
const IntPoint& movementDelta,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
void initCoordinates();
void initCoordinates(const LayoutPoint& clientLocation);
virtual void receivedTarget() OVERRIDE FINAL;
void computePageLocation();
void computeRelativePosition();
IntPoint m_screenLocation;
LayoutPoint m_clientLocation;
LayoutPoint m_movementDelta;
private:
LayoutPoint m_pageLocation;
LayoutPoint m_layerLocation;
LayoutPoint m_offsetLocation;
LayoutPoint m_absoluteLocation;
bool m_isSimulated;
bool m_hasCachedRelativePosition;
};
}
#endif