summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/UIEvent.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/UIEvent.h')
-rw-r--r--Source/WebCore/dom/UIEvent.h47
1 files changed, 19 insertions, 28 deletions
diff --git a/Source/WebCore/dom/UIEvent.h b/Source/WebCore/dom/UIEvent.h
index 077bee460..973d73ef3 100644
--- a/Source/WebCore/dom/UIEvent.h
+++ b/Source/WebCore/dom/UIEvent.h
@@ -21,50 +21,39 @@
*
*/
-#ifndef UIEvent_h
-#define UIEvent_h
+#pragma once
#include "DOMWindow.h"
#include "Event.h"
+#include "UIEventInit.h"
namespace WebCore {
+// FIXME: Remove this when no one is depending on it anymore.
typedef DOMWindow AbstractView;
-struct UIEventInit : public EventInit {
- UIEventInit();
- UIEventInit(bool bubbles, bool cancelable);
-
- RefPtr<AbstractView> view;
- int detail;
-};
-
class UIEvent : public Event {
public:
- static PassRefPtr<UIEvent> create()
+ static Ref<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow* view, int detail)
{
- return adoptRef(new UIEvent);
+ return adoptRef(*new UIEvent(type, canBubble, cancelable, view, detail));
}
- static PassRefPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail)
+ static Ref<UIEvent> createForBindings()
{
- return adoptRef(new UIEvent(type, canBubble, cancelable, view, detail));
+ return adoptRef(*new UIEvent);
}
- static PassRefPtr<UIEvent> create(const AtomicString& type, const UIEventInit& initializer)
+ static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer, IsTrusted isTrusted = IsTrusted::No)
{
- return adoptRef(new UIEvent(type, initializer));
+ return adoptRef(*new UIEvent(type, initializer, isTrusted));
}
virtual ~UIEvent();
- void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
+ WEBCORE_EXPORT void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail);
- AbstractView* view() const { return m_view.get(); }
+ DOMWindow* view() const { return m_view.get(); }
int detail() const { return m_detail; }
- virtual EventInterface eventInterface() const override;
- virtual bool isUIEvent() const override;
-
- virtual int keyCode() const;
- virtual int charCode() const;
+ EventInterface eventInterface() const override;
virtual int layerX();
virtual int layerY();
@@ -76,15 +65,17 @@ public:
protected:
UIEvent();
- UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
- UIEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>, int detail);
- UIEvent(const AtomicString&, const UIEventInit&);
+ UIEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail);
+ UIEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail);
+ UIEvent(const AtomicString&, const UIEventInit&, IsTrusted);
private:
- RefPtr<AbstractView> m_view;
+ bool isUIEvent() const final;
+
+ RefPtr<DOMWindow> m_view;
int m_detail;
};
} // namespace WebCore
-#endif // UIEvent_h
+SPECIALIZE_TYPE_TRAITS_EVENT(UIEvent)