#ifndef _KJS_RANGE_H_
#define _KJS_RANGE_H_
#include "ecma/kjs_dom.h"
#include "dom/dom2_range.h"
namespace KJS {
class DOMRange : public DOMObject {
public:
DOMRange(ExecState *exec, DOM::Range r);
~DOMRange();
virtual Value tryGet(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *exec, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { StartContainer, StartOffset, EndContainer, EndOffset, Collapsed,
CommonAncestorContainer,
SetStart, SetEnd, SetStartBefore, SetStartAfter, SetEndBefore,
SetEndAfter, Collapse, SelectNode, SelectNodeContents,
CompareBoundaryPoints, DeleteContents, ExtractContents,
CloneContents, InsertNode, SurroundContents, CloneRange, ToString,
Detach, CreateContextualFragment };
DOM::Range toRange() const { return range; }
protected:
DOM::Range range;
};
class RangeConstructor : public DOMObject {
public:
RangeConstructor(ExecState *) { }
virtual Value tryGet(ExecState *exec,const Identifier &p) const;
Value getValueProperty(ExecState *, int token) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
Value getDOMRange(ExecState *exec, DOM::Range r);
Value getRangeConstructor(ExecState *exec);
DOM::Range toRange(const Value&);
};
#endif