OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 unsigned short button, PassRefPtr<EventTarget> relatedTarget); | 79 unsigned short button, PassRefPtr<EventTarget> relatedTarget); |
80 | 80 |
81 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused
own/up, maybe others), | 81 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused
own/up, maybe others), |
82 // but we will match the standard DOM. | 82 // but we will match the standard DOM. |
83 unsigned short button() const { return m_button; } | 83 unsigned short button() const { return m_button; } |
84 bool buttonDown() const { return m_buttonDown; } | 84 bool buttonDown() const { return m_buttonDown; } |
85 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 85 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
86 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget;
return m_relatedTarget.get(); } | 86 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget;
return m_relatedTarget.get(); } |
87 void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarg
et = relatedTarget; } | 87 void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarg
et = relatedTarget; } |
88 | 88 |
89 Clipboard* clipboard() const { return m_clipboard.get(); } | 89 virtual Clipboard* clipboard() const OVERRIDE FINAL { return m_clipboard.get
(); } |
90 | 90 |
91 Node* toElement() const; | 91 Node* toElement() const; |
92 Node* fromElement() const; | 92 Node* fromElement() const; |
93 | 93 |
94 Clipboard* dataTransfer() const { return isDragEvent() ? m_clipboard.get() :
0; } | 94 Clipboard* dataTransfer() const { return isDragEvent() ? m_clipboard.get() :
0; } |
95 | 95 |
96 virtual const AtomicString& interfaceName() const; | 96 virtual const AtomicString& interfaceName() const OVERRIDE; |
97 | 97 |
98 virtual bool isMouseEvent() const; | 98 virtual bool isMouseEvent() const OVERRIDE; |
99 virtual bool isDragEvent() const; | 99 virtual bool isDragEvent() const OVERRIDE FINAL; |
100 virtual int which() const; | 100 virtual int which() const OVERRIDE FINAL; |
101 | 101 |
102 protected: | 102 protected: |
103 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtr<AbstractView>, | 103 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtr<AbstractView>, |
104 int detail, int screenX, int screenY, int pageX, int pageY, | 104 int detail, int screenX, int screenY, int pageX, int pageY, |
105 int movementX, int movementY, | 105 int movementX, int movementY, |
106 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
utton, | 106 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
utton, |
107 PassRefPtr<EventTarget> relatedTarget, PassRefPtr<Clipboard>, bool isSim
ulated); | 107 PassRefPtr<EventTarget> relatedTarget, PassRefPtr<Clipboard>, bool isSim
ulated); |
108 | 108 |
109 MouseEvent(const AtomicString& type, const MouseEventInit&); | 109 MouseEvent(const AtomicString& type, const MouseEventInit&); |
110 | 110 |
111 MouseEvent(); | 111 MouseEvent(); |
112 | 112 |
113 private: | 113 private: |
114 unsigned short m_button; | 114 unsigned short m_button; |
115 bool m_buttonDown; | 115 bool m_buttonDown; |
116 RefPtr<EventTarget> m_relatedTarget; | 116 RefPtr<EventTarget> m_relatedTarget; |
117 RefPtr<Clipboard> m_clipboard; | 117 RefPtr<Clipboard> m_clipboard; |
118 }; | 118 }; |
119 | 119 |
120 class SimulatedMouseEvent : public MouseEvent { | 120 class SimulatedMouseEvent FINAL : public MouseEvent { |
121 public: | 121 public: |
122 static PassRefPtr<SimulatedMouseEvent> create(const AtomicString& eventType,
PassRefPtr<AbstractView>, PassRefPtr<Event> underlyingEvent); | 122 static PassRefPtr<SimulatedMouseEvent> create(const AtomicString& eventType,
PassRefPtr<AbstractView>, PassRefPtr<Event> underlyingEvent); |
123 virtual ~SimulatedMouseEvent(); | 123 virtual ~SimulatedMouseEvent(); |
124 | 124 |
125 private: | 125 private: |
126 SimulatedMouseEvent(const AtomicString& eventType, PassRefPtr<AbstractView>,
PassRefPtr<Event> underlyingEvent); | 126 SimulatedMouseEvent(const AtomicString& eventType, PassRefPtr<AbstractView>,
PassRefPtr<Event> underlyingEvent); |
127 }; | 127 }; |
128 | 128 |
129 class MouseEventDispatchMediator : public EventDispatchMediator { | 129 class MouseEventDispatchMediator FINAL : public EventDispatchMediator { |
130 public: | 130 public: |
131 enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; | 131 enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; |
132 static PassRefPtr<MouseEventDispatchMediator> create(PassRefPtr<MouseEvent>,
MouseEventType = NonSyntheticMouseEvent); | 132 static PassRefPtr<MouseEventDispatchMediator> create(PassRefPtr<MouseEvent>,
MouseEventType = NonSyntheticMouseEvent); |
133 | 133 |
134 private: | 134 private: |
135 explicit MouseEventDispatchMediator(PassRefPtr<MouseEvent>, MouseEventType); | 135 explicit MouseEventDispatchMediator(PassRefPtr<MouseEvent>, MouseEventType); |
136 MouseEvent* event() const; | 136 MouseEvent* event() const; |
137 | 137 |
138 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 138 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
139 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } | 139 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } |
140 MouseEventType m_mouseEventType; | 140 MouseEventType m_mouseEventType; |
141 }; | 141 }; |
142 | 142 |
143 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 143 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
144 | 144 |
145 } // namespace WebCore | 145 } // namespace WebCore |
146 | 146 |
147 #endif // MouseEvent_h | 147 #endif // MouseEvent_h |
OLD | NEW |