#ifndef FocusEvent_h
#define FocusEvent_h
#include "EventTarget.h"
#include "UIEvent.h"
namespace WebCore {
class Node;
struct FocusEventInit : public UIEventInit {
FocusEventInit();
RefPtr<EventTarget> relatedTarget;
};
class FocusEvent final : public UIEvent {
public:
static Ref<FocusEvent> create()
{
return adoptRef(*new FocusEvent);
}
static Ref<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<AbstractView>&& view, int detail, RefPtr<EventTarget>&& relatedTarget)
{
return adoptRef(*new FocusEvent(type, canBubble, cancelable, WTF::move(view), detail, WTF::move(relatedTarget)));
}
static Ref<FocusEvent> create(const AtomicString& type, const FocusEventInit& initializer)
{
return adoptRef(*new FocusEvent(type, initializer));
}
virtual EventTarget* relatedTarget() const override { return m_relatedTarget.get(); }
void setRelatedTarget(RefPtr<EventTarget>&& relatedTarget) { m_relatedTarget = WTF::move(relatedTarget); }
virtual EventInterface eventInterface() const override;
private:
FocusEvent();
FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<AbstractView>&&, int, RefPtr<EventTarget>&&);
FocusEvent(const AtomicString& type, const FocusEventInit&);
virtual bool isFocusEvent() const override;
RefPtr<EventTarget> m_relatedTarget;
};
}
SPECIALIZE_TYPE_TRAITS_EVENT(FocusEvent)
#endif // FocusEvent_h