ObjCCallbackFunction.h [plain text]
#ifndef ObjCCallbackFunction_h
#define ObjCCallbackFunction_h
#include <JavaScriptCore/JSBase.h>
#if JSC_OBJC_API_ENABLED
#import <JavaScriptCore/JSCallbackFunction.h>
#if defined(__OBJC__)
JSObjectRef objCCallbackFunctionForMethod(JSContext *, Class, Protocol *, BOOL isInstanceMethod, SEL, const char* types);
JSObjectRef objCCallbackFunctionForBlock(JSContext *, id);
id tryUnwrapBlock(JSObjectRef);
#endif
namespace JSC {
class ObjCCallbackFunctionImpl;
class ObjCCallbackFunction : public JSCallbackFunction {
public:
typedef JSCallbackFunction Base;
static ObjCCallbackFunction* create(ExecState*, JSGlobalObject*, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl>);
static void destroy(JSCell*);
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
ASSERT(globalObject);
return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
}
static JS_EXPORTDATA const ClassInfo s_info;
ObjCCallbackFunctionImpl* impl() { return m_impl.get(); }
protected:
ObjCCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback, PassOwnPtr<ObjCCallbackFunctionImpl>);
private:
OwnPtr<ObjCCallbackFunctionImpl> m_impl;
};
}
#endif
#endif // ObjCCallbackFunction_h