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 JSTestCustomNamedGetter_h
22#define JSTestCustomNamedGetter_h
23
24#include "JSDOMWrapper.h"
25#include "TestCustomNamedGetter.h"
26
27namespace WebCore {
28
29class JSTestCustomNamedGetter : public JSDOMWrapper {
30public:
31    typedef JSDOMWrapper Base;
32    static JSTestCustomNamedGetter* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestCustomNamedGetter> impl)
33    {
34        JSTestCustomNamedGetter* ptr = new (NotNull, JSC::allocateCell<JSTestCustomNamedGetter>(globalObject->vm().heap)) JSTestCustomNamedGetter(structure, globalObject, impl);
35        ptr->finishCreation(globalObject->vm());
36        return ptr;
37    }
38
39    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
40    static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
41    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
42    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
43    static void destroy(JSC::JSCell*);
44    ~JSTestCustomNamedGetter();
45
46    DECLARE_INFO;
47
48    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
49    {
50        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
51    }
52
53    static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
54    TestCustomNamedGetter& impl() const { return *m_impl; }
55    void releaseImpl() { m_impl->deref(); m_impl = 0; }
56
57    void releaseImplIfNotNull()
58    {
59        if (m_impl) {
60            m_impl->deref();
61            m_impl = 0;
62        }
63    }
64
65private:
66    TestCustomNamedGetter* m_impl;
67protected:
68    JSTestCustomNamedGetter(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestCustomNamedGetter>);
69
70    void finishCreation(JSC::VM& vm)
71    {
72        Base::finishCreation(vm);
73        ASSERT(inherits(info()));
74    }
75
76    static const unsigned StructureFlags = JSC::HasImpureGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
77private:
78    static bool canGetItemsForName(JSC::ExecState*, TestCustomNamedGetter*, JSC::PropertyName);
79    static JSC::EncodedJSValue nameGetter(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
80};
81
82class JSTestCustomNamedGetterOwner : public JSC::WeakHandleOwner {
83public:
84    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
85    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
86};
87
88inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestCustomNamedGetter*)
89{
90    DEPRECATED_DEFINE_STATIC_LOCAL(JSTestCustomNamedGetterOwner, jsTestCustomNamedGetterOwner, ());
91    return &jsTestCustomNamedGetterOwner;
92}
93
94inline void* wrapperContext(DOMWrapperWorld& world, TestCustomNamedGetter*)
95{
96    return &world;
97}
98
99JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter*);
100TestCustomNamedGetter* toTestCustomNamedGetter(JSC::JSValue);
101
102
103} // namespace WebCore
104
105#endif
106