diff options
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; |