tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSXMLHttpRequest.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 JSXMLHttpRequest_h
22 #define JSXMLHttpRequest_h
23
24 #include "JSDOMBinding.h"
25 #include "XMLHttpRequest.h"
26 #include <runtime/JSGlobalObject.h>
27 #include <runtime/JSObject.h>
28 #include <runtime/ObjectPrototype.h>
29
30 namespace WebCore {
31
32 class JSXMLHttpRequest : public JSDOMWrapper {
33 public:
34     typedef JSDOMWrapper Base;
35     static JSXMLHttpRequest* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<XMLHttpRequest> impl)
36     {
37         JSXMLHttpRequest* ptr = new (JSC::allocateCell<JSXMLHttpRequest>(globalObject->globalData().heap)) JSXMLHttpRequest(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     static const JSC::ClassInfo s_info;
47
48     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
49     {
50         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
51     }
52
53     static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
54     static void visitChildren(JSCell*, JSC::SlotVisitor&);
55
56
57     // Custom attributes
58     JSC::JSValue responseText(JSC::ExecState*) const;
59     JSC::JSValue response(JSC::ExecState*) const;
60
61     // Custom functions
62     JSC::JSValue open(JSC::ExecState*);
63     JSC::JSValue send(JSC::ExecState*);
64     XMLHttpRequest* impl() const { return m_impl; }
65     void releaseImpl() { m_impl->deref(); m_impl = 0; }
66
67 private:
68     XMLHttpRequest* m_impl;
69 protected:
70     JSXMLHttpRequest(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<XMLHttpRequest>);
71     void finishCreation(JSC::JSGlobalData&);
72     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
73 };
74
75 class JSXMLHttpRequestOwner : public JSC::WeakHandleOwner {
76     virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
77     virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
78 };
79
80 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, XMLHttpRequest*)
81 {
82     DEFINE_STATIC_LOCAL(JSXMLHttpRequestOwner, jsXMLHttpRequestOwner, ());
83     return &jsXMLHttpRequestOwner;
84 }
85
86 inline void* wrapperContext(DOMWrapperWorld* world, XMLHttpRequest*)
87 {
88     return world;
89 }
90
91 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, XMLHttpRequest*);
92 XMLHttpRequest* toXMLHttpRequest(JSC::JSValue);
93
94 class JSXMLHttpRequestPrototype : public JSC::JSNonFinalObject {
95 public:
96     typedef JSC::JSNonFinalObject Base;
97     static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
98     static JSXMLHttpRequestPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
99     {
100         JSXMLHttpRequestPrototype* ptr = new (JSC::allocateCell<JSXMLHttpRequestPrototype>(globalData.heap)) JSXMLHttpRequestPrototype(globalData, globalObject, structure);
101         ptr->finishCreation(globalData);
102         return ptr;
103     }
104
105     static const JSC::ClassInfo s_info;
106     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
107     static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
108     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
109     {
110         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
111     }
112
113 private:
114     JSXMLHttpRequestPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
115 protected:
116     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
117 };
118
119 class JSXMLHttpRequestConstructor : public DOMConstructorObject {
120 private:
121     JSXMLHttpRequestConstructor(JSC::Structure*, JSDOMGlobalObject*);
122     void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
123
124 public:
125     typedef DOMConstructorObject Base;
126     static JSXMLHttpRequestConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
127     {
128         JSXMLHttpRequestConstructor* ptr = new (JSC::allocateCell<JSXMLHttpRequestConstructor>(*exec->heap())) JSXMLHttpRequestConstructor(structure, globalObject);
129         ptr->finishCreation(exec, globalObject);
130         return ptr;
131     }
132
133     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
134     static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
135     static const JSC::ClassInfo s_info;
136     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
137     {
138         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
139     }
140 protected:
141     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
142     static JSC::EncodedJSValue JSC_HOST_CALL constructJSXMLHttpRequest(JSC::ExecState*);
143     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
144 };
145
146 // Functions
147
148 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionOpen(JSC::ExecState*);
149 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionSetRequestHeader(JSC::ExecState*);
150 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionSend(JSC::ExecState*);
151 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionAbort(JSC::ExecState*);
152 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionGetAllResponseHeaders(JSC::ExecState*);
153 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionGetResponseHeader(JSC::ExecState*);
154 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionOverrideMimeType(JSC::ExecState*);
155 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionAddEventListener(JSC::ExecState*);
156 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionRemoveEventListener(JSC::ExecState*);
157 JSC::EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestPrototypeFunctionDispatchEvent(JSC::ExecState*);
158 // Attributes
159
160 JSC::JSValue jsXMLHttpRequestOnabort(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
161 void setJSXMLHttpRequestOnabort(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
162 JSC::JSValue jsXMLHttpRequestOnerror(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
163 void setJSXMLHttpRequestOnerror(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
164 JSC::JSValue jsXMLHttpRequestOnload(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
165 void setJSXMLHttpRequestOnload(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
166 JSC::JSValue jsXMLHttpRequestOnloadstart(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
167 void setJSXMLHttpRequestOnloadstart(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
168 JSC::JSValue jsXMLHttpRequestOnprogress(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
169 void setJSXMLHttpRequestOnprogress(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
170 JSC::JSValue jsXMLHttpRequestOnreadystatechange(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
171 void setJSXMLHttpRequestOnreadystatechange(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
172 JSC::JSValue jsXMLHttpRequestReadyState(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
173 JSC::JSValue jsXMLHttpRequestAsBlob(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
174 void setJSXMLHttpRequestAsBlob(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
175 JSC::JSValue jsXMLHttpRequestWithCredentials(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
176 void setJSXMLHttpRequestWithCredentials(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
177 JSC::JSValue jsXMLHttpRequestUpload(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
178 JSC::JSValue jsXMLHttpRequestResponseText(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
179 JSC::JSValue jsXMLHttpRequestResponseXML(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
180 JSC::JSValue jsXMLHttpRequestResponseBlob(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
181 JSC::JSValue jsXMLHttpRequestResponseType(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
182 void setJSXMLHttpRequestResponseType(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
183 JSC::JSValue jsXMLHttpRequestResponse(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
184 JSC::JSValue jsXMLHttpRequestStatus(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
185 JSC::JSValue jsXMLHttpRequestStatusText(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
186 JSC::JSValue jsXMLHttpRequestConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
187 // Constants
188
189 JSC::JSValue jsXMLHttpRequestUNSENT(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
190 JSC::JSValue jsXMLHttpRequestOPENED(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
191 JSC::JSValue jsXMLHttpRequestHEADERS_RECEIVED(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
192 JSC::JSValue jsXMLHttpRequestLOADING(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
193 JSC::JSValue jsXMLHttpRequestDONE(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
194
195 } // namespace WebCore
196
197 #endif