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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 virtual bool isSimpleEditCommand() const { return false; } | 49 virtual bool isSimpleEditCommand() const { return false; } |
50 virtual bool isCompositeEditCommand() const { return false; } | 50 virtual bool isCompositeEditCommand() const { return false; } |
51 bool isTopLevelCommand() const { return !m_parent; } | 51 bool isTopLevelCommand() const { return !m_parent; } |
52 | 52 |
53 virtual void doApply() = 0; | 53 virtual void doApply() = 0; |
54 | 54 |
55 virtual void trace(Visitor*); | 55 virtual void trace(Visitor*); |
56 | 56 |
57 protected: | 57 protected: |
58 explicit EditCommand(Document&); | 58 explicit EditCommand(Document&); |
59 EditCommand(Document*, const VisibleSelection&, const VisibleSelection&); | |
60 | 59 |
61 Document& document() const { return *m_document.get(); } | 60 Document& document() const { return *m_document.get(); } |
62 CompositeEditCommand* parent() const { return m_parent; } | 61 CompositeEditCommand* parent() const { return m_parent; } |
63 void setStartingSelection(const VisibleSelection&); | 62 void setStartingSelection(const VisibleSelection&); |
64 void setStartingSelection(const VisiblePosition&); | |
65 void setEndingSelection(const VisibleSelection&); | 63 void setEndingSelection(const VisibleSelection&); |
66 void setEndingSelection(const VisiblePosition&); | 64 void setEndingSelection(const VisiblePosition&); |
67 | 65 |
68 private: | 66 private: |
69 RefPtrWillBeMember<Document> m_document; | 67 RefPtrWillBeMember<Document> m_document; |
70 VisibleSelection m_startingSelection; | 68 VisibleSelection m_startingSelection; |
71 VisibleSelection m_endingSelection; | 69 VisibleSelection m_endingSelection; |
72 RawPtrWillBeMember<CompositeEditCommand> m_parent; | 70 RawPtrWillBeMember<CompositeEditCommand> m_parent; |
73 }; | 71 }; |
74 | 72 |
(...skipping 12 matching lines...) Expand all Loading... |
87 | 85 |
88 private: | 86 private: |
89 virtual bool isSimpleEditCommand() const override final { return true; } | 87 virtual bool isSimpleEditCommand() const override final { return true; } |
90 }; | 88 }; |
91 | 89 |
92 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit
Command(), command.isSimpleEditCommand()); | 90 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit
Command(), command.isSimpleEditCommand()); |
93 | 91 |
94 } // namespace blink | 92 } // namespace blink |
95 | 93 |
96 #endif // EditCommand_h | 94 #endif // EditCommand_h |
OLD | NEW |