#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 : public UIEvent {
public:
static PassRefPtr<FocusEvent> create()
{
return adoptRef(new FocusEvent);
}
static PassRefPtr<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail, PassRefPtr<EventTarget> relatedTarget)
{
return adoptRef(new FocusEvent(type, canBubble, cancelable, view, detail, relatedTarget));
}
static PassRefPtr<FocusEvent> create(const AtomicString& type, const FocusEventInit& initializer)
{
return adoptRef(new FocusEvent(type, initializer));
}
virtual EventTarget* relatedTarget() const override final { return m_relatedTarget.get(); }
void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
virtual EventInterface eventInterface() const override;
virtual bool isFocusEvent() const override;
private:
FocusEvent();
FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int, PassRefPtr<EventTarget>);
FocusEvent(const AtomicString& type, const FocusEventInit&);
RefPtr<EventTarget> m_relatedTarget;
};
EVENT_TYPE_CASTS(FocusEvent)
}
#endif // FocusEvent_h