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