27 using namespace KJSEmbed;
29 const KJS::ClassInfo DomNodeBinding::info = {
"QDomNode", &ValueBinding::info,
nullptr,
nullptr };
38 START_VALUE_METHOD(nodeType,
QDomNode)
39 result = KJS::jsNumber((
int)value.nodeType());
42 START_VALUE_METHOD(nodeName,
QDomNode)
43 result = KJS::jsString(value.nodeName());
46 START_VALUE_METHOD(nodeValue,
QDomNode)
47 result = KJS::jsString(value.nodeValue());
50 START_VALUE_METHOD(appendChild,
QDomNode)
51 QDomNode newNode = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
52 QDomNode node = value.appendChild(newNode);
53 result = KJSEmbed::createValue(exec,
"QDomNode", node);
56 START_VALUE_METHOD(attributes,
QDomNode)
58 result = KJSEmbed::createValue(exec,
"QDomNamedNodeMap", map);
61 START_VALUE_METHOD(childNodes,
QDomNode)
63 result = KJSEmbed::createValue(exec,
"QDomNodeList", nodes);
70 START_VALUE_METHOD(cloneNode,
QDomNode)
71 bool deep = KJSEmbed::extractBool(exec, args, 0,
true);
72 QDomNode node = value.cloneNode(deep);
73 result = KJSEmbed::createValue(exec,
"QDomNode", node);
76 START_VALUE_METHOD(firstChild,
QDomNode)
78 result = KJSEmbed::createValue(exec,
"QDomNode", node);
81 START_VALUE_METHOD(firstChildElement,
QDomNode)
82 QString name = KJSEmbed::extractQString(exec, args, 0);
84 result = KJSEmbed::createValue(exec,
"QDomElement", node);
87 START_VALUE_METHOD(hasAttributes,
QDomNode)
88 result = KJS::jsBoolean(value.hasAttributes());
91 START_VALUE_METHOD(hasChildNodes,
QDomNode)
92 result = KJS::jsBoolean(value.hasChildNodes());
95 START_VALUE_METHOD(insertBefore,
QDomNode)
96 QDomNode first = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
97 QDomNode second = KJSEmbed::extractValue<QDomNode>(exec, args, 1);
98 QDomNode node = value.insertBefore(first, second);
99 result = KJSEmbed::createValue(exec,
"QDomNode", node);
102 START_VALUE_METHOD(insertAfter,
QDomNode)
103 QDomNode first = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
104 QDomNode second = KJSEmbed::extractValue<QDomNode>(exec, args, 1);
105 QDomNode node = value.insertAfter(first, second);
106 result = KJSEmbed::createValue(exec,
"QDomNode", node);
109 START_VALUE_METHOD(isAttr,
QDomNode)
110 result = KJS::jsBoolean(value.isAttr());
113 START_VALUE_METHOD(isCDATASection,
QDomNode)
114 result = KJS::jsBoolean(value.isCDATASection());
117 START_VALUE_METHOD(isCharacterData,
QDomNode)
118 result = KJS::jsBoolean(value.isCharacterData());
121 START_VALUE_METHOD(isComment,
QDomNode)
122 result = KJS::jsBoolean(value.isComment());
125 START_VALUE_METHOD(isDocument,
QDomNode)
126 result = KJS::jsBoolean(value.isDocument());
129 START_VALUE_METHOD(isDocumentFragment,
QDomNode)
130 result = KJS::jsBoolean(value.isDocumentFragment());
133 START_VALUE_METHOD(isDocumentType,
QDomNode)
134 result = KJS::jsBoolean(value.isDocumentType());
137 START_VALUE_METHOD(isElement,
QDomNode)
138 result = KJS::jsBoolean(value.isElement());
141 START_VALUE_METHOD(isEntity,
QDomNode)
142 result = KJS::jsBoolean(value.isEntity());
145 START_VALUE_METHOD(isEntityReference,
QDomNode)
146 result = KJS::jsBoolean(value.isEntityReference());
149 START_VALUE_METHOD(isNotation,
QDomNode)
150 result = KJS::jsBoolean(value.isNotation());
153 START_VALUE_METHOD(isNull,
QDomNode)
154 result = KJS::jsBoolean(value.
isNull());
157 START_VALUE_METHOD(isProcessingInstruction,
QDomNode)
158 result = KJS::jsBoolean(value.isProcessingInstruction());
161 START_VALUE_METHOD(isSupported,
QDomNode)
162 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
163 QString arg1 = KJSEmbed::extractQString(exec, args, 1);
164 result = KJS::jsBoolean(value.isSupported(arg0, arg1));
167 START_VALUE_METHOD(isText,
QDomNode)
168 result = KJS::jsBoolean(value.isText());
171 START_VALUE_METHOD(lastChild,
QDomNode)
173 result = KJSEmbed::createValue(exec,
"QDomNode", node);
176 START_VALUE_METHOD(lastChildElement,
QDomNode)
177 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
179 result = KJSEmbed::createValue(exec,
"QDomElement", node);
182 START_VALUE_METHOD(localName,
QDomNode)
183 result = KJS::jsString(value.localName());
186 START_VALUE_METHOD(namedItem,
QDomNode)
187 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
188 QDomNode node = value.namedItem(arg0);
189 result = KJSEmbed::createValue(exec,
"QDomNode", node);
192 START_VALUE_METHOD(namespaceURI,
QDomNode)
193 result = KJS::jsString(value.namespaceURI());
196 START_VALUE_METHOD(nextSibling,
QDomNode)
197 QDomNode node = value.nextSibling();
198 result = KJSEmbed::createValue(exec,
"QDomNode", node);
201 START_VALUE_METHOD(nextSiblingElement,
QDomNode)
202 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
204 result = KJSEmbed::createValue(exec,
"QDomElement", node);
207 START_VALUE_METHOD(normalize,
QDomNode)
211 START_VALUE_METHOD(ownerDocument,
QDomNode)
213 result = KJSEmbed::createValue(exec,
"QDomDocument", doc);
216 START_VALUE_METHOD(parentNode,
QDomNode)
217 QDomNode parent = value.parentNode();
218 result = KJSEmbed::createValue(exec,
"QDomNode", parent);
221 START_VALUE_METHOD(prefix,
QDomNode)
222 result = KJS::jsString(value.prefix());
225 START_VALUE_METHOD(previousSibling,
QDomNode)
226 QDomNode node = value.previousSibling();
227 result = KJSEmbed::createValue(exec,
"QDomNode", node);
230 START_VALUE_METHOD(previousSiblingElement,
QDomNode)
231 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
232 QDomNode node = value.previousSiblingElement(arg0);
233 result = KJSEmbed::createValue(exec,
"QDomNode", node);
236 START_VALUE_METHOD(removeChild,
QDomNode)
237 QDomNode arg0 = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
238 QDomNode node = value.removeChild(arg0);
239 result = KJSEmbed::createValue(exec,
"QDomNode", node);
242 START_VALUE_METHOD(replaceChild,
QDomNode)
243 QDomNode arg0 = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
244 QDomNode arg1 = KJSEmbed::extractValue<QDomNode>(exec, args, 1);
245 QDomNode node = value.replaceChild(arg0, arg1);
246 result = KJSEmbed::createValue(exec,
"QDomNode", node);
249 START_VALUE_METHOD(setPrefix,
QDomNode)
250 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
251 value.setPrefix(arg0);
254 START_VALUE_METHOD(setNodeValue,
QDomNode)
255 QString arg0 = KJSEmbed::extractQString(exec, args, 0);
256 value.setNodeValue(arg0);
259 START_VALUE_METHOD(toAttr,
QDomNode)
261 result = KJSEmbed::createValue(exec,
"QDomAttr", attr);
264 START_VALUE_METHOD(toElement,
QDomNode)
266 result = KJSEmbed::createValue(exec,
"QDomElement", elem);
270 START_METHOD_LUT(DomNode)
271 {
"appendChild", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::appendChild},
272 {
"attributes", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::attributes},
273 {
"childNodes", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::childNodes},
274 {
"clear", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::clear},
275 {
"cloneNode", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::cloneNode},
276 {
"firstChild", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::firstChild},
277 {
"firstChildElement", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::firstChildElement},
278 {
"hasAttributes", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::hasAttributes},
279 {
"hasChildNodes", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::hasChildNodes},
280 {
"insertBefore", 2, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::insertBefore},
281 {
"insertAfter", 2, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::insertAfter},
282 {
"isAttr", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isAttr},
283 {
"isCDATASection", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isCDATASection},
284 {
"isCharacterData", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isCharacterData},
285 {
"isComment", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isComment},
286 {
"isDocument", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isDocument},
287 {
"isDocumentFragment", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isDocumentFragment},
288 {
"isDocumentType", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isDocumentType},
289 {
"isElement", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isElement},
290 {
"isEntity", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isEntity},
291 {
"isEntityReference", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isEntityReference},
292 {
"isNotation", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isNotation},
293 {
"isNull", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isNull},
294 {
"isProcessingInstruction", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isProcessingInstruction},
295 {
"isSupported", 2, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isSupported},
296 {
"isText", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::isText},
297 {
"lastChild", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::lastChild},
298 {
"lastChildElement", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::lastChildElement},
299 {
"localName", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::localName},
300 {
"namedItem", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::namedItem},
301 {
"namespaceURI", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::namespaceURI},
302 {
"nextSibling", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::nextSibling},
303 {
"nextSiblingElement", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::nextSiblingElement},
304 {
"nodeType", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::nodeType},
305 {
"nodeName", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::nodeName},
306 {
"nodeValue", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::nodeValue},
307 {
"normalize", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::normalize},
308 {
"ownerDocument", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::ownerDocument},
309 {
"parentNode", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::parentNode},
310 {
"prefix", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::prefix},
311 {
"previousSibling", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::previousSibling},
312 {
"previousSiblingElement", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::previousSiblingElement},
313 {
"removeChild", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::removeChild},
314 {
"replaceChild", 2, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::replaceChild},
315 {
"setPrefix", 1, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::setPrefix},
316 {
"setNodeValue", 2, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::setNodeValue},
317 {
"toAttr", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::toAttr},
318 {
"toElement", 0, KJS::DontDelete | KJS::ReadOnly, &DomNodeNS::toElement}
321 START_ENUM_LUT(DomNode)
341 return new KJSEmbed::DomNodeBinding(exec,
QDomNode());
344 const
KJS::ClassInfo DomDocumentBinding::info = {
"QDomDocument", &ValueBinding::info,
nullptr,
nullptr };
352 namespace DomDocumentNS
354 QString parserErrorTemplate =
"XML Parse error '%1' at %2,%3";
357 QString xml = KJSEmbed::extractQString(exec, args, 0);
361 bool success = value.setContent(xml, &
message, &row, &col);
362 result = KJS::jsBoolean(success);
365 KJS::throwError(exec, KJS::SyntaxError, parserErrorTemplate.
arg(
message).
arg(row).
arg(col));
370 int indent = KJSEmbed::extractInt(exec, args, 0, 1);
371 result = KJS::jsString(value.
toString(indent));
376 result = KJSEmbed::createValue(exec,
"QDomElement", elem);
380 QString id = KJSEmbed::extractQString(exec, args, 0);
382 result = KJSEmbed::createValue(exec,
"QDomElement", elem);
386 QString name = KJSEmbed::extractQString(exec, args, 0);
387 QDomAttr attr = value.createAttribute(name);
388 result = KJSEmbed::createValue(exec,
"QDomAttr", attr);
392 QString nsURI = KJSEmbed::extractQString(exec, args, 0);
393 QString qName = KJSEmbed::extractQString(exec, args, 1);
394 QDomAttr attr = value.createAttributeNS(nsURI, qName);
395 result = KJSEmbed::createValue(exec,
"QDomAttr", attr);
399 QString cdatatxt = KJSEmbed::extractQString(exec, args, 0);
401 result = KJSEmbed::createValue(exec,
"QDomCDATASection", cdata);
405 QString commenttxt = KJSEmbed::extractQString(exec, args, 0);
406 QDomComment comment = value.createComment(commenttxt);
407 result = KJSEmbed::createValue(exec,
"QDomComment", comment);
410 START_VALUE_METHOD(createDocumentFragment,
QDomDocument)
412 result = KJSEmbed::createValue(exec,
"QDomDocumentFragment", fragment);
416 QString tagName = KJSEmbed::extractQString(exec, args, 0);
418 result = KJSEmbed::createValue(exec,
"QDomElement", elem);
422 QString nsURI = KJSEmbed::extractQString(exec, args, 0);
423 QString qName = KJSEmbed::extractQString(exec, args, 1);
424 QDomElement elem = value.createElementNS(nsURI, qName);
425 result = KJSEmbed::createValue(exec,
"QDomElement", elem);
429 QString name = KJSEmbed::extractQString(exec, args, 0);
431 result = KJSEmbed::createValue(exec,
"QDomEntityReference", ref);
434 START_VALUE_METHOD(createProcessingInstruction,
QDomDocument)
435 QString target = KJSEmbed::extractQString(exec, args, 0);
436 QString data = KJSEmbed::extractQString(exec, args, 1);
438 result = KJSEmbed::createValue(exec,
"QDomProcessingInstruction", inst);
442 QString texttext = KJSEmbed::extractQString(exec, args, 0);
443 QDomText text = value.createTextNode(texttext);
444 result = KJSEmbed::createValue(exec,
"QDomText", text);
448 QDomNode import = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
449 bool deep = KJSEmbed::extractBool(exec, args, 1);
450 QDomNode node = value.importNode(
import, deep);
451 result = KJSEmbed::createValue(exec,
"QDomNode", node);
456 START_METHOD_LUT(DomDocument)
457 {
"setContent", 1, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::setContent},
458 {
"toString", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::toString},
459 {
"documentElement", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::documentElement},
460 {
"elementById", 1, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::elementById},
461 {
"createAttribute", 1, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createAttribute },
462 {
"createAttributeNS", 2, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createAttributeNS },
463 {
"createCDATASection", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createCDATASection},
464 {
"createComment", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createComment},
465 {
"createDocumentFragment", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createDocumentFragment},
466 {
"createElement", 1, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createElement},
467 {
"createElementNS", 2, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createElementNS},
468 {
"createEntityReference", 1, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createEntityReference},
469 {
"createProcessingInstruction", 2, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createProcessingInstruction},
470 {
"createTextNode", 1, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::createTextNode},
471 {
"importNode", 2, KJS::DontDelete | KJS::ReadOnly, &DomDocumentNS::importNode}
474 NO_ENUMS(DomDocument)
475 NO_STATICS(DomDocument)
478 QString name = KJSEmbed::extractQString(exec, args, 0);
479 return new KJSEmbed::DomDocumentBinding(exec,
QDomDocument(name));
482 const
KJS::ClassInfo DomElementBinding::info = {
"QDomElement", &ValueBinding::info,
nullptr,
nullptr };
490 namespace DomElementNS
493 result = KJS::jsString(value.text());
497 result = KJS::jsString(value.tagName());
501 QString tag = KJSEmbed::extractQString(exec, args, 0);
502 value.setTagName(tag);
506 QString tag = KJSEmbed::extractQString(exec, args, 0);
507 QString defaultValue = KJSEmbed::extractQString(exec, args, 1,
QString());
508 result = KJS::jsString(value.attribute(tag, defaultValue));
512 QString tag = KJSEmbed::extractQString(exec, args, 0);
513 QString newValue = KJSEmbed::extractQString(exec, args, 1);
514 value.setAttribute(tag, newValue);
518 QString attr = KJSEmbed::extractQString(exec, args, 0);
519 result = KJS::jsBoolean(value.hasAttribute(attr));
523 QString attr = KJSEmbed::extractQString(exec, args, 0);
524 value.removeAttribute(attr);
528 QString ns = KJSEmbed::extractQString(exec, args, 0);
529 QString attr = KJSEmbed::extractQString(exec, args, 1);
530 QString val = KJSEmbed::extractQString(exec, args, 3);
531 value.setAttributeNS(ns, attr, val);
535 QString nsURI = KJSEmbed::extractQString(exec, args, 0);
536 QString localName = KJSEmbed::extractQString(exec, args, 1);
537 QString defValue = KJSEmbed::extractQString(exec, args, 1,
QString());
538 result = KJS::jsString(value.attributeNS(nsURI, localName, defValue));
542 QString ns = KJSEmbed::extractQString(exec, args, 0);
543 QString attr = KJSEmbed::extractQString(exec, args, 1);
544 result = KJS::jsBoolean(value.hasAttributeNS(ns, attr));
548 QString ns = KJSEmbed::extractQString(exec, args, 0);
549 QString attr = KJSEmbed::extractQString(exec, args, 1);
550 value.removeAttributeNS(ns, attr);
554 QString name = KJSEmbed::extractQString(exec, args, 0);
556 result = KJSEmbed::createValue(exec,
"QDomNodeList", nodes);
559 START_VALUE_METHOD(elementsByTagNameNS,
QDomElement)
560 QString ns = KJSEmbed::extractQString(exec, args, 0);
561 QString name = KJSEmbed::extractQString(exec, args, 1);
562 QDomNodeList nodes = value.elementsByTagNameNS(ns, name);
563 result = KJSEmbed::createValue(exec,
"QDomNodeList", nodes);
567 QString name = KJSEmbed::extractQString(exec, args, 0);
568 QDomAttr attr = value.attributeNode(name);
569 result = KJSEmbed::createValue(exec,
"QDomAttr", attr);
573 QString ns = KJSEmbed::extractQString(exec, args, 0);
574 QString name = KJSEmbed::extractQString(exec, args, 1);
575 QDomAttr attr = value.attributeNodeNS(ns, name);
576 result = KJSEmbed::createValue(exec,
"QDomAttr", attr);
579 START_VALUE_METHOD(removeAttributeNode,
QDomElement)
580 QDomAttr attr = KJSEmbed::extractValue<QDomAttr>(exec, args, 0);
581 QDomAttr newAttr = value.removeAttributeNode(attr);
582 result = KJSEmbed::createValue(exec,
"QDomAttr", newAttr);
586 QDomAttr attr = KJSEmbed::extractValue<QDomAttr>(exec, args, 0);
587 QDomAttr newAttr = value.setAttributeNode(attr);
588 result = KJSEmbed::createValue(exec,
"QDomAttr", newAttr);
591 START_VALUE_METHOD(setAttributeNodeNS,
QDomElement)
592 QDomAttr attr = KJSEmbed::extractValue<QDomAttr>(exec, args, 0);
593 QDomAttr newAttr = value.setAttributeNodeNS(attr);
594 result = KJSEmbed::createValue(exec,
"QDomAttr", newAttr);
599 NO_STATICS(DomElement)
601 START_METHOD_LUT(DomElement)
602 {
"toString", 0, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::toString},
603 {
"text", 0, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::toString},
604 {
"tagName", 0, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::tagName},
605 {
"setTagName", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::setTagName},
606 {
"setAttribute", 2, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::setAttribute},
607 {
"attribute", 2, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::attribute},
608 {
"hasAttribute", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::hasAttribute},
609 {
"removeAttribute", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::removeAttribute},
610 {
"setAttributeNS", 3, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::setAttributeNS},
611 {
"attributeNS", 3, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::attributeNS},
612 {
"hasAttributeNS", 2, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::hasAttributeNS},
613 {
"removeAttributeNS", 2, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::removeAttributeNS},
614 {
"elementsByTagName", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::elementsByTagName},
615 {
"elementsByTagNameNS", 2, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::elementsByTagNameNS},
616 {
"attributeNode", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::attributeNode},
617 {
"attributeNodeNS", 2, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::attributeNodeNS},
618 {
"removeAttributeNode", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::removeAttributeNode},
619 {
"setAttributeNode", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::setAttributeNode},
620 {
"setAttributeNodeNS", 1, KJS::DontDelete | KJS::ReadOnly, &DomElementNS::setAttributeNodeNS}
624 return new KJSEmbed::DomElementBinding(exec,
QDomElement());
627 const
KJS::ClassInfo DomAttrBinding::info = {
"QDomAttr", &ValueBinding::info,
nullptr,
nullptr };
635 namespace AttrElementNS
638 result = KJS::jsString(value.
value());
641 START_VALUE_METHOD(specified,
QDomAttr)
642 result = KJS::jsBoolean(value.specified());
645 START_VALUE_METHOD(ownerElement,
QDomAttr)
647 result = KJSEmbed::createValue(exec,
"QDomElement", owner);
651 result = KJS::jsString(value.
value());
654 START_VALUE_METHOD(setValue,
QDomAttr)
655 QString newValue = KJSEmbed::extractQString(exec, args, 0);
664 START_METHOD_LUT(DomAttr)
665 {
"name", 0, KJS::DontDelete | KJS::ReadOnly, &AttrElementNS::name},
666 {
"specified", 0, KJS::DontDelete | KJS::ReadOnly, &AttrElementNS::specified},
667 {
"ownerElement", 0, KJS::DontDelete | KJS::ReadOnly, &AttrElementNS::ownerElement},
668 {
"value", 0, KJS::DontDelete | KJS::ReadOnly, &AttrElementNS::value},
669 {
"setValue", 1, KJS::DontDelete | KJS::ReadOnly, &AttrElementNS::setValue}
673 return new KJSEmbed::DomAttrBinding(exec,
QDomAttr());
676 const
KJS::ClassInfo DomNodeListBinding::info = {
"QDomNodeList", &ValueBinding::info,
nullptr,
nullptr };
686 result = KJS::jsNumber(value.count());
690 result = KJS::jsNumber(value.length());
694 int idx = KJSEmbed::extractInt(exec, args, 0);
696 result = KJSEmbed::createValue(exec,
"QDomNode", node);
701 NO_ENUMS(DomNodeList)
702 NO_STATICS(DomNodeList)
704 START_METHOD_LUT(DomNodeList)
705 {
"count", 0, KJS::DontDelete | KJS::ReadOnly, &NodeListNS::count},
706 {
"length", 0, KJS::DontDelete | KJS::ReadOnly, &NodeListNS::length},
707 {
"item", 1, KJS::DontDelete | KJS::ReadOnly, &NodeListNS::item}
711 return new KJSEmbed::DomNodeListBinding(exec,
QDomNodeList());
714 const
KJS::ClassInfo DomDocumentTypeBinding::info = {
"QDomDocumentType", &ValueBinding::info,
nullptr,
nullptr };
722 namespace DomDocumentTypeNS
725 result = KJS::jsString(value.internalSubset());
729 result = KJS::jsString(value.name());
733 result = KJS::jsString(value.publicId());
737 result = KJS::jsString(value.systemId());
741 result = KJSEmbed::createValue(exec,
"QDomNamedNodeMap", value.entities());
745 result = KJSEmbed::createValue(exec,
"QDomNamedNodeMap", value.notations());
749 NO_ENUMS(DomDocumentType)
750 NO_STATICS(DomDocumentType)
752 START_METHOD_LUT(DomDocumentType)
753 {
"entities", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentTypeNS::entities},
754 {
"notations", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentTypeNS::notations},
755 {
"internalSubset", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentTypeNS::internalSubset},
756 {
"name", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentTypeNS::name},
757 {
"publicId", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentTypeNS::publicId},
758 {
"systemId", 0, KJS::DontDelete | KJS::ReadOnly, &DomDocumentTypeNS::systemId}
765 const
KJS::ClassInfo DomNamedNodeMapBinding::info = {
"QDomNamedNodeMap", &ValueBinding::info,
nullptr,
nullptr };
772 namespace NamedNodeMapNS
775 QString name = KJSEmbed::extractQString(exec, args, 0);
776 result = KJS::jsBoolean(value.contains(name));
780 result = KJS::jsNumber(value.count());
784 int idx = KJSEmbed::extractInt(exec, args, 0);
786 result = KJSEmbed::createValue(exec,
"QDomNode", node);
790 result = KJS::jsNumber(value.length());
794 QString name = KJSEmbed::extractQString(exec, args, 0);
795 QDomNode node = value.namedItem(name);
796 result = KJSEmbed::createValue(exec,
"QDomNode", node);
800 QString nsuri = KJSEmbed::extractQString(exec, args, 0);
801 QString localName = KJSEmbed::extractQString(exec, args, 1);
802 QDomNode node = value.namedItemNS(nsuri, localName);
803 result = KJSEmbed::createValue(exec,
"QDomNode", node);
807 QString name = KJSEmbed::extractQString(exec, args, 0);
808 QDomNode node = value.removeNamedItem(name);
809 result = KJSEmbed::createValue(exec,
"QDomNode", node);
813 QString nsuri = KJSEmbed::extractQString(exec, args, 0);
814 QString localName = KJSEmbed::extractQString(exec, args, 1);
815 QDomNode node = value.removeNamedItemNS(nsuri, localName);
816 result = KJSEmbed::createValue(exec,
"QDomNode", node);
820 QDomNode newNode = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
821 QDomNode node = value.setNamedItem(newNode);
822 result = KJSEmbed::createValue(exec,
"QDomNode", node);
826 QDomNode newNode = KJSEmbed::extractValue<QDomNode>(exec, args, 0);
827 QDomNode node = value.setNamedItemNS(newNode);
828 result = KJSEmbed::createValue(exec,
"QDomNode", node);
833 NO_ENUMS(DomNamedNodeMap)
834 NO_STATICS(DomNamedNodeMap)
836 START_METHOD_LUT(DomNamedNodeMap)
837 {
"contains", 0, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::contains},
838 {
"count", 0, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::count},
839 {
"item", 1, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::item},
840 {
"length", 0, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::length},
841 {
"namedItem", 1, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::namedItem},
842 {
"namedItemNS", 2, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::namedItemNS},
843 {
"removeNamedItem", 1, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::removeNamedItem},
844 {
"removeNamedItemNS", 2, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::removeNamedItemNS},
845 {
"setNamedItem", 1, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::setNamedItem},
846 {
"setNamedItemNS", 1, KJS::DontDelete | KJS::ReadOnly, &NamedNodeMapNS::setNamedItemNS}
853 const
KJS::ClassInfo DomTextBinding::info = {
"QDomText", &ValueBinding::info,
nullptr,
nullptr };
866 return new KJSEmbed::DomTextBinding(exec,
QDomText());