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 JSTestInterface_h
22#define JSTestInterface_h
23
24#if ENABLE(Condition1) || ENABLE(Condition2)
25
26#include "JSDOMBinding.h"
27#include "TestInterface.h"
28#include <runtime/JSGlobalObject.h>
29#include <runtime/JSObject.h>
30#include <runtime/ObjectPrototype.h>
31
32namespace WebCore {
33
34class JSTestInterface : public JSDOMWrapper {
35public:
36    typedef JSDOMWrapper Base;
37    static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
38    {
39        JSTestInterface* ptr = new (NotNull, JSC::allocateCell<JSTestInterface>(globalObject->vm().heap)) JSTestInterface(structure, globalObject, impl);
40        ptr->finishCreation(globalObject->vm());
41        return ptr;
42    }
43
44    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
45    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
46    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
47    static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
48    static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
49    bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
50    static void destroy(JSC::JSCell*);
51    ~JSTestInterface();
52    static const JSC::ClassInfo s_info;
53
54    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
55    {
56        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
57    }
58
59    static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
60
61    // Custom attributes
62#if ENABLE(Condition11) || ENABLE(Condition12)
63    JSC::JSValue supplementalStr3(JSC::ExecState*) const;
64#endif
65#if ENABLE(Condition11) || ENABLE(Condition12)
66    void setSupplementalStr3(JSC::ExecState*, JSC::JSValue);
67#endif
68
69    // Custom functions
70#if ENABLE(Condition11) || ENABLE(Condition12)
71    JSC::JSValue supplementalMethod3(JSC::ExecState*);
72#endif
73    TestInterface* impl() const { return m_impl; }
74    void releaseImpl() { m_impl->deref(); m_impl = 0; }
75
76    void releaseImplIfNotNull()
77    {
78        if (m_impl) {
79            m_impl->deref();
80            m_impl = 0;
81        }
82    }
83
84private:
85    TestInterface* m_impl;
86protected:
87    JSTestInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestInterface>);
88    void finishCreation(JSC::VM&);
89    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags;
90};
91
92class JSTestInterfaceOwner : public JSC::WeakHandleOwner {
93public:
94    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
95    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
96};
97
98inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestInterface*)
99{
100    DEFINE_STATIC_LOCAL(JSTestInterfaceOwner, jsTestInterfaceOwner, ());
101    return &jsTestInterfaceOwner;
102}
103
104inline void* wrapperContext(DOMWrapperWorld* world, TestInterface*)
105{
106    return world;
107}
108
109JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
110TestInterface* toTestInterface(JSC::JSValue);
111
112class JSTestInterfacePrototype : public JSC::JSNonFinalObject {
113public:
114    typedef JSC::JSNonFinalObject Base;
115    static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
116    static JSTestInterfacePrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
117    {
118        JSTestInterfacePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestInterfacePrototype>(vm.heap)) JSTestInterfacePrototype(vm, globalObject, structure);
119        ptr->finishCreation(vm);
120        return ptr;
121    }
122
123    static const JSC::ClassInfo s_info;
124    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
125    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
126    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
127    {
128        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
129    }
130
131private:
132    JSTestInterfacePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { }
133protected:
134    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
135};
136
137class JSTestInterfaceConstructor : public DOMConstructorObject {
138private:
139    JSTestInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*);
140    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
141
142public:
143    typedef DOMConstructorObject Base;
144    static JSTestInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
145    {
146        JSTestInterfaceConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(structure, globalObject);
147        ptr->finishCreation(exec, globalObject);
148        return ptr;
149    }
150
151    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
152    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
153    static const JSC::ClassInfo s_info;
154    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
155    {
156        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
157    }
158protected:
159    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
160    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestInterface(JSC::ExecState*);
161#if ENABLE(TEST_INTERFACE)
162    static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
163#endif // ENABLE(TEST_INTERFACE)
164};
165
166// Functions
167
168#if ENABLE(Condition11) || ENABLE(Condition12)
169JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(JSC::ExecState*);
170#endif
171#if ENABLE(Condition11) || ENABLE(Condition12)
172JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(JSC::ExecState*);
173#endif
174#if ENABLE(Condition11) || ENABLE(Condition12)
175JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(JSC::ExecState*);
176#endif
177#if ENABLE(Condition11) || ENABLE(Condition12)
178JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(JSC::ExecState*);
179#endif
180// Attributes
181
182#if ENABLE(Condition11) || ENABLE(Condition12)
183JSC::JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
184#endif
185#if ENABLE(Condition11) || ENABLE(Condition12)
186JSC::JSValue jsTestInterfaceConstructorSupplementalStaticAttr(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
187void setJSTestInterfaceConstructorSupplementalStaticAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
188#endif
189#if ENABLE(Condition11) || ENABLE(Condition12)
190JSC::JSValue jsTestInterfaceSupplementalStr1(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
191#endif
192#if ENABLE(Condition11) || ENABLE(Condition12)
193JSC::JSValue jsTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
194void setJSTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
195#endif
196#if ENABLE(Condition11) || ENABLE(Condition12)
197JSC::JSValue jsTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
198void setJSTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
199#endif
200#if ENABLE(Condition11) || ENABLE(Condition12)
201JSC::JSValue jsTestInterfaceSupplementalNode(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
202void setJSTestInterfaceSupplementalNode(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
203#endif
204JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
205// Constants
206
207#if ENABLE(Condition11) || ENABLE(Condition12)
208JSC::JSValue jsTestInterfaceSUPPLEMENTALCONSTANT1(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
209#endif
210#if ENABLE(Condition11) || ENABLE(Condition12)
211JSC::JSValue jsTestInterfaceSUPPLEMENTALCONSTANT2(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
212#endif
213
214} // namespace WebCore
215
216#endif // ENABLE(Condition1) || ENABLE(Condition2)
217
218#endif
219