OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SetCharacterDataCommand_h |
| 6 #define SetCharacterDataCommand_h |
| 7 |
| 8 #include "core/editing/commands/EditCommand.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class CORE_EXPORT SetCharacterDataCommand final : public SimpleEditCommand { |
| 13 public: |
| 14 static SetCharacterDataCommand* create(Text* node, |
| 15 unsigned offset, |
| 16 unsigned count, |
| 17 const String& text) { |
| 18 return new SetCharacterDataCommand(node, offset, count, text); |
| 19 } |
| 20 |
| 21 DECLARE_VIRTUAL_TRACE(); |
| 22 |
| 23 private: |
| 24 SetCharacterDataCommand(Text* node, |
| 25 unsigned offset, |
| 26 unsigned count, |
| 27 const String& text); |
| 28 |
| 29 // EditCommand implementation |
| 30 void doApply(EditingState*) final; |
| 31 void doUnapply() final; |
| 32 |
| 33 const Member<Text> m_node; |
| 34 const unsigned m_offset; |
| 35 const unsigned m_count; |
| 36 String m_previousTextForUndo; |
| 37 const String m_newText; |
| 38 }; |
| 39 |
| 40 } // namespace blink |
| 41 |
| 42 #endif // SetCharacterDataCommand_h |
OLD | NEW |