KJS-API
kjsprototype.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KJSPROTOTYPE_H
00023 #define KJSPROTOTYPE_H
00024
00025 #include "kjsapi_export.h"
00026 #include "kjscontext.h"
00027
00028 class KJSInterpreter;
00029 class KJSArguments;
00030 class KJSGlobalObject;
00031 class KJSPrototypeHandle;
00032
00038 class KJSAPI_EXPORT KJSPrototype
00039 {
00040 public:
00045 KJSPrototype();
00049 ~KJSPrototype();
00053 void defineConstant(const QString& name, double value);
00059 void defineConstant(const QString& name, const QString& value);
00065 void defineConstant(const QString& name, const KJSObject& value);
00070 typedef KJSObject (*PropertyGetter)(KJSContext* context, void* object);
00075 typedef void (*PropertySetter)(KJSContext* context, void* object,
00076 KJSObject value);
00082 void defineProperty(KJSContext* ctx,
00083 const QString& name,
00084 PropertyGetter getter,
00085 PropertySetter setter = 0);
00086
00092 typedef KJSObject (*FunctionCall)(KJSContext* context, void* object,
00093 const KJSArguments& arguments);
00094
00099 void defineFunction(KJSContext* ctx,
00100 const QString& name, FunctionCall callback);
00101
00102 #if 0
00103
00107 void defineFinalization(FinalizeFunction callback);
00108 #endif
00109
00118 KJSObject constructObject(KJSContext* ctx, void *internalValue = 0);
00119
00124 KJSGlobalObject constructGlobalObject(void *internalValue = 0);
00125
00126 private:
00127 KJSPrototype(const KJSPrototype&);
00128 KJSPrototype& operator=(const KJSPrototype&);
00129
00130 KJSPrototypeHandle* hnd;
00131 };
00132
00133 #endif