| 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 WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 class TypingCommand : 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 bool smartDelete() const { return m_smartDelete; } | 93 bool smartDelete() const { return m_smartDelete; } |
| 94 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } | 94 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } |
| 95 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } | 95 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } |
| 96 void closeTyping() { m_openForMoreTyping = false; } | 96 void closeTyping() { m_openForMoreTyping = false; } |
| 97 | 97 |
| 98 static PassRefPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(Frame
*); | 98 static PassRefPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(Frame
*); |
| 99 | 99 |
| 100 virtual void doApply(); | 100 virtual void doApply() OVERRIDE; |
| 101 virtual EditAction editingAction() const; | 101 virtual EditAction editingAction() const OVERRIDE; |
| 102 virtual bool isTypingCommand() const; | 102 virtual bool isTypingCommand() const OVERRIDE; |
| 103 virtual bool preservesTypingStyle() const { return m_preservesTypingStyle; } | 103 virtual bool preservesTypingStyle() const OVERRIDE { return m_preservesTypin
gStyle; } |
| 104 virtual bool shouldRetainAutocorrectionIndicator() const | 104 virtual bool shouldRetainAutocorrectionIndicator() const OVERRIDE |
| 105 { | 105 { |
| 106 ASSERT(isTopLevelCommand()); | 106 ASSERT(isTopLevelCommand()); |
| 107 return m_shouldRetainAutocorrectionIndicator; | 107 return m_shouldRetainAutocorrectionIndicator; |
| 108 } | 108 } |
| 109 virtual void setShouldRetainAutocorrectionIndicator(bool retain) { m_shouldR
etainAutocorrectionIndicator = retain; } | 109 virtual void setShouldRetainAutocorrectionIndicator(bool retain) OVERRIDE {
m_shouldRetainAutocorrectionIndicator = retain; } |
| 110 virtual bool shouldStopCaretBlinking() const { return true; } | 110 virtual bool shouldStopCaretBlinking() const OVERRIDE { return true; } |
| 111 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellCheck
ing = prevent; } | 111 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellCheck
ing = prevent; } |
| 112 | 112 |
| 113 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, F
rame*); | 113 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, F
rame*); |
| 114 | 114 |
| 115 void updatePreservesTypingStyle(ETypingCommand); | 115 void updatePreservesTypingStyle(ETypingCommand); |
| 116 void markMisspellingsAfterTyping(ETypingCommand); | 116 void markMisspellingsAfterTyping(ETypingCommand); |
| 117 void typingAddedToOpenCommand(ETypingCommand); | 117 void typingAddedToOpenCommand(ETypingCommand); |
| 118 bool makeEditableRootEmpty(); | 118 bool makeEditableRootEmpty(); |
| 119 | 119 |
| 120 void updateCommandTypeOfOpenCommand(ETypingCommand typingCommand) { m_comman
dType = typingCommand; } | 120 void updateCommandTypeOfOpenCommand(ETypingCommand typingCommand) { m_comman
dType = typingCommand; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 135 // was opened with a backward delete. | 135 // was opened with a backward delete. |
| 136 bool m_openedByBackwardDelete; | 136 bool m_openedByBackwardDelete; |
| 137 | 137 |
| 138 bool m_shouldRetainAutocorrectionIndicator; | 138 bool m_shouldRetainAutocorrectionIndicator; |
| 139 bool m_shouldPreventSpellChecking; | 139 bool m_shouldPreventSpellChecking; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace WebCore | 142 } // namespace WebCore |
| 143 | 143 |
| 144 #endif // TypingCommand_h | 144 #endif // TypingCommand_h |
| OLD | NEW |