#pragma once
#include "Event.h"
#include "UIEventInit.h"
#include "WindowProxy.h"
namespace WebCore {
typedef WindowProxy AbstractView;
class UIEvent : public Event {
WTF_MAKE_ISO_ALLOCATED(UIEvent);
public:
static Ref<UIEvent> create(const AtomString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, RefPtr<WindowProxy>&& view, int detail)
{
return adoptRef(*new UIEvent(type, canBubble, isCancelable, isComposed, WTFMove(view), detail));
}
static Ref<UIEvent> createForBindings()
{
return adoptRef(*new UIEvent);
}
static Ref<UIEvent> create(const AtomString& type, const UIEventInit& initializer)
{
return adoptRef(*new UIEvent(type, initializer));
}
virtual ~UIEvent();
WEBCORE_EXPORT void initUIEvent(const AtomString& 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 AtomString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail);
UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, IsTrusted = IsTrusted::Yes);
UIEvent(const AtomString&, const UIEventInit&);
private:
bool isUIEvent() const final;
RefPtr<WindowProxy> m_view;
int m_detail;
};
}
SPECIALIZE_TYPE_TRAITS_EVENT(UIEvent)