diff options
author | Ben Murdoch <benm@google.com> | 2011-05-16 16:25:10 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-23 18:54:14 +0100 |
commit | ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch) | |
tree | db769fadd053248f85db67434a5b275224defef7 /Source/WebCore/dom/TextEvent.h | |
parent | 52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff) | |
download | external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2 |
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebCore/dom/TextEvent.h')
-rw-r--r-- | Source/WebCore/dom/TextEvent.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/Source/WebCore/dom/TextEvent.h b/Source/WebCore/dom/TextEvent.h index f1d24e9..d770d38 100644 --- a/Source/WebCore/dom/TextEvent.h +++ b/Source/WebCore/dom/TextEvent.h @@ -28,23 +28,16 @@ #define TextEvent_h #include "DocumentFragment.h" +#include "TextEventInputType.h" #include "UIEvent.h" namespace WebCore { class TextEvent : public UIEvent { public: - enum InputType { - InputTypeKeyboard, // any newline characters in the text are line breaks only, not paragraph separators. - InputTypeLineBreak, // any tab characters in the text are backtabs. - InputTypeBackTab, - InputTypePaste, - InputTypeDrop, - }; - static InputType selectInputType(bool isLineBreak, bool isBackTab); static PassRefPtr<TextEvent> create(); - static PassRefPtr<TextEvent> create(PassRefPtr<AbstractView> view, const String& data, InputType = InputTypeKeyboard); + static PassRefPtr<TextEvent> create(PassRefPtr<AbstractView>, const String& data, TextEventInputType = TextEventInputKeyboard); static PassRefPtr<TextEvent> createForPlainTextPaste(PassRefPtr<AbstractView> view, const String& data, bool shouldSmartReplace); static PassRefPtr<TextEvent> createForFragmentPaste(PassRefPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle); static PassRefPtr<TextEvent> createForDrop(PassRefPtr<AbstractView> view, const String& data); @@ -57,10 +50,10 @@ namespace WebCore { virtual bool isTextEvent() const; - bool isLineBreak() const { return m_inputType == InputTypeLineBreak; } - bool isBackTab() const { return m_inputType == InputTypeBackTab; } - bool isPaste() const { return m_inputType == InputTypePaste; } - bool isDrop() const { return m_inputType == InputTypeDrop; } + bool isLineBreak() const { return m_inputType == TextEventInputLineBreak; } + bool isBackTab() const { return m_inputType == TextEventInputBackTab; } + bool isPaste() const { return m_inputType == TextEventInputPaste; } + bool isDrop() const { return m_inputType == TextEventInputDrop; } bool shouldSmartReplace() const { return m_shouldSmartReplace; } bool shouldMatchStyle() const { return m_shouldMatchStyle; } @@ -69,11 +62,11 @@ namespace WebCore { private: TextEvent(); - TextEvent(PassRefPtr<AbstractView>, const String& data, InputType = InputTypeKeyboard); + TextEvent(PassRefPtr<AbstractView>, const String& data, TextEventInputType = TextEventInputKeyboard); TextEvent(PassRefPtr<AbstractView>, const String& data, PassRefPtr<DocumentFragment>, bool shouldSmartReplace, bool shouldMatchStyle); - InputType m_inputType; + TextEventInputType m_inputType; String m_data; RefPtr<DocumentFragment> m_pastingFragment; |