#ifndef DOM_EventTargetNodeImpl_h
#define DOM_EventTargetNodeImpl_h
#include "Node.h"
namespace WebCore {
template <typename T> class DeprecatedValueList;
class EventTargetNode : public Node {
public:
EventTargetNode(Document*);
virtual ~EventTargetNode();
virtual bool isEventTargetNode() const { return true; }
void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
void removeAllEventListeners();
void setHTMLEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
void removeHTMLEventListener(const AtomicString& eventType);
bool dispatchHTMLEvent(const AtomicString& eventType, bool canBubble, bool cancelable);
EventListener *getHTMLEventListener(const AtomicString& eventType);
bool dispatchGenericEvent(PassRefPtr<Event>, ExceptionCode&, bool tempEvent = false);
bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&, bool tempEvent = false);
bool dispatchSubtreeModifiedEvent(bool childrenChanged = true);
void dispatchWindowEvent(const AtomicString& eventType, bool canBubble, bool cancelable);
bool dispatchUIEvent(const AtomicString& eventType, int detail = 0);
bool dispatchKeyEvent(const PlatformKeyboardEvent&);
void dispatchWheelEvent(PlatformWheelEvent&);
bool dispatchMouseEvent(const PlatformMouseEvent&, const AtomicString& eventType,
int clickCount = 0, Node* relatedTarget = 0);
bool dispatchMouseEvent(const AtomicString& eventType, int button, int clickCount,
int pageX, int pageY, int screenX, int screenY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
bool isSimulated = false, Node* relatedTarget = 0);
bool dispatchSimulatedMouseEvent(const AtomicString& eventType);
void handleLocalEvents(Event*, bool useCapture);
virtual void dispatchFocusEvent();
virtual void dispatchBlurEvent();
virtual void insertedIntoDocument();
virtual void removedFromDocument();
virtual void* preDispatchEventHandler(Event*) { return 0; }
virtual void postDispatchEventHandler(Event*, void* dataFromPreDispatch) { }
virtual void defaultEventHandler(Event*);
virtual bool disabled() const;
#ifndef NDEBUG
virtual void dump(TextStream*, DeprecatedString indent = "") const;
#endif
virtual bool willRespondToMouseMoveEvents();
virtual bool willRespondToMouseWheelEvents();
virtual bool willRespondToMouseClickEvents();
protected:
typedef DeprecatedValueList<RefPtr<RegisteredEventListener> > RegisteredEventListenerList;
RegisteredEventListenerList* m_regdListeners;
};
inline EventTargetNode* EventTargetNodeCast(Node* n)
{
ASSERT(n->isEventTargetNode());
return static_cast<EventTargetNode*>(n);
}
inline const EventTargetNode* EventTargetNodeCast(const Node* n)
{
ASSERT(n->isEventTargetNode());
return static_cast<const EventTargetNode*>(n);
}
#ifndef NDEBUG
void forbidEventDispatch();
void allowEventDispatch();
bool eventDispatchForbidden();
#else
inline void forbidEventDispatch() { }
inline void allowEventDispatch() { }
#endif // NDEBUG
}
#endif