#ifndef KJS_DOMNODE_H
#define KJS_DOMNODE_H
#include <kjs_binding.h>
#include <kjs/lookup.h>
namespace WebCore {
class JSNode;
}
namespace KJS {
KJS_DEFINE_PROTOTYPE(DOMNodeProto)
class DOMNode : public DOMObject {
public:
virtual ~DOMNode();
virtual bool toBoolean(ExecState*) const;
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
JSValue *getValueProperty(ExecState*, int token) const;
virtual void mark();
virtual void put(ExecState*, const Identifier &propertyName, JSValue*, int attr = None);
void putValueProperty(ExecState*, int token, JSValue*, int attr);
WebCore::Node *impl() const { return m_impl.get(); }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
virtual JSValue *toPrimitive(ExecState*, JSType preferred = UndefinedType) const;
virtual UString toString(ExecState*) const;
enum { NodeName, NodeValue, NodeType, ParentNode, ParentElement,
ChildNodes, FirstChild, LastChild, PreviousSibling, NextSibling, Item,
Attributes, NamespaceURI, Prefix, LocalName, OwnerDocument, InsertBefore,
ReplaceChild, RemoveChild, AppendChild, HasAttributes, HasChildNodes,
CloneNode, Normalize, IsSupported, Contains, IsSameNode, IsEqualNode, TextContent,
IsDefaultNamespace, LookupNamespaceURI, LookupPrefix,
};
protected:
RefPtr<WebCore::Node> m_impl;
private:
friend class WebCore::JSNode;
DOMNode();
DOMNode(ExecState*, WebCore::Node *n);
DOMNode(WebCore::Node *n);
};
}
#endif