#pragma once
#include "Event.h"
#include "UIEventInit.h"
#include "WindowProxy.h"
namespace WebCore {
typedef WindowProxy AbstractView;
class UIEvent : public Event {
public:
static Ref<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail)
{
return adoptRef(*new UIEvent(type, canBubble, cancelable, WTFMove(view), detail));
}
static Ref<UIEvent> createForBindings()
{
return adoptRef(*new UIEvent);
}
static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer, IsTrusted isTrusted = IsTrusted::No)
{
return adoptRef(*new UIEvent(type, initializer, isTrusted));
}
virtual ~UIEvent();
WEBCORE_EXPORT void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail);
WindowProxy* view() const { return m_view.get(); }
int detail() const { return m_detail; }
EventInterface eventInterface() const override;
virtual int layerX();
virtual int layerY();
virtual int pageX() const;
virtual int pageY() const;
virtual int which() const;
protected:
UIEvent();
UIEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail);
UIEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail);
UIEvent(const AtomicString&, const UIEventInit&, IsTrusted);
private:
bool isUIEvent() const final;
RefPtr<WindowProxy> m_view;
int m_detail;
};
}
SPECIALIZE_TYPE_TRAITS_EVENT(UIEvent)