#ifndef TouchEvent_h
#define TouchEvent_h
#include "core/events/EventDispatchMediator.h"
#include "core/events/MouseRelatedEvent.h"
#include "core/dom/TouchList.h"
namespace WebCore {
class TouchEvent FINAL : public MouseRelatedEvent {
public:
virtual ~TouchEvent();
static PassRefPtrWillBeRawPtr<TouchEvent> create()
{
return adoptRefWillBeNoop(new TouchEvent);
}
static PassRefPtrWillBeRawPtr<TouchEvent> create(TouchList* touches,
TouchList* targetTouches, TouchList* changedTouches,
const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView> view,
int screenX, int screenY, int pageX, int pageY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
{
return adoptRefWillBeNoop(new TouchEvent(touches, targetTouches, changedTouches,
type, view, screenX, screenY, pageX, pageY,
ctrlKey, altKey, shiftKey, metaKey));
}
void initTouchEvent(TouchList* touches, TouchList* targetTouches,
TouchList* changedTouches, const AtomicString& type,
PassRefPtrWillBeRawPtr<AbstractView>, int screenX, int screenY,
int clientX, int clientY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
TouchList* touches() const { return m_touches.get(); }
TouchList* targetTouches() const { return m_targetTouches.get(); }
TouchList* changedTouches() const { return m_changedTouches.get(); }
void setTouches(PassRefPtrWillBeRawPtr<TouchList> touches) { m_touches = touches; }
void setTargetTouches(PassRefPtrWillBeRawPtr<TouchList> targetTouches) { m_targetTouches = targetTouches; }
void setChangedTouches(PassRefPtrWillBeRawPtr<TouchList> changedTouches) { m_changedTouches = changedTouches; }
virtual bool isTouchEvent() const OVERRIDE;
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual void trace(Visitor*) OVERRIDE;
private:
TouchEvent();
TouchEvent(TouchList* touches, TouchList* targetTouches,
TouchList* changedTouches, const AtomicString& type,
PassRefPtrWillBeRawPtr<AbstractView>, int screenX, int screenY, int pageX,
int pageY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
RefPtrWillBeMember<TouchList> m_touches;
RefPtrWillBeMember<TouchList> m_targetTouches;
RefPtrWillBeMember<TouchList> m_changedTouches;
};
class TouchEventDispatchMediator FINAL : public EventDispatchMediator {
public:
static PassRefPtr<TouchEventDispatchMediator> create(PassRefPtrWillBeRawPtr<TouchEvent>);
private:
explicit TouchEventDispatchMediator(PassRefPtrWillBeRawPtr<TouchEvent>);
TouchEvent* event() const;
virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
};
DEFINE_EVENT_TYPE_CASTS(TouchEvent);
}
#endif