1/*
2    This file is part of the WebKit open source project.
3    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License as published by the Free Software Foundation; either
8    version 2 of the License, or (at your option) any later version.
9
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public License
16    along with this library; see the file COPYING.LIB.  If not, write to
17    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18    Boston, MA 02110-1301, USA.
19*/
20
21#ifndef JSTestEventTarget_h
22#define JSTestEventTarget_h
23
24#include "JSDOMBinding.h"
25#include "TestEventTarget.h"
26#include <runtime/JSGlobalObject.h>
27#include <runtime/JSObject.h>
28#include <runtime/ObjectPrototype.h>
29
30namespace WebCore {
31
32class JSTestEventTarget : public JSDOMWrapper {
33public:
34    typedef JSDOMWrapper Base;
35    static JSTestEventTarget* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestEventTarget> impl)
36    {
37        globalObject->masqueradesAsUndefinedWatchpoint()->notifyWrite();
38        JSTestEventTarget* ptr = new (NotNull, JSC::allocateCell<JSTestEventTarget>(globalObject->vm().heap)) JSTestEventTarget(structure, globalObject, impl);
39        ptr->finishCreation(globalObject->vm());
40        return ptr;
41    }
42
43    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
44    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
45    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
46    static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
47    static void destroy(JSC::JSCell*);
48    ~JSTestEventTarget();
49    static const JSC::ClassInfo s_info;
50
51    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
52    {
53        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
54    }
55
56    static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
57    static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
58    static void visitChildren(JSCell*, JSC::SlotVisitor&);
59
60    TestEventTarget* impl() const { return m_impl; }
61    void releaseImpl() { m_impl->deref(); m_impl = 0; }
62
63    void releaseImplIfNotNull()
64    {
65        if (m_impl) {
66            m_impl->deref();
67            m_impl = 0;
68        }
69    }
70
71private:
72    TestEventTarget* m_impl;
73protected:
74    JSTestEventTarget(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestEventTarget>);
75    void finishCreation(JSC::VM&);
76    static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesVisitChildren | JSC::MasqueradesAsUndefined | JSC::HasImpureGetOwnPropertySlot | Base::StructureFlags;
77    static JSC::JSValue indexGetter(JSC::ExecState*, JSC::JSValue, unsigned);
78private:
79    static bool canGetItemsForName(JSC::ExecState*, TestEventTarget*, JSC::PropertyName);
80    static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
81};
82
83class JSTestEventTargetOwner : public JSC::WeakHandleOwner {
84public:
85    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
86    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
87};
88
89inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestEventTarget*)
90{
91    DEFINE_STATIC_LOCAL(JSTestEventTargetOwner, jsTestEventTargetOwner, ());
92    return &jsTestEventTargetOwner;
93}
94
95inline void* wrapperContext(DOMWrapperWorld* world, TestEventTarget*)
96{
97    return world;
98}
99
100JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*);
101TestEventTarget* toTestEventTarget(JSC::JSValue);
102
103class JSTestEventTargetPrototype : public JSC::JSNonFinalObject {
104public:
105    typedef JSC::JSNonFinalObject Base;
106    static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
107    static JSTestEventTargetPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
108    {
109        JSTestEventTargetPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestEventTargetPrototype>(vm.heap)) JSTestEventTargetPrototype(vm, globalObject, structure);
110        ptr->finishCreation(vm);
111        return ptr;
112    }
113
114    static const JSC::ClassInfo s_info;
115    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
116    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
117    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
118    {
119        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
120    }
121
122private:
123    JSTestEventTargetPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { }
124protected:
125    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
126};
127
128class JSTestEventTargetConstructor : public DOMConstructorObject {
129private:
130    JSTestEventTargetConstructor(JSC::Structure*, JSDOMGlobalObject*);
131    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
132
133public:
134    typedef DOMConstructorObject Base;
135    static JSTestEventTargetConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
136    {
137        JSTestEventTargetConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestEventTargetConstructor>(*exec->heap())) JSTestEventTargetConstructor(structure, globalObject);
138        ptr->finishCreation(exec, globalObject);
139        return ptr;
140    }
141
142    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
143    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
144    static const JSC::ClassInfo s_info;
145    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
146    {
147        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
148    }
149protected:
150    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
151};
152
153// Functions
154
155JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(JSC::ExecState*);
156JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(JSC::ExecState*);
157JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListener(JSC::ExecState*);
158JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(JSC::ExecState*);
159// Attributes
160
161JSC::JSValue jsTestEventTargetConstructor(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
162
163} // namespace WebCore
164
165#endif
166