Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.5 ( bd7262be...
[qt:qt-l10n-hu.git] / src / 3rdparty / webkit / WebCore / generated / JSHTMLTableRowElement.cpp
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 #include "config.h"
22
23 #include "JSHTMLTableRowElement.h"
24
25 #include <wtf/GetPtr.h>
26
27 #include "HTMLCollection.h"
28 #include "HTMLElement.h"
29 #include "HTMLTableRowElement.h"
30 #include "JSHTMLCollection.h"
31 #include "JSHTMLElement.h"
32 #include "KURL.h"
33
34 #include <runtime/Error.h>
35 #include <runtime/JSNumberCell.h>
36 #include <runtime/JSString.h>
37
38 using namespace JSC;
39
40 namespace WebCore {
41
42 ASSERT_CLASS_FITS_IN_CELL(JSHTMLTableRowElement)
43
44 /* Hash table */
45
46 static const HashTableValue JSHTMLTableRowElementTableValues[10] =
47 {
48     { "rowIndex", DontDelete|ReadOnly, (intptr_t)jsHTMLTableRowElementRowIndex, (intptr_t)0 },
49     { "sectionRowIndex", DontDelete|ReadOnly, (intptr_t)jsHTMLTableRowElementSectionRowIndex, (intptr_t)0 },
50     { "cells", DontDelete|ReadOnly, (intptr_t)jsHTMLTableRowElementCells, (intptr_t)0 },
51     { "align", DontDelete, (intptr_t)jsHTMLTableRowElementAlign, (intptr_t)setJSHTMLTableRowElementAlign },
52     { "bgColor", DontDelete, (intptr_t)jsHTMLTableRowElementBgColor, (intptr_t)setJSHTMLTableRowElementBgColor },
53     { "ch", DontDelete, (intptr_t)jsHTMLTableRowElementCh, (intptr_t)setJSHTMLTableRowElementCh },
54     { "chOff", DontDelete, (intptr_t)jsHTMLTableRowElementChOff, (intptr_t)setJSHTMLTableRowElementChOff },
55     { "vAlign", DontDelete, (intptr_t)jsHTMLTableRowElementVAlign, (intptr_t)setJSHTMLTableRowElementVAlign },
56     { "constructor", DontEnum|ReadOnly, (intptr_t)jsHTMLTableRowElementConstructor, (intptr_t)0 },
57     { 0, 0, 0, 0 }
58 };
59
60 static const HashTable JSHTMLTableRowElementTable =
61 #if ENABLE(PERFECT_HASH_SIZE)
62     { 63, JSHTMLTableRowElementTableValues, 0 };
63 #else
64     { 33, 31, JSHTMLTableRowElementTableValues, 0 };
65 #endif
66
67 /* Hash table for constructor */
68
69 static const HashTableValue JSHTMLTableRowElementConstructorTableValues[1] =
70 {
71     { 0, 0, 0, 0 }
72 };
73
74 static const HashTable JSHTMLTableRowElementConstructorTable =
75 #if ENABLE(PERFECT_HASH_SIZE)
76     { 0, JSHTMLTableRowElementConstructorTableValues, 0 };
77 #else
78     { 1, 0, JSHTMLTableRowElementConstructorTableValues, 0 };
79 #endif
80
81 class JSHTMLTableRowElementConstructor : public DOMObject {
82 public:
83     JSHTMLTableRowElementConstructor(ExecState* exec)
84         : DOMObject(JSHTMLTableRowElementConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype()))
85     {
86         putDirect(exec->propertyNames().prototype, JSHTMLTableRowElementPrototype::self(exec, exec->lexicalGlobalObject()), None);
87     }
88     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
89     virtual const ClassInfo* classInfo() const { return &s_info; }
90     static const ClassInfo s_info;
91
92     static PassRefPtr<Structure> createStructure(JSValuePtr proto) 
93     { 
94         return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance)); 
95     }
96 };
97
98 const ClassInfo JSHTMLTableRowElementConstructor::s_info = { "HTMLTableRowElementConstructor", 0, &JSHTMLTableRowElementConstructorTable, 0 };
99
100 bool JSHTMLTableRowElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
101 {
102     return getStaticValueSlot<JSHTMLTableRowElementConstructor, DOMObject>(exec, &JSHTMLTableRowElementConstructorTable, this, propertyName, slot);
103 }
104
105 /* Hash table for prototype */
106
107 static const HashTableValue JSHTMLTableRowElementPrototypeTableValues[3] =
108 {
109     { "insertCell", DontDelete|Function, (intptr_t)jsHTMLTableRowElementPrototypeFunctionInsertCell, (intptr_t)1 },
110     { "deleteCell", DontDelete|Function, (intptr_t)jsHTMLTableRowElementPrototypeFunctionDeleteCell, (intptr_t)1 },
111     { 0, 0, 0, 0 }
112 };
113
114 static const HashTable JSHTMLTableRowElementPrototypeTable =
115 #if ENABLE(PERFECT_HASH_SIZE)
116     { 1, JSHTMLTableRowElementPrototypeTableValues, 0 };
117 #else
118     { 4, 3, JSHTMLTableRowElementPrototypeTableValues, 0 };
119 #endif
120
121 const ClassInfo JSHTMLTableRowElementPrototype::s_info = { "HTMLTableRowElementPrototype", 0, &JSHTMLTableRowElementPrototypeTable, 0 };
122
123 JSObject* JSHTMLTableRowElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
124 {
125     return getDOMPrototype<JSHTMLTableRowElement>(exec, globalObject);
126 }
127
128 bool JSHTMLTableRowElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
129 {
130     return getStaticFunctionSlot<JSObject>(exec, &JSHTMLTableRowElementPrototypeTable, this, propertyName, slot);
131 }
132
133 const ClassInfo JSHTMLTableRowElement::s_info = { "HTMLTableRowElement", &JSHTMLElement::s_info, &JSHTMLTableRowElementTable, 0 };
134
135 JSHTMLTableRowElement::JSHTMLTableRowElement(PassRefPtr<Structure> structure, PassRefPtr<HTMLTableRowElement> impl)
136     : JSHTMLElement(structure, impl)
137 {
138 }
139
140 JSObject* JSHTMLTableRowElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
141 {
142     return new (exec) JSHTMLTableRowElementPrototype(JSHTMLTableRowElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject)));
143 }
144
145 bool JSHTMLTableRowElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
146 {
147     return getStaticValueSlot<JSHTMLTableRowElement, Base>(exec, &JSHTMLTableRowElementTable, this, propertyName, slot);
148 }
149
150 JSValuePtr jsHTMLTableRowElementRowIndex(ExecState* exec, const Identifier&, const PropertySlot& slot)
151 {
152     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
153     return jsNumber(exec, imp->rowIndex());
154 }
155
156 JSValuePtr jsHTMLTableRowElementSectionRowIndex(ExecState* exec, const Identifier&, const PropertySlot& slot)
157 {
158     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
159     return jsNumber(exec, imp->sectionRowIndex());
160 }
161
162 JSValuePtr jsHTMLTableRowElementCells(ExecState* exec, const Identifier&, const PropertySlot& slot)
163 {
164     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
165     return toJS(exec, WTF::getPtr(imp->cells()));
166 }
167
168 JSValuePtr jsHTMLTableRowElementAlign(ExecState* exec, const Identifier&, const PropertySlot& slot)
169 {
170     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
171     return jsString(exec, imp->align());
172 }
173
174 JSValuePtr jsHTMLTableRowElementBgColor(ExecState* exec, const Identifier&, const PropertySlot& slot)
175 {
176     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
177     return jsString(exec, imp->bgColor());
178 }
179
180 JSValuePtr jsHTMLTableRowElementCh(ExecState* exec, const Identifier&, const PropertySlot& slot)
181 {
182     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
183     return jsString(exec, imp->ch());
184 }
185
186 JSValuePtr jsHTMLTableRowElementChOff(ExecState* exec, const Identifier&, const PropertySlot& slot)
187 {
188     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
189     return jsString(exec, imp->chOff());
190 }
191
192 JSValuePtr jsHTMLTableRowElementVAlign(ExecState* exec, const Identifier&, const PropertySlot& slot)
193 {
194     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->impl());
195     return jsString(exec, imp->vAlign());
196 }
197
198 JSValuePtr jsHTMLTableRowElementConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
199 {
200     return static_cast<JSHTMLTableRowElement*>(asObject(slot.slotBase()))->getConstructor(exec);
201 }
202 void JSHTMLTableRowElement::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
203 {
204     lookupPut<JSHTMLTableRowElement, Base>(exec, propertyName, value, &JSHTMLTableRowElementTable, this, slot);
205 }
206
207 void setJSHTMLTableRowElementAlign(ExecState* exec, JSObject* thisObject, JSValuePtr value)
208 {
209     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(thisObject)->impl());
210     imp->setAlign(valueToStringWithNullCheck(exec, value));
211 }
212
213 void setJSHTMLTableRowElementBgColor(ExecState* exec, JSObject* thisObject, JSValuePtr value)
214 {
215     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(thisObject)->impl());
216     imp->setBgColor(valueToStringWithNullCheck(exec, value));
217 }
218
219 void setJSHTMLTableRowElementCh(ExecState* exec, JSObject* thisObject, JSValuePtr value)
220 {
221     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(thisObject)->impl());
222     imp->setCh(valueToStringWithNullCheck(exec, value));
223 }
224
225 void setJSHTMLTableRowElementChOff(ExecState* exec, JSObject* thisObject, JSValuePtr value)
226 {
227     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(thisObject)->impl());
228     imp->setChOff(valueToStringWithNullCheck(exec, value));
229 }
230
231 void setJSHTMLTableRowElementVAlign(ExecState* exec, JSObject* thisObject, JSValuePtr value)
232 {
233     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(static_cast<JSHTMLTableRowElement*>(thisObject)->impl());
234     imp->setVAlign(valueToStringWithNullCheck(exec, value));
235 }
236
237 JSValuePtr JSHTMLTableRowElement::getConstructor(ExecState* exec)
238 {
239     return getDOMConstructor<JSHTMLTableRowElementConstructor>(exec);
240 }
241
242 JSValuePtr jsHTMLTableRowElementPrototypeFunctionInsertCell(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
243 {
244     if (!thisValue->isObject(&JSHTMLTableRowElement::s_info))
245         return throwError(exec, TypeError);
246     JSHTMLTableRowElement* castedThisObj = static_cast<JSHTMLTableRowElement*>(asObject(thisValue));
247     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThisObj->impl());
248     ExceptionCode ec = 0;
249     int index = args.at(exec, 0)->toInt32(exec);
250
251
252     JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->insertCell(index, ec)));
253     setDOMException(exec, ec);
254     return result;
255 }
256
257 JSValuePtr jsHTMLTableRowElementPrototypeFunctionDeleteCell(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
258 {
259     if (!thisValue->isObject(&JSHTMLTableRowElement::s_info))
260         return throwError(exec, TypeError);
261     JSHTMLTableRowElement* castedThisObj = static_cast<JSHTMLTableRowElement*>(asObject(thisValue));
262     HTMLTableRowElement* imp = static_cast<HTMLTableRowElement*>(castedThisObj->impl());
263     ExceptionCode ec = 0;
264     int index = args.at(exec, 0)->toInt32(exec);
265
266     imp->deleteCell(index, ec);
267     setDOMException(exec, ec);
268     return jsUndefined();
269 }
270
271
272 }