InsertParagraphSeparatorCommand.h [plain text]
#ifndef InsertParagraphSeparatorCommand_h
#define InsertParagraphSeparatorCommand_h
#include "CompositeEditCommand.h"
namespace WebCore {
class EditingStyle;
class InsertParagraphSeparatorCommand : public CompositeEditCommand {
public:
static Ref<InsertParagraphSeparatorCommand> create(Document& document, bool useDefaultParagraphElement = false, bool pasteBlockqutoeIntoUnquotedArea = false, EditAction editingAction = EditActionInsert)
{
return adoptRef(*new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement, pasteBlockqutoeIntoUnquotedArea, editingAction));
}
private:
InsertParagraphSeparatorCommand(Document&, bool useDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea, EditAction);
virtual void doApply();
void calculateStyleBeforeInsertion(const Position&);
void applyStyleAfterInsertion(Node* originalEnclosingBlock);
void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, Vector<RefPtr<Element>>& ancestors);
RefPtr<Element> cloneHierarchyUnderNewBlock(const Vector<RefPtr<Element>>& ancestors, PassRefPtr<Element> blockToInsert);
bool shouldUseDefaultParagraphElement(Node*) const;
virtual bool preservesTypingStyle() const;
RefPtr<EditingStyle> m_style;
bool m_mustUseDefaultParagraphElement;
bool m_pasteBlockqutoeIntoUnquotedArea;
};
}
#endif