JSCallbackObject.h [plain text]
#ifndef JSCallbackObject_h
#define JSCallbackObject_h
#include "JSObjectRef.h"
#include "JSValueRef.h"
#include "object.h"
namespace KJS {
template <class Base>
class JSCallbackObject : public Base
{
public:
JSCallbackObject(ExecState*, JSClassRef, JSValue* prototype, void* data);
JSCallbackObject(JSClassRef);
virtual ~JSCallbackObject();
virtual UString className() const;
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&);
virtual void put(ExecState*, const Identifier&, JSValue*, int attr);
virtual void put(ExecState*, unsigned, JSValue*, int attr);
virtual bool deleteProperty(ExecState*, const Identifier&);
virtual bool deleteProperty(ExecState*, unsigned);
virtual bool implementsConstruct() const;
virtual JSObject* construct(ExecState*, const List& args);
virtual bool implementsHasInstance() const;
virtual bool hasInstance(ExecState *exec, JSValue *value);
virtual bool implementsCall() const;
virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List &args);
virtual void getPropertyNames(ExecState*, PropertyNameArray&);
virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const;
void setPrivate(void* data);
void* getPrivate();
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
bool inherits(JSClassRef) const;
private:
void init(ExecState*);
static JSValue* cachedValueGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
static JSValue* staticValueGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
static JSValue* staticFunctionGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
static JSValue* callbackGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
void* m_privateData;
JSClassRef m_class;
};
}
#include "JSCallbackObjectFunctions.h"
#endif // JSCallbackObject_h