#ifndef MouseEvent_h
#define MouseEvent_h
#include "Clipboard.h"
#include "EventTargetNode.h"
#include "MouseRelatedEvent.h"
namespace WebCore {
class MouseEvent : public MouseRelatedEvent {
public:
MouseEvent();
MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
int detail, int screenX, int screenY, int pageX, int pageY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
EventTargetNode* relatedTarget, Clipboard* clipboard = 0, bool isSimulated = false);
virtual ~MouseEvent();
void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
int detail, int screenX, int screenY, int clientX, int clientY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
unsigned short button, EventTargetNode* relatedTarget);
unsigned short button() const { return m_button; }
bool buttonDown() const { return m_buttonDown; }
EventTargetNode* relatedTarget() const { return m_relatedTarget.get(); }
Clipboard* clipboard() const { return m_clipboard.get(); }
Node* toElement() const;
Node* fromElement() const;
Clipboard* dataTransfer() const { return isDragEvent() ? m_clipboard.get() : 0; }
virtual bool isMouseEvent() const;
virtual bool isDragEvent() const;
virtual int which() const;
private:
unsigned short m_button;
bool m_buttonDown;
RefPtr<EventTargetNode> m_relatedTarget;
RefPtr<Clipboard> m_clipboard;
};
}
#endif // MouseEvent_h