#ifndef DOMEditor_h
#define DOMEditor_h
#include "ExceptionCode.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
class Element;
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, ExceptionCode&);
bool removeChild(Node* parentNode, Node*, ExceptionCode&);
bool setAttribute(Element*, const String& name, const String& value, ExceptionCode&);
bool removeAttribute(Element*, const String& name, ExceptionCode&);
bool setOuterHTML(Node&, const String& html, Node** newNode, ExceptionCode&);
bool replaceWholeText(Text*, const String& text, ExceptionCode&);
bool replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionCode&);
bool setNodeValue(Node* parentNode, const String& value, ExceptionCode&);
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 // !defined(DOMEditor_h)