Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: Source/core/editing/CompositeEditCommand.h

Issue 424493003: Use tighter typing in editing: CompositeEditCommand (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 17 matching lines...) Expand all
28 28
29 #include "core/CSSPropertyNames.h" 29 #include "core/CSSPropertyNames.h"
30 #include "core/editing/EditCommand.h" 30 #include "core/editing/EditCommand.h"
31 #include "core/editing/UndoStep.h" 31 #include "core/editing/UndoStep.h"
32 #include "wtf/Vector.h" 32 #include "wtf/Vector.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class EditingStyle; 36 class EditingStyle;
37 class Element; 37 class Element;
38 class HTMLBRElement;
38 class HTMLElement; 39 class HTMLElement;
39 class Text; 40 class Text;
40 41
41 class EditCommandComposition FINAL : public UndoStep { 42 class EditCommandComposition FINAL : public UndoStep {
42 public: 43 public:
43 static PassRefPtrWillBeRawPtr<EditCommandComposition> create(Document*, cons t VisibleSelection&, const VisibleSelection&, EditAction); 44 static PassRefPtrWillBeRawPtr<EditCommandComposition> create(Document*, cons t VisibleSelection&, const VisibleSelection&, EditAction);
44 45
45 virtual bool belongsTo(const LocalFrame&) const OVERRIDE; 46 virtual bool belongsTo(const LocalFrame&) const OVERRIDE;
46 virtual void unapply() OVERRIDE; 47 virtual void unapply() OVERRIDE;
47 virtual void reapply() OVERRIDE; 48 virtual void reapply() OVERRIDE;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value); 135 void setNodeAttribute(PassRefPtrWillBeRawPtr<Element>, const QualifiedName& attribute, const AtomicString& value);
135 void splitElement(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<No de> atChild); 136 void splitElement(PassRefPtrWillBeRawPtr<Element>, PassRefPtrWillBeRawPtr<No de> atChild);
136 void splitTextNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset); 137 void splitTextNode(PassRefPtrWillBeRawPtr<Text>, unsigned offset);
137 void splitTextNodeContainingElement(PassRefPtrWillBeRawPtr<Text>, unsigned o ffset); 138 void splitTextNodeContainingElement(PassRefPtrWillBeRawPtr<Text>, unsigned o ffset);
138 void wrapContentsInDummySpan(PassRefPtrWillBeRawPtr<Element>); 139 void wrapContentsInDummySpan(PassRefPtrWillBeRawPtr<Element>);
139 140
140 void deleteInsignificantText(PassRefPtrWillBeRawPtr<Text>, unsigned start, u nsigned end); 141 void deleteInsignificantText(PassRefPtrWillBeRawPtr<Text>, unsigned start, u nsigned end);
141 void deleteInsignificantText(const Position& start, const Position& end); 142 void deleteInsignificantText(const Position& start, const Position& end);
142 void deleteInsignificantTextDownstream(const Position&); 143 void deleteInsignificantTextDownstream(const Position&);
143 144
144 PassRefPtrWillBeRawPtr<Node> appendBlockPlaceholder(PassRefPtrWillBeRawPtr<E lement>); 145 PassRefPtrWillBeRawPtr<HTMLBRElement> appendBlockPlaceholder(PassRefPtrWillB eRawPtr<Element>);
145 PassRefPtrWillBeRawPtr<Node> insertBlockPlaceholder(const Position&); 146 PassRefPtrWillBeRawPtr<HTMLBRElement> insertBlockPlaceholder(const Position& );
146 PassRefPtrWillBeRawPtr<Node> addBlockPlaceholderIfNeeded(Element*); 147 PassRefPtrWillBeRawPtr<HTMLBRElement> addBlockPlaceholderIfNeeded(Element*);
147 void removePlaceholderAt(const Position&); 148 void removePlaceholderAt(const Position&);
148 149
149 PassRefPtrWillBeRawPtr<Element> insertNewDefaultParagraphElementAt(const Pos ition&); 150 PassRefPtrWillBeRawPtr<HTMLElement> insertNewDefaultParagraphElementAt(const Position&);
150 151
151 PassRefPtrWillBeRawPtr<Element> moveParagraphContentsToNewBlockIfNecessary(c onst Position&); 152 PassRefPtrWillBeRawPtr<HTMLElement> moveParagraphContentsToNewBlockIfNecessa ry(const Position&);
152 153
153 void pushAnchorElementDown(Node*); 154 void pushAnchorElementDown(Element*);
154 155
155 // FIXME: preserveSelection and preserveStyle should be enums 156 // FIXME: preserveSelection and preserveStyle should be enums
156 void moveParagraph(const VisiblePosition&, const VisiblePosition&, const Vis iblePosition&, bool preserveSelection = false, bool preserveStyle = true, Node* constrainingAncestor = 0); 157 void moveParagraph(const VisiblePosition&, const VisiblePosition&, const Vis iblePosition&, bool preserveSelection = false, bool preserveStyle = true, Node* constrainingAncestor = 0);
157 void moveParagraphs(const VisiblePosition&, const VisiblePosition&, const Vi siblePosition&, bool preserveSelection = false, bool preserveStyle = true, Node* constrainingAncestor = 0); 158 void moveParagraphs(const VisiblePosition&, const VisiblePosition&, const Vi siblePosition&, bool preserveSelection = false, bool preserveStyle = true, Node* constrainingAncestor = 0);
158 void moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, Element* blockElement, Node* outerN ode); 159 void moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, Element* blockElement, Node* outerN ode);
159 void cloneParagraphUnderNewElement(const Position& start, const Position& en d, Node* outerNode, Element* blockElement); 160 void cloneParagraphUnderNewElement(const Position& start, const Position& en d, Node* outerNode, Element* blockElement);
160 void cleanupAfterDeletion(VisiblePosition destination = VisiblePosition()); 161 void cleanupAfterDeletion(VisiblePosition destination = VisiblePosition());
161 162
162 bool breakOutOfEmptyListItem(); 163 bool breakOutOfEmptyListItem();
163 bool breakOutOfEmptyMailBlockquotedParagraph(); 164 bool breakOutOfEmptyMailBlockquotedParagraph();
164 165
165 Position positionAvoidingSpecialElementBoundary(const Position&); 166 Position positionAvoidingSpecialElementBoundary(const Position&);
166 167
167 PassRefPtrWillBeRawPtr<Node> splitTreeToNode(Node*, Node*, bool splitAncesto r = false); 168 PassRefPtrWillBeRawPtr<Node> splitTreeToNode(Node*, Node*, bool splitAncesto r = false);
168 169
169 WillBeHeapVector<RefPtrWillBeMember<EditCommand> > m_commands; 170 WillBeHeapVector<RefPtrWillBeMember<EditCommand> > m_commands;
170 171
171 private: 172 private:
172 virtual bool isCompositeEditCommand() const OVERRIDE FINAL { return true; } 173 virtual bool isCompositeEditCommand() const OVERRIDE FINAL { return true; }
173 174
174 RefPtrWillBeMember<EditCommandComposition> m_composition; 175 RefPtrWillBeMember<EditCommandComposition> m_composition;
175 }; 176 };
176 177
177 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand()); 178 DEFINE_TYPE_CASTS(CompositeEditCommand, EditCommand, command, command->isComposi teEditCommand(), command.isCompositeEditCommand());
178 179
179 } // namespace blink 180 } // namespace blink
180 181
181 #endif // CompositeEditCommand_h 182 #endif // CompositeEditCommand_h
OLDNEW
« no previous file with comments | « Source/core/editing/BreakBlockquoteCommand.cpp ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698