Rubber stamped by hyatt.
[WebKit-https.git] / JavaScriptGlue / JSObject.h
1 //
2 // JSObject.h
3 //
4
5 #ifndef __JSObject_h
6 #define __JSObject_h
7
8 #include "JSBase.h"
9 #include "JSUtils.h"
10
11 typedef void (*JSObjectMarkProcPtr)(void* data);
12 JSObjectRef JSObjectCreateInternal(void* data, JSObjectCallBacksPtr callBacks, JSObjectMarkProcPtr markProc, int dataType);
13
14 class JSUserObject : public JSBase {
15         public:
16 //              JSUserObject(JSObjectCallBacksPtr callBacks, JSObjectMarkProcPtr markProc, void* data, int dataType = kJSUserObjectDataTypeUnknown);
17                 JSUserObject(JSObjectCallBacksPtr callBacks, JSObjectMarkProcPtr markProc, void* data, int dataType);
18                 virtual ~JSUserObject();
19                 
20                 CFArrayRef CopyPropertyNames(void);
21                 JSUserObject* CopyProperty(CFStringRef propertyName);
22                 void SetProperty(CFStringRef propertyName, JSUserObject* value);
23                 bool ImplementsCall();
24                 JSUserObject* CallFunction(JSUserObject* thisObj, CFArrayRef args);
25                 CFTypeRef CopyCFValue() const;
26                 virtual UInt8 Equal(JSBase* other);
27                 void* GetData();
28                 void Mark();
29                 
30                 int DataType() const { return fDataType; }
31         private:
32                 JSObjectCallBacks fCallBacks;
33                 JSObjectMarkProcPtr fMarkProc;
34                 void* fData;
35                 int fDataType;
36 };
37
38 #endif