diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/dom/UIEventWithKeyState.h | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/dom/UIEventWithKeyState.h')
-rw-r--r-- | Source/WebCore/dom/UIEventWithKeyState.h | 92 |
1 files changed, 53 insertions, 39 deletions
diff --git a/Source/WebCore/dom/UIEventWithKeyState.h b/Source/WebCore/dom/UIEventWithKeyState.h index 5b9ce11ec..b0218e6ac 100644 --- a/Source/WebCore/dom/UIEventWithKeyState.h +++ b/Source/WebCore/dom/UIEventWithKeyState.h @@ -28,50 +28,64 @@ namespace WebCore { - class UIEventWithKeyState : public UIEvent { - public: - bool ctrlKey() const { return m_ctrlKey; } - bool shiftKey() const { return m_shiftKey; } - bool altKey() const { return m_altKey; } - bool metaKey() const { return m_metaKey; } +struct UIEventWithKeyStateInit : public UIEventInit { + bool ctrlKey { false }; + bool altKey { false }; + bool shiftKey { false }; + bool metaKey { false }; +}; - protected: - UIEventWithKeyState() - : m_ctrlKey(false) - , m_altKey(false) - , m_shiftKey(false) - , m_metaKey(false) - { - } +class UIEventWithKeyState : public UIEvent { +public: + bool ctrlKey() const { return m_ctrlKey; } + bool shiftKey() const { return m_shiftKey; } + bool altKey() const { return m_altKey; } + bool metaKey() const { return m_metaKey; } - UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, - int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) - : UIEvent(type, canBubble, cancelable, view, detail) - , m_ctrlKey(ctrlKey) - , m_altKey(altKey) - , m_shiftKey(shiftKey) - , m_metaKey(metaKey) - { - } +protected: + UIEventWithKeyState() + : m_ctrlKey(false) + , m_altKey(false) + , m_shiftKey(false) + , m_metaKey(false) + { + } - UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view, - int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) - : UIEvent(type, canBubble, cancelable, timestamp, view, detail) - , m_ctrlKey(ctrlKey) - , m_altKey(altKey) - , m_shiftKey(shiftKey) - , m_metaKey(metaKey) - { - } + UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) + : UIEvent(type, canBubble, cancelable, view, detail) + , m_ctrlKey(ctrlKey) + , m_altKey(altKey) + , m_shiftKey(shiftKey) + , m_metaKey(metaKey) + { + } - // Expose these so init functions can set them. - bool m_ctrlKey : 1; - bool m_altKey : 1; - bool m_shiftKey : 1; - bool m_metaKey : 1; - }; + UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) + : UIEvent(type, canBubble, cancelable, timestamp, view, detail) + , m_ctrlKey(ctrlKey) + , m_altKey(altKey) + , m_shiftKey(shiftKey) + , m_metaKey(metaKey) + { + } - UIEventWithKeyState* findEventWithKeyState(Event*); + UIEventWithKeyState(const AtomicString& type, const UIEventWithKeyStateInit& initializer) + : UIEvent(type, initializer) + , m_ctrlKey(initializer.ctrlKey) + , m_altKey(initializer.altKey) + , m_shiftKey(initializer.shiftKey) + , m_metaKey(initializer.metaKey) + { + } + + // Expose these so init functions can set them. + bool m_ctrlKey : 1; + bool m_altKey : 1; + bool m_shiftKey : 1; + bool m_metaKey : 1; +}; + +WEBCORE_EXPORT UIEventWithKeyState* findEventWithKeyState(Event*); } // namespace WebCore |