#ifndef UIEvent_h
#define UIEvent_h
#include "DOMWindow.h"
#include "Event.h"
#include "EventDispatchMediator.h"
namespace WebCore {
typedef DOMWindow AbstractView;
class UIEvent : public Event {
public:
static PassRefPtr<UIEvent> create()
{
return adoptRef(new UIEvent);
}
static PassRefPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail)
{
return adoptRef(new UIEvent(type, canBubble, cancelable, view, detail));
}
virtual ~UIEvent();
void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
AbstractView* view() const { return m_view.get(); }
int detail() const { return m_detail; }
virtual const AtomicString& interfaceName() const;
virtual bool isUIEvent() const;
virtual int keyCode() const;
virtual int charCode() const;
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, PassRefPtr<AbstractView>, int detail);
void warnDeprecatedLayerXYUsage();
private:
RefPtr<AbstractView> m_view;
int m_detail;
};
class FocusInEventDispatchMediator : public EventDispatchMediator {
public:
static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
private:
explicit FocusInEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
virtual bool dispatchEvent(EventDispatcher*) const;
RefPtr<Node> m_oldFocusedNode;
};
class FocusOutEventDispatchMediator : public EventDispatchMediator {
public:
static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
private:
explicit FocusOutEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
virtual bool dispatchEvent(EventDispatcher*) const;
RefPtr<Node> m_newFocusedNode;
};
}
#endif // UIEvent_h