ModifySelectionListLevel.h [plain text]
#ifndef ModifySelectionListLevel_h
#define ModifySelectionListLevel_h
#include "CompositeEditCommand.h"
namespace WebCore {
class ModifySelectionListLevelCommand : public CompositeEditCommand {
protected:
ModifySelectionListLevelCommand(Document*);
void appendSiblingNodeRange(Node* startNode, Node* endNode, Element* newParent);
void insertSiblingNodeRangeBefore(Node* startNode, Node* endNode, Node* refNode);
void insertSiblingNodeRangeAfter(Node* startNode, Node* endNode, Node* refNode);
private:
virtual bool preservesTypingStyle() const;
};
class IncreaseSelectionListLevelCommand : public ModifySelectionListLevelCommand {
public:
static bool canIncreaseSelectionListLevel(Document*);
static PassRefPtr<Node> increaseSelectionListLevel(Document*);
static PassRefPtr<Node> increaseSelectionListLevelOrdered(Document*);
static PassRefPtr<Node> increaseSelectionListLevelUnordered(Document*);
private:
enum Type { InheritedListType, OrderedList, UnorderedList };
static PassRefPtr<Node> increaseSelectionListLevel(Document*, Type);
static PassRefPtr<IncreaseSelectionListLevelCommand> create(Document* document, Type type)
{
return adoptRef(new IncreaseSelectionListLevelCommand(document, type));
}
IncreaseSelectionListLevelCommand(Document*, Type);
virtual void doApply();
Type m_listType;
RefPtr<Node> m_listElement;
};
class DecreaseSelectionListLevelCommand : public ModifySelectionListLevelCommand {
public:
static bool canDecreaseSelectionListLevel(Document*);
static void decreaseSelectionListLevel(Document*);
private:
static PassRefPtr<DecreaseSelectionListLevelCommand> create(Document* document)
{
return adoptRef(new DecreaseSelectionListLevelCommand(document));
}
DecreaseSelectionListLevelCommand(Document*);
virtual void doApply();
};
}
#endif // ModifySelectionListLevel_h