OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 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 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
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 EditCommand_h | 26 #ifndef EditCommand_h |
27 #define EditCommand_h | 27 #define EditCommand_h |
28 | 28 |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "core/editing/VisibleSelection.h" | 30 #include "core/editing/VisibleSelection.h" |
31 #include "core/editing/commands/EditAction.h" | 31 #include "core/events/InputEvent.h" |
32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class CompositeEditCommand; | 36 class CompositeEditCommand; |
37 class Document; | 37 class Document; |
38 class EditingState; | 38 class EditingState; |
39 | 39 |
40 class CORE_EXPORT EditCommand : public GarbageCollectedFinalized<EditCommand> { | 40 class CORE_EXPORT EditCommand : public GarbageCollectedFinalized<EditCommand> { |
41 public: | 41 public: |
42 virtual ~EditCommand(); | 42 virtual ~EditCommand(); |
43 | 43 |
44 void setParent(CompositeEditCommand*); | 44 void setParent(CompositeEditCommand*); |
45 | 45 |
46 virtual EditAction editingAction() const; | 46 virtual InputEvent::InputType inputType() const; |
47 | 47 |
48 const VisibleSelection& startingSelection() const { return m_startingSelecti
on; } | 48 const VisibleSelection& startingSelection() const { return m_startingSelecti
on; } |
49 const VisibleSelection& endingSelection() const { return m_endingSelection;
} | 49 const VisibleSelection& endingSelection() const { return m_endingSelection;
} |
50 | 50 |
51 virtual bool isSimpleEditCommand() const { return false; } | 51 virtual bool isSimpleEditCommand() const { return false; } |
52 virtual bool isCompositeEditCommand() const { return false; } | 52 virtual bool isCompositeEditCommand() const { return false; } |
53 bool isTopLevelCommand() const { return !m_parent; } | 53 bool isTopLevelCommand() const { return !m_parent; } |
54 | 54 |
55 // The |EditingState*| argument must not be nullptr. | 55 // The |EditingState*| argument must not be nullptr. |
56 virtual void doApply(EditingState*) = 0; | 56 virtual void doApply(EditingState*) = 0; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 private: | 97 private: |
98 bool isSimpleEditCommand() const final { return true; } | 98 bool isSimpleEditCommand() const final { return true; } |
99 }; | 99 }; |
100 | 100 |
101 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit
Command(), command.isSimpleEditCommand()); | 101 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit
Command(), command.isSimpleEditCommand()); |
102 | 102 |
103 } // namespace blink | 103 } // namespace blink |
104 | 104 |
105 #endif // EditCommand_h | 105 #endif // EditCommand_h |
OLD | NEW |