| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 57 | 57 |
| 58 // |TypingCommand| will return the text of the last |m_commands|. |
| 59 virtual String textDataForInputEvent() const; |
| 60 |
| 58 DECLARE_VIRTUAL_TRACE(); | 61 DECLARE_VIRTUAL_TRACE(); |
| 59 | 62 |
| 60 protected: | 63 protected: |
| 61 explicit EditCommand(Document&); | 64 explicit EditCommand(Document&); |
| 62 | 65 |
| 63 Document& document() const { return *m_document.get(); } | 66 Document& document() const { return *m_document.get(); } |
| 64 CompositeEditCommand* parent() const { return m_parent; } | 67 CompositeEditCommand* parent() const { return m_parent; } |
| 65 void setStartingSelection(const VisibleSelection&); | 68 void setStartingSelection(const VisibleSelection&); |
| 66 void setEndingSelection(const VisibleSelection&); | 69 void setEndingSelection(const VisibleSelection&); |
| 67 void setEndingSelection(const VisiblePosition&); | 70 void setEndingSelection(const VisiblePosition&); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 93 | 96 |
| 94 private: | 97 private: |
| 95 bool isSimpleEditCommand() const final { return true; } | 98 bool isSimpleEditCommand() const final { return true; } |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit
Command(), command.isSimpleEditCommand()); | 101 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit
Command(), command.isSimpleEditCommand()); |
| 99 | 102 |
| 100 } // namespace blink | 103 } // namespace blink |
| 101 | 104 |
| 102 #endif // EditCommand_h | 105 #endif // EditCommand_h |
| OLD | NEW |