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 "JSDOMWrapper.h"
27#include "TestInterface.h"
28
29namespace WebCore {
30
31class JSTestInterface : public JSDOMWrapper {
32public:
33    typedef JSDOMWrapper Base;
34    static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
35    {
36        JSTestInterface* ptr = new (NotNull, JSC::allocateCell<JSTestInterface>(globalObject->vm().heap)) JSTestInterface(structure, globalObject, impl);
37        ptr->finishCreation(globalObject->vm());
38        return ptr;
39    }
40
41    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
42    static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
43    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
44    static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
45    static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
46    bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
47    static void destroy(JSC::JSCell*);
48    ~JSTestInterface();
49
50    DECLARE_INFO;
51
52    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
53    {
54        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
55    }
56
57    static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
58
59    // Custom attributes
60#if ENABLE(Condition22) || ENABLE(Condition23)
61    JSC::JSValue implementsStr3(JSC::ExecState*) const;
62#endif
63#if ENABLE(Condition22) || ENABLE(Condition23)
64    void setImplementsStr3(JSC::ExecState*, JSC::JSValue);
65#endif
66#if ENABLE(Condition11) || ENABLE(Condition12)
67    JSC::JSValue supplementalStr3(JSC::ExecState*) const;
68#endif
69#if ENABLE(Condition11) || ENABLE(Condition12)
70    void setSupplementalStr3(JSC::ExecState*, JSC::JSValue);
71#endif
72
73    // Custom functions
74#if ENABLE(Condition22) || ENABLE(Condition23)
75    JSC::JSValue implementsMethod3(JSC::ExecState*);
76#endif
77#if ENABLE(Condition11) || ENABLE(Condition12)
78    JSC::JSValue supplementalMethod3(JSC::ExecState*);
79#endif
80    TestInterface& impl() const { return *m_impl; }
81    void releaseImpl() { m_impl->deref(); m_impl = 0; }
82
83    void releaseImplIfNotNull()
84    {
85        if (m_impl) {
86            m_impl->deref();
87            m_impl = 0;
88        }
89    }
90
91private:
92    TestInterface* m_impl;
93protected:
94    JSTestInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestInterface>);
95
96    void finishCreation(JSC::VM& vm)
97    {
98        Base::finishCreation(vm);
99        ASSERT(inherits(info()));
100    }
101
102    static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
103};
104
105class JSTestInterfaceOwner : public JSC::WeakHandleOwner {
106public:
107    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
108    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
109};
110
111inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestInterface*)
112{
113    DEPRECATED_DEFINE_STATIC_LOCAL(JSTestInterfaceOwner, jsTestInterfaceOwner, ());
114    return &jsTestInterfaceOwner;
115}
116
117inline void* wrapperContext(DOMWrapperWorld& world, TestInterface*)
118{
119    return &world;
120}
121
122JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
123TestInterface* toTestInterface(JSC::JSValue);
124
125
126} // namespace WebCore
127
128#endif // ENABLE(Condition1) || ENABLE(Condition2)
129
130#endif
131