| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 class EditingStyle; | 38 class EditingStyle; |
| 39 class Element; | 39 class Element; |
| 40 class HTMLBRElement; | 40 class HTMLBRElement; |
| 41 class HTMLElement; | 41 class HTMLElement; |
| 42 class HTMLSpanElement; | 42 class HTMLSpanElement; |
| 43 class Text; | 43 class Text; |
| 44 | 44 |
| 45 class EditCommandComposition final : public UndoStep { | 45 class EditCommandComposition final : public UndoStep { |
| 46 public: | 46 public: |
| 47 static EditCommandComposition* create(Document*, const VisibleSelection&, co
nst VisibleSelection&, EditAction); | 47 static EditCommandComposition* create(Document*, const VisibleSelection&, co
nst VisibleSelection&, InputEvent::InputType); |
| 48 | 48 |
| 49 bool belongsTo(const LocalFrame&) const override; | 49 bool belongsTo(const LocalFrame&) const override; |
| 50 void unapply() override; | 50 void unapply() override; |
| 51 void reapply() override; | 51 void reapply() override; |
| 52 EditAction editingAction() const override { return m_editAction; } | 52 InputEvent::InputType inputType() const override; |
| 53 void append(SimpleEditCommand*); | 53 void append(SimpleEditCommand*); |
| 54 | 54 |
| 55 const VisibleSelection& startingSelection() const { return m_startingSelecti
on; } | 55 const VisibleSelection& startingSelection() const { return m_startingSelecti
on; } |
| 56 const VisibleSelection& endingSelection() const { return m_endingSelection;
} | 56 const VisibleSelection& endingSelection() const { return m_endingSelection;
} |
| 57 void setStartingSelection(const VisibleSelection&); | 57 void setStartingSelection(const VisibleSelection&); |
| 58 void setEndingSelection(const VisibleSelection&); | 58 void setEndingSelection(const VisibleSelection&); |
| 59 Element* startingRootEditableElement() const { return m_startingRootEditable
Element.get(); } | 59 Element* startingRootEditableElement() const { return m_startingRootEditable
Element.get(); } |
| 60 Element* endingRootEditableElement() const { return m_endingRootEditableElem
ent.get(); } | 60 Element* endingRootEditableElement() const { return m_endingRootEditableElem
ent.get(); } |
| 61 | 61 |
| 62 DECLARE_VIRTUAL_TRACE(); | 62 DECLARE_VIRTUAL_TRACE(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 EditCommandComposition(Document*, const VisibleSelection& startingSelection,
const VisibleSelection& endingSelection, EditAction); | 65 EditCommandComposition(Document*, const VisibleSelection& startingSelection,
const VisibleSelection& endingSelection, InputEvent::InputType); |
| 66 | 66 |
| 67 Member<Document> m_document; | 67 Member<Document> m_document; |
| 68 VisibleSelection m_startingSelection; | 68 VisibleSelection m_startingSelection; |
| 69 VisibleSelection m_endingSelection; | 69 VisibleSelection m_endingSelection; |
| 70 HeapVector<Member<SimpleEditCommand>> m_commands; | 70 HeapVector<Member<SimpleEditCommand>> m_commands; |
| 71 Member<Element> m_startingRootEditableElement; | 71 Member<Element> m_startingRootEditableElement; |
| 72 Member<Element> m_endingRootEditableElement; | 72 Member<Element> m_endingRootEditableElement; |
| 73 EditAction m_editAction; | 73 InputEvent::InputType m_inputType; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 class CORE_EXPORT CompositeEditCommand : public EditCommand { | 76 class CORE_EXPORT CompositeEditCommand : public EditCommand { |
| 77 public: | 77 public: |
| 78 enum ShouldPreserveSelection { PreserveSelection, DoNotPreserveSelection }; | 78 enum ShouldPreserveSelection { PreserveSelection, DoNotPreserveSelection }; |
| 79 enum ShouldPreserveStyle { PreserveStyle, DoNotPreserveStyle }; | 79 enum ShouldPreserveStyle { PreserveStyle, DoNotPreserveStyle }; |
| 80 | 80 |
| 81 ~CompositeEditCommand() override; | 81 ~CompositeEditCommand() override; |
| 82 | 82 |
| 83 // Returns |false| if the command failed. e.g. It's aborted. | 83 // Returns |false| if the command failed. e.g. It's aborted. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool isCompositeEditCommand() const final { return true; } | 179 bool isCompositeEditCommand() const final { return true; } |
| 180 | 180 |
| 181 Member<EditCommandComposition> m_composition; | 181 Member<EditCommandComposition> m_composition; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi
teEditCommand(), command.isCompositeEditCommand()); | 184 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi
teEditCommand(), command.isCompositeEditCommand()); |
| 185 | 185 |
| 186 } // namespace blink | 186 } // namespace blink |
| 187 | 187 |
| 188 #endif // CompositeEditCommand_h | 188 #endif // CompositeEditCommand_h |
| OLD | NEW |