tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSStorage.h
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 JSStorage_h
22 #define JSStorage_h
23
24 #include "JSDOMBinding.h"
25 #include "Storage.h"
26 #include <runtime/JSGlobalObject.h>
27 #include <runtime/JSObject.h>
28 #include <runtime/ObjectPrototype.h>
29
30 namespace WebCore {
31
32 class JSStorage : public JSDOMWrapper {
33 public:
34     typedef JSDOMWrapper Base;
35     static JSStorage* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Storage> impl)
36     {
37         JSStorage* ptr = new (JSC::allocateCell<JSStorage>(globalObject->globalData().heap)) JSStorage(structure, globalObject, impl);
38         ptr->finishCreation(globalObject->globalData());
39         return ptr;
40     }
41
42     static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
43     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
44     static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
45     static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
46     bool putDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSC::PutPropertySlot&);
47     static const JSC::ClassInfo s_info;
48
49     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
50     {
51         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
52     }
53
54     static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&);
55     static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
56     static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
57     Storage* impl() const { return m_impl; }
58     void releaseImpl() { m_impl->deref(); m_impl = 0; }
59
60 private:
61     Storage* m_impl;
62 protected:
63     JSStorage(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<Storage>);
64     void finishCreation(JSC::JSGlobalData&);
65     static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
66 private:
67     static bool canGetItemsForName(JSC::ExecState*, Storage*, const JSC::Identifier&);
68     static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
69 };
70
71 class JSStorageOwner : public JSC::WeakHandleOwner {
72     virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
73     virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
74 };
75
76 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, Storage*)
77 {
78     DEFINE_STATIC_LOCAL(JSStorageOwner, jsStorageOwner, ());
79     return &jsStorageOwner;
80 }
81
82 inline void* wrapperContext(DOMWrapperWorld* world, Storage*)
83 {
84     return world;
85 }
86
87 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Storage*);
88 Storage* toStorage(JSC::JSValue);
89
90 class JSStoragePrototype : public JSC::JSNonFinalObject {
91 public:
92     typedef JSC::JSNonFinalObject Base;
93     static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
94     static JSStoragePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
95     {
96         JSStoragePrototype* ptr = new (JSC::allocateCell<JSStoragePrototype>(globalData.heap)) JSStoragePrototype(globalData, globalObject, structure);
97         ptr->finishCreation(globalData);
98         return ptr;
99     }
100
101     static const JSC::ClassInfo s_info;
102     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
103     static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
104     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
105     {
106         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
107     }
108
109 private:
110     JSStoragePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
111 protected:
112     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
113 };
114
115 class JSStorageConstructor : public DOMConstructorObject {
116 private:
117     JSStorageConstructor(JSC::Structure*, JSDOMGlobalObject*);
118     void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
119
120 public:
121     typedef DOMConstructorObject Base;
122     static JSStorageConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
123     {
124         JSStorageConstructor* ptr = new (JSC::allocateCell<JSStorageConstructor>(*exec->heap())) JSStorageConstructor(structure, globalObject);
125         ptr->finishCreation(exec, globalObject);
126         return ptr;
127     }
128
129     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
130     static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
131     static const JSC::ClassInfo s_info;
132     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
133     {
134         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
135     }
136 protected:
137     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
138 };
139
140 // Functions
141
142 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionKey(JSC::ExecState*);
143 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionGetItem(JSC::ExecState*);
144 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionSetItem(JSC::ExecState*);
145 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionRemoveItem(JSC::ExecState*);
146 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionClear(JSC::ExecState*);
147 // Attributes
148
149 JSC::JSValue jsStorageLength(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
150 JSC::JSValue jsStorageConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
151
152 } // namespace WebCore
153
154 #endif