#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, 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 AtomicString& type, const UIEventInit& initializer)
{
return adoptRef(*new UIEvent(type, initializer));
}
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, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail);
UIEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, IsTrusted = IsTrusted::Yes);
UIEvent(const AtomicString&, const UIEventInit&);
private:
bool isUIEvent() const final;
RefPtr<WindowProxy> m_view;
int m_detail;
};
}
SPECIALIZE_TYPE_TRAITS_EVENT(UIEvent)