#ifndef DOMEditor_h
#define DOMEditor_h
#include "wtf/text/WTFString.h"
namespace WebCore {
class Element;
class ExceptionState;
class InspectorHistory;
class Node;
class Text;
typedef String ErrorString;
class DOMEditor {
WTF_MAKE_NONCOPYABLE(DOMEditor); WTF_MAKE_FAST_ALLOCATED;
public:
explicit DOMEditor(InspectorHistory*);
~DOMEditor();
bool insertBefore(Node* parentNode, PassRefPtr<Node>, Node* anchorNode, ExceptionState&);
bool removeChild(Node* parentNode, Node*, ExceptionState&);
bool setAttribute(Element*, const String& name, const String& value, ExceptionState&);
bool removeAttribute(Element*, const String& name, ExceptionState&);
bool setOuterHTML(Node*, const String& html, Node** newNode, ExceptionState&);
bool replaceWholeText(Text*, const String& text, ExceptionState&);
bool replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionState&);
bool setNodeValue(Node* parentNode, const String& value, ExceptionState&);
bool insertBefore(Node* parentNode, PassRefPtr<Node>, Node* anchorNode, ErrorString*);
bool removeChild(Node* parentNode, Node*, ErrorString*);
bool setAttribute(Element*, const String& name, const String& value, ErrorString*);
bool removeAttribute(Element*, const String& name, ErrorString*);
bool setOuterHTML(Node*, const String& html, Node** newNode, ErrorString*);
bool replaceWholeText(Text*, const String& text, ErrorString*);
private:
class DOMAction;
class RemoveChildAction;
class InsertBeforeAction;
class RemoveAttributeAction;
class SetAttributeAction;
class SetOuterHTMLAction;
class ReplaceWholeTextAction;
class ReplaceChildNodeAction;
class SetNodeValueAction;
InspectorHistory* m_history;
};
}
#endif