OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef TypingCommand_h | 26 #ifndef TypingCommand_h |
27 #define TypingCommand_h | 27 #define TypingCommand_h |
28 | 28 |
29 #include "core/editing/TextInsertionBaseCommand.h" | 29 #include "core/editing/TextInsertionBaseCommand.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class TypingCommand FINAL : public TextInsertionBaseCommand { | 33 class TypingCommand final : public TextInsertionBaseCommand { |
34 public: | 34 public: |
35 enum ETypingCommand { | 35 enum ETypingCommand { |
36 DeleteSelection, | 36 DeleteSelection, |
37 DeleteKey, | 37 DeleteKey, |
38 ForwardDeleteKey, | 38 ForwardDeleteKey, |
39 InsertText, | 39 InsertText, |
40 InsertLineBreak, | 40 InsertLineBreak, |
41 InsertParagraphSeparator, | 41 InsertParagraphSeparator, |
42 InsertParagraphSeparatorInQuotedContent | 42 InsertParagraphSeparatorInQuotedContent |
43 }; | 43 }; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 TypingCommand(Document&, ETypingCommand, const String& text, Options, TextGr
anularity, TextCompositionType); | 91 TypingCommand(Document&, ETypingCommand, const String& text, Options, TextGr
anularity, TextCompositionType); |
92 | 92 |
93 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } | 93 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } |
94 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } | 94 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } |
95 void closeTyping() { m_openForMoreTyping = false; } | 95 void closeTyping() { m_openForMoreTyping = false; } |
96 | 96 |
97 static PassRefPtrWillBeRawPtr<TypingCommand> lastTypingCommandIfStillOpenFor
Typing(LocalFrame*); | 97 static PassRefPtrWillBeRawPtr<TypingCommand> lastTypingCommandIfStillOpenFor
Typing(LocalFrame*); |
98 | 98 |
99 virtual void doApply() OVERRIDE; | 99 virtual void doApply() override; |
100 virtual EditAction editingAction() const OVERRIDE; | 100 virtual EditAction editingAction() const override; |
101 virtual bool isTypingCommand() const OVERRIDE; | 101 virtual bool isTypingCommand() const override; |
102 virtual bool preservesTypingStyle() const OVERRIDE { return m_preservesTypin
gStyle; } | 102 virtual bool preservesTypingStyle() const override { return m_preservesTypin
gStyle; } |
103 virtual void setShouldRetainAutocorrectionIndicator(bool retain) OVERRIDE {
m_shouldRetainAutocorrectionIndicator = retain; } | 103 virtual void setShouldRetainAutocorrectionIndicator(bool retain) override {
m_shouldRetainAutocorrectionIndicator = retain; } |
104 virtual bool shouldStopCaretBlinking() const OVERRIDE { return true; } | 104 virtual bool shouldStopCaretBlinking() const override { return true; } |
105 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellCheck
ing = prevent; } | 105 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellCheck
ing = prevent; } |
106 | 106 |
107 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, L
ocalFrame*); | 107 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, L
ocalFrame*); |
108 | 108 |
109 void updatePreservesTypingStyle(ETypingCommand); | 109 void updatePreservesTypingStyle(ETypingCommand); |
110 void markMisspellingsAfterTyping(ETypingCommand); | 110 void markMisspellingsAfterTyping(ETypingCommand); |
111 void typingAddedToOpenCommand(ETypingCommand); | 111 void typingAddedToOpenCommand(ETypingCommand); |
112 bool makeEditableRootEmpty(); | 112 bool makeEditableRootEmpty(); |
113 | 113 |
114 void updateCommandTypeOfOpenCommand(ETypingCommand typingCommand) { m_comman
dType = typingCommand; } | 114 void updateCommandTypeOfOpenCommand(ETypingCommand typingCommand) { m_comman
dType = typingCommand; } |
(...skipping 14 matching lines...) Expand all Loading... |
129 // was opened with a backward delete. | 129 // was opened with a backward delete. |
130 bool m_openedByBackwardDelete; | 130 bool m_openedByBackwardDelete; |
131 | 131 |
132 bool m_shouldRetainAutocorrectionIndicator; | 132 bool m_shouldRetainAutocorrectionIndicator; |
133 bool m_shouldPreventSpellChecking; | 133 bool m_shouldPreventSpellChecking; |
134 }; | 134 }; |
135 | 135 |
136 } // namespace blink | 136 } // namespace blink |
137 | 137 |
138 #endif // TypingCommand_h | 138 #endif // TypingCommand_h |
OLD | NEW |