2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 cpp_quote(" * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.")
29 cpp_quote(" * Redistribution and use in source and binary forms, with or without")
30 cpp_quote(" * modification, are permitted provided that the following conditions")
31 cpp_quote(" * are met:")
32 cpp_quote(" * 1. Redistributions of source code must retain the above copyright")
33 cpp_quote(" * notice, this list of conditions and the following disclaimer.")
34 cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")
35 cpp_quote(" * notice, this list of conditions and the following disclaimer in the")
36 cpp_quote(" * documentation and/or other materials provided with the distribution.")
38 cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")
39 cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")
40 cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")
41 cpp_quote(" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR")
42 cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")
43 cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")
44 cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")
45 cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")
46 cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")
47 cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")
48 cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")
53 import "IWebScriptObject.idl";
55 interface IWebScriptObject;
56 interface IDOMNodeList;
57 interface IDOMNamedNodeMap;
58 interface IDOMDocumentType;
59 interface IDOMElement;
60 interface IDOMDocumentFragment;
62 interface IDOMComment;
63 interface IDOMCDATASection;
64 interface IDOMProcessingInstruction;
66 interface IDOMEntityReference;
67 interface IDOMDocument;
70 @interface DOMObject : WebScriptObject <NSCopying>
75 uuid(A27FA225-F34E-425d-88EB-A35BD105A527),
76 pointer_default(unique)
78 interface IDOMObject : IWebScriptObject
83 @interface DOMImplementation : DOMObject
88 uuid(6E48C25D-E542-4d1a-BC73-ACDC21E39C56),
89 pointer_default(unique)
91 interface IDOMImplementation : IDOMObject
94 - (BOOL)hasFeature:(NSString *)feature :(NSString *)version;
96 HRESULT hasFeature([in] BSTR feature, [in] BSTR version, [out, retval] BOOL* result);
99 - (DOMDocumentType *)createDocumentType:(NSString *)qualifiedName :(NSString *)publicId :(NSString *)systemId;
101 HRESULT createDocumentType([in] BSTR qualifiedName, [in] BSTR publicId, [in] BSTR systemId, [out, retval] IDOMDocumentType** result);
104 - (DOMDocument *)createDocument:(NSString *)namespaceURI :(NSString *)qualifiedName :(DOMDocumentType *)doctype;
106 HRESULT createDocument([in] BSTR namespaceURI, [in] BSTR qualifiedName, [in] IDOMDocumentType* doctype, [out, retval] IDOMDocument** result);
110 @interface DOMNode : DOMObject <DOMEventTarget>
115 uuid(3EEA3E20-72DA-4be7-954F-79B5A14AD726),
116 pointer_default(unique)
118 interface IDOMNode : IDOMObject
121 - (NSString *)nodeName;
123 HRESULT nodeName([out, retval] BSTR* result);
126 - (NSString *)nodeValue;
128 HRESULT nodeValue([out, retval] BSTR* result);
131 - (void)setNodeValue:(NSString *)string;
133 HRESULT setNodeValue([in] BSTR value);
136 - (unsigned short)nodeType;
138 HRESULT nodeType([out, retval] unsigned short* result);
141 - (DOMNode *)parentNode;
143 HRESULT parentNode([out, retval] IDOMNode** result);
146 - (DOMNodeList *)childNodes;
148 HRESULT childNodes([out, retval] IDOMNodeList** result);
151 - (DOMNode *)firstChild;
153 HRESULT firstChild([out, retval] IDOMNode** result);
156 - (DOMNode *)lastChild;
158 HRESULT lastChild([out, retval] IDOMNode** result);
161 - (DOMNode *)previousSibling;
163 HRESULT previousSibling([out, retval] IDOMNode** result);
166 - (DOMNode *)nextSibling;
168 HRESULT nextSibling([out, retval] IDOMNode** result);
171 - (DOMNamedNodeMap *)attributes;
173 HRESULT attributes([out, retval] IDOMNamedNodeMap** result);
176 - (DOMDocument *)ownerDocument;
178 HRESULT ownerDocument([out, retval] IDOMDocument** result);
181 - (DOMNode *)insertBefore:(DOMNode *)newChild :(DOMNode *)refChild;
183 HRESULT insertBefore([in] IDOMNode* newChild, [in] IDOMNode* refChild, [out, retval] IDOMNode** result);
186 - (DOMNode *)replaceChild:(DOMNode *)newChild :(DOMNode *)oldChild;
188 HRESULT replaceChild([in] IDOMNode* newChild, [in] IDOMNode* oldChild, [out, retval] IDOMNode** result);
191 - (DOMNode *)removeChild:(DOMNode *)oldChild;
193 HRESULT removeChild([in] IDOMNode* oldChild, [out, retval] IDOMNode** result);
196 - (DOMNode *)appendChild:(DOMNode *)newChild;
198 HRESULT appendChild([in] IDOMNode* oldChild, [out, retval] IDOMNode** result);
201 - (BOOL)hasChildNodes;
203 HRESULT hasChildNodes([out, retval] BOOL* result);
206 - (DOMNode *)cloneNode:(BOOL)deep;
208 HRESULT cloneNode([in] BOOL deep, [out, retval] IDOMNode** result);
216 - (BOOL)isSupported:(NSString *)feature :(NSString *)version;
218 HRESULT isSupported([in] BSTR feature, [in] BSTR version, [out, retval] BOOL* result);
221 - (NSString *)namespaceURI;
223 HRESULT namespaceURI([out, retval] BSTR* result);
226 - (NSString *)prefix;
228 HRESULT prefix([out, retval] BSTR* result);
231 - (void)setPrefix:(NSString *)prefix;
233 HRESULT setPrefix([in] BSTR prefix);
236 - (NSString *)localName;
238 HRESULT localName([out, retval] BSTR* result);
241 - (BOOL)hasAttributes;
243 HRESULT hasAttributes([out, retval] BOOL* result);
247 @interface DOMNodeList : DOMObject
252 uuid(10A05A96-CBD9-4493-83AD-FAFB952615CE),
253 pointer_default(unique)
255 interface IDOMNodeList : IDOMObject
258 - (DOMNode *)item:(unsigned)index;
260 HRESULT item([in] UINT index, [out, retval] IDOMNode** result);
265 HRESULT length([out, retval] UINT* result);
269 @interface DOMNamedNodeMap : DOMObject
274 uuid(E6CBF396-C9F9-431b-A8D6-BCB525067E9F),
275 pointer_default(unique)
277 interface IDOMNamedNodeMap : IDOMObject
280 - (DOMNode *)getNamedItem:(NSString *)name;
282 HRESULT getNamedItem([in] BSTR name, [out, retval] IDOMNode** result);
285 - (DOMNode *)setNamedItem:(DOMNode *)arg;
287 HRESULT setNamedItem([in] IDOMNode* arg, [out, retval] IDOMNode** result);
290 - (DOMNode *)removeNamedItem:(NSString *)name;
292 HRESULT removeNamedItem([in] BSTR name, [out, retval] IDOMNode** result);
295 - (DOMNode *)item:(unsigned)index;
297 HRESULT item([in] UINT index, [out, retval] IDOMNode** result);
302 HRESULT length([out, retval] UINT* result);
305 - (DOMNode *)getNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
307 HRESULT getNamedItemNS([in] BSTR namespaceURI, [in] BSTR localName, [out, retval] IDOMNode** result);
310 - (DOMNode *)setNamedItemNS:(DOMNode *)arg;
312 HRESULT setNamedItemNS([in] IDOMNode* arg, [out, retval] IDOMNode** result);
315 - (DOMNode *)removeNamedItemNS:(NSString *)namespaceURI :(NSString *)localName;
317 HRESULT removeNamedItemNS([in] BSTR namespaceURI, [in] BSTR localName, [out, retval] IDOMNode** result);
321 @interface DOMDocument : IDOMNode
326 uuid(A83C2C44-0BAC-45c7-8E17-6A49975D5CCA),
327 pointer_default(unique)
329 interface IDOMDocument : IDOMNode
332 - (DOMDocumentType *)doctype;
334 HRESULT doctype([out, retval] IDOMDocumentType** result);
337 - (DOMImplementation *)implementation;
339 HRESULT implementation([out, retval] IDOMImplementation** result);
342 - (DOMElement *)documentElement;
344 HRESULT documentElement([out, retval] IDOMElement** result);
347 - (DOMElement *)createElement:(NSString *)tagName;
349 HRESULT createElement([in] BSTR tagName, [out, retval] IDOMElement** result);
352 - (DOMDocumentFragment *)createDocumentFragment;
354 HRESULT createDocumentFragment([out, retval] IDOMDocumentFragment** result);
357 - (DOMText *)createTextNode:(NSString *)data;
359 HRESULT createTextNode([in] BSTR data, [out, retval] IDOMText** result);
362 - (DOMComment *)createComment:(NSString *)data;
364 HRESULT createComment([in] BSTR data, [out, retval] IDOMComment** result);
367 - (DOMCDATASection *)createCDATASection:(NSString *)data;
369 HRESULT createCDATASection([in] BSTR data, [out, retval] IDOMCDATASection** result);
372 - (DOMProcessingInstruction *)createProcessingInstruction:(NSString *)target :(NSString *)data;
374 HRESULT createProcessingInstruction([in] BSTR target, [in] BSTR data, [out, retval] IDOMProcessingInstruction** result);
377 - (DOMAttr *)createAttribute:(NSString *)name;
379 HRESULT createAttribute([in] BSTR name, [out, retval] IDOMAttr** result);
382 - (DOMEntityReference *)createEntityReference:(NSString *)name;
384 HRESULT createEntityReference([in] BSTR name, [out, retval] IDOMEntityReference** result);
387 - (DOMNodeList *)getElementsByTagName:(NSString *)tagname;
389 HRESULT getElementsByTagName([in] BSTR tagName, [out, retval] IDOMNodeList** result);
392 - (DOMNode *)importNode:(DOMNode *)importedNode :(BOOL)deep;
394 HRESULT importNode([in] IDOMNode* importedNode, [in] BOOL deep, [out, retval] IDOMNode** result);
397 - (DOMElement *)createElementNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
399 HRESULT createElementNS([in] BSTR namespaceURI, [in] BSTR qualifiedName, [out, retval] IDOMElement** result);
402 - (DOMAttr *)createAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName;
404 HRESULT createAttributeNS([in] BSTR namespaceURI, [in] BSTR qualifiedName, [out, retval] IDOMAttr** result);
407 - (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
409 HRESULT getElementsByTagNameNS([in] BSTR namespaceURI, [in] BSTR lcoalName, [out, retval] IDOMNodeList** result);
412 - (DOMElement *)getElementById:(NSString *)elementId;
414 HRESULT getElementById([in] BSTR elementId, [out, retval] IDOMElement** result);
418 @interface DOMCharacterData : IDOMNode
423 uuid(F4DED047-FE61-461a-BDBD-BB87F79DB713),
424 pointer_default(unique)
426 interface IDOMCharacterData : IDOMNode
431 HRESULT data([out, retval] BSTR* result);
434 - (void)setData:(NSString *)data;
436 HRESULT setData([in] BSTR data);
441 HRESULT length([out, retval] UINT* result);
444 - (NSString *)substringData:(unsigned)offset :(unsigned)count;
446 HRESULT substringData([in] UINT offset, [in] UINT count, [out, retval] BSTR* result);
449 - (void)appendData:(NSString *)arg;
451 HRESULT appendData([in] BSTR arg);
454 - (void)insertData:(unsigned)offset :(NSString *)arg;
456 HRESULT insertData([in] UINT offset, [in] BSTR arg);
459 - (void)deleteData:(unsigned)offset :(unsigned) count;
461 HRESULT deleteData([in] UINT offset, [in] UINT count);
464 - (void)replaceData:(unsigned)offset :(unsigned)count :(NSString *)arg;
466 HRESULT replaceData([in] UINT offset, [in] UINT count, [in] BSTR arg);
470 @interface DOMAttr : IDOMNode
475 uuid(B587E098-8206-4b5a-A7DB-422F218571A0),
476 pointer_default(unique)
478 interface IDOMAttr : IDOMNode
483 HRESULT name([out, retval] BSTR* result);
488 HRESULT specified([out, retval] BOOL* result);
493 HRESULT value([out, retval] BSTR* value);
496 - (void)setValue:(NSString *)value;
498 HRESULT setValue([in] BSTR value);
501 - (DOMElement *)ownerElement;
503 HRESULT ownerElement([out, retval] IDOMElement** result);
507 @interface DOMElement : IDOMNode
512 uuid(E053A35B-7775-4859-80EA-C35D02D145A2),
513 pointer_default(unique)
515 interface IDOMElement : IDOMNode
518 - (NSString *)tagName;
520 HRESULT tagName([out, retval] BSTR* result);
523 - (NSString *)getAttribute:(NSString *)name;
525 HRESULT getAttribute([in] BSTR name, [out, retval] BSTR* result);
528 - (void)setAttribute:(NSString *)name :(NSString *)value;
530 HRESULT setResult([in] BSTR name, [in] BSTR value);
533 - (void)removeAttribute:(NSString *)name;
535 HRESULT removeAttribute([in] BSTR name);
538 - (DOMAttr *)getAttributeNode:(NSString *)name;
540 HRESULT getAttributeNode([in] BSTR name, [out, retval] IDOMAttr** result);
543 - (DOMAttr *)setAttributeNode:(DOMAttr *)newAttr;
545 HRESULT setAttributeNode([in] IDOMAttr* newAttr, [out, retval] IDOMAttr** result);
548 - (DOMAttr *)removeAttributeNode:(DOMAttr *)oldAttr;
550 HRESULT removeAttributeNode([in] IDOMAttr* oldAttr, [out, retval] IDOMAttr** result);
553 - (DOMNodeList *)getElementsByTagName:(NSString *)name;
555 HRESULT getElementsByTagName([in] BSTR name, [out, retval] IDOMNodeList** result);
558 - (NSString *)getAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
560 HRESULT getAttributeNS([in] BSTR namespaceURI, [in] BSTR localName, [out, retval] BSTR* result);
563 - (void)setAttributeNS:(NSString *)namespaceURI :(NSString *)qualifiedName :(NSString *)value;
565 HRESULT setAttributeNS([in] BSTR namespaceURI, [in] BSTR qualifiedName, [in] BSTR value);
568 - (void)removeAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
570 HRESULT removeAttributeNS([in] BSTR namespaceURI, [in] BSTR localName);
573 - (DOMAttr *)getAttributeNodeNS:(NSString *)namespaceURI :(NSString *)localName;
575 HRESULT getAttributeNodeNS([in] BSTR namespaceURI, [in] BSTR localName, [out, retval] IDOMAttr** result);
578 - (DOMAttr *)setAttributeNodeNS:(DOMAttr *)newAttr;
580 HRESULT setAttributeNodeNS([in] IDOMAttr* newAttr, [out, retval] IDOMAttr** result);
583 - (DOMNodeList *)getElementsByTagNameNS:(NSString *)namespaceURI :(NSString *)localName;
585 HRESULT getElementsByTagNameNS([in] BSTR namespaceURI, [in] BSTR localName, [out, retval] IDOMNodeList** result);
588 - (BOOL)hasAttribute:(NSString *)name;
590 HRESULT hasAttribute([in] BSTR name, [out, retval] BOOL* result);
593 - (BOOL)hasAttributeNS:(NSString *)namespaceURI :(NSString *)localName;
595 HRESULT hasAttributeNS([in] BSTR namespaceURI, [in] BSTR localName, [out, retval] BOOL* result);
599 @interface DOMText : DOMCharacterData
604 uuid(74638F45-1AA0-4db5-958C-82066E00BD2B),
605 pointer_default(unique)
607 interface IDOMText : IDOMCharacterData
610 - (DOMText *)splitText:(unsigned)offset;
612 HRESULT splitText([in] UINT offset, [out, retval] IDOMText** result);
616 @interface DOMComment : DOMCharacterData
621 uuid(118002E8-847F-4b1a-968C-B25A6AC7B128),
622 pointer_default(unique)
624 interface IDOMComment : IDOMCharacterData
629 @interface DOMCDATASection : DOMText
634 uuid(31B506C1-45A3-4d72-815A-311B0A897E58),
635 pointer_default(unique)
637 interface IDOMCDATASection : IDOMText
642 @interface DOMDocumentType : IDOMNode
647 uuid(17FCE6EA-4164-4bd4-9DBF-0395FBF37FD3),
648 pointer_default(unique)
650 interface IDOMDocumentType : IDOMNode
655 HRESULT name([out, retval] BSTR* result);
658 - (DOMNamedNodeMap *)entities;
660 HRESULT entities([out, retval] IDOMNamedNodeMap** result);
663 - (DOMNamedNodeMap *)notations;
665 HRESULT notations([out, retval] IDOMNamedNodeMap** result);
668 - (NSString *)publicId;
670 HRESULT publicId([out, retval] BSTR* result);
673 - (NSString *)systemId;
675 HRESULT systemId([out, retval] BSTR* result);
678 - (NSString *)internalSubset;
680 HRESULT internalSubset([out, retval] BSTR* result);
684 @interface DOMEntityReference : IDOMNode
689 uuid(0593CE45-15B2-44af-BBD0-5A1654F8240E),
690 pointer_default(unique)
692 interface IDOMEntityReference : IDOMNode
697 @interface DOMProcessingInstruction : IDOMNode
702 uuid(D99D2F48-ABF3-426a-9339-54681E1AFCA9),
703 pointer_default(unique)
705 interface IDOMProcessingInstruction : IDOMNode
708 - (NSString *)target;
710 HRESULT target([out, retval] BSTR* result);
715 HRESULT data([out, retval] BSTR* result);
718 - (void)setData:(NSString *)data;
720 HRESULT setData([in] BSTR data);
724 @interface DOMDocumentFragment : IDOMNode
729 uuid(09D35665-8396-4868-949E-8AA2407A6E10),
730 pointer_default(unique)
732 interface IDOMDocumentFragment : IDOMNode