Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1207 lines
39 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998.
  5. //
  6. // File: xmldom.idl
  7. //
  8. //--------------------------------------------------------------------------
  9. #ifdef UNIX
  10. import "ocidl.idl";
  11. #endif
  12. cpp_quote("//+-------------------------------------------------------------------------")
  13. cpp_quote("//")
  14. cpp_quote("// Microsoft Windows")
  15. cpp_quote("// Copyright (C) Microsoft Corporation, 1998.")
  16. cpp_quote("//")
  17. cpp_quote("//--------------------------------------------------------------------------")
  18. #include "xmldomdid.h"
  19. #include <idispids.h>
  20. interface IXMLDOMImplementation;
  21. interface IXMLDOMNode;
  22. interface IXMLDOMDocumentFragment;
  23. interface IXMLDOMDocument;
  24. interface IXMLDOMNodeList;
  25. interface IXMLDOMNamedNodeMap;
  26. interface IXMLDOMCharacterData;
  27. interface IXMLDOMAttribute;
  28. interface IXMLDOMElement;
  29. interface IXMLDOMText;
  30. interface IXMLDOMComment;
  31. interface IXMLDOMProcessingInstruction;
  32. interface IXMLDOMCDATASection;
  33. interface IXMLDOMDocumentType;
  34. interface IXMLDOMNotation;
  35. interface IXMLDOMEntity;
  36. interface IXMLDOMEntityReference;
  37. interface IXMLDOMParseError;
  38. interface IXTLRuntime;
  39. typedef [
  40. helpstring("Constants that define a node's type")
  41. ] enum tagDOMNodeType
  42. {
  43. NODE_INVALID, // = 0
  44. NODE_ELEMENT, // = 1
  45. NODE_ATTRIBUTE, // = 2
  46. NODE_TEXT, // = 3
  47. NODE_CDATA_SECTION, // = 4
  48. NODE_ENTITY_REFERENCE, // = 5
  49. NODE_ENTITY, // = 6
  50. NODE_PROCESSING_INSTRUCTION, // = 7
  51. NODE_COMMENT, // = 8
  52. NODE_DOCUMENT, // = 9
  53. NODE_DOCUMENT_TYPE, // = 10
  54. NODE_DOCUMENT_FRAGMENT, // = 11
  55. NODE_NOTATION // = 12
  56. } DOMNodeType;
  57. [
  58. local, object,
  59. uuid(2933BF80-7B36-11d2-B20E-00C04F983E60), // IID_INode
  60. odl,
  61. dual,
  62. oleautomation,
  63. nonextensible,
  64. helpstring("Core DOM node interface"),
  65. pointer_default(unique)
  66. ]
  67. interface IXMLDOMNode : IDispatch
  68. {
  69. // readonly attribute wstring nodeName;
  70. [propget, id(DISPID_DOM_NODE_NODENAME),
  71. helpstring("name of the node")]
  72. HRESULT nodeName(
  73. [out, retval] BSTR * name);
  74. // attribute wstring nodeValue;
  75. [propget, id(DISPID_DOM_NODE_NODEVALUE),
  76. helpstring("value stored in the node")]
  77. HRESULT nodeValue(
  78. [out, retval] VARIANT * value);
  79. [propput, id(DISPID_DOM_NODE_NODEVALUE),
  80. helpstring("value stored in the node")]
  81. HRESULT nodeValue(
  82. [in] VARIANT value);
  83. // readonly attribute unsigned short nodeType;
  84. [propget, id(DISPID_DOM_NODE_NODETYPE),
  85. helpstring("the node's type")]
  86. HRESULT nodeType(
  87. [out, retval] DOMNodeType * type);
  88. // readonly attribute Node parentNode;
  89. [propget, id(DISPID_DOM_NODE_PARENTNODE),
  90. helpstring("parent of the node")]
  91. HRESULT parentNode(
  92. [out, retval] IXMLDOMNode ** parent);
  93. // readonly attribute NodeList childNodes;
  94. [propget, id(DISPID_DOM_NODE_CHILDNODES),
  95. helpstring("the collection of the node's children")]
  96. HRESULT childNodes(
  97. [out, retval] IXMLDOMNodeList ** childList);
  98. // readonly attribute Node firstChild;
  99. [propget,id(DISPID_DOM_NODE_FIRSTCHILD),
  100. helpstring("first child of the node")]
  101. HRESULT firstChild(
  102. [out, retval] IXMLDOMNode ** firstChild);
  103. // readonly attribute Node lastChild;
  104. [propget,id(DISPID_DOM_NODE_LASTCHILD),
  105. helpstring("first child of the node")]
  106. HRESULT lastChild(
  107. [out, retval] IXMLDOMNode ** lastChild);
  108. // readonly attribute Node previousSibling;
  109. [propget,id(DISPID_DOM_NODE_PREVIOUSSIBLING),
  110. helpstring("left sibling of the node")]
  111. HRESULT previousSibling(
  112. [out, retval] IXMLDOMNode ** previousSibling);
  113. // readonly attribute Node nextSibling;
  114. [propget,id(DISPID_DOM_NODE_NEXTSIBLING),
  115. helpstring("right sibling of the node")]
  116. HRESULT nextSibling(
  117. [out, retval] IXMLDOMNode ** nextSibling);
  118. // readonly attribute NamedNodeMap attributes;
  119. [propget, id(DISPID_DOM_NODE_ATTRIBUTES),
  120. helpstring("the collection of the node's attributes")]
  121. HRESULT attributes(
  122. [out, retval] IXMLDOMNamedNodeMap ** attributeMap);
  123. // Node insertBefore(in Node newChild,
  124. // in Node refChild)
  125. // raises(DOMException);
  126. [id(DISPID_DOM_NODE_INSERTBEFORE),
  127. helpstring("insert a child node")]
  128. HRESULT insertBefore(
  129. [in] IXMLDOMNode * newChild,
  130. [in] VARIANT refChild,
  131. [out, retval] IXMLDOMNode ** outNewChild);
  132. // Node replaceChild(in Node newChild,
  133. // in Node oldChild)
  134. // raises(DOMException);
  135. [id(DISPID_DOM_NODE_REPLACECHILD),
  136. helpstring("replace a child node")]
  137. HRESULT replaceChild(
  138. [in] IXMLDOMNode * newChild,
  139. [in] IXMLDOMNode * oldChild,
  140. [out, retval] IXMLDOMNode ** outOldChild);
  141. // Node removeChild(in Node childNode)
  142. // raises(DOMException);
  143. [id(DISPID_DOM_NODE_REMOVECHILD),
  144. helpstring("remove a child node")]
  145. HRESULT removeChild(
  146. [in] IXMLDOMNode * childNode,
  147. [out, retval] IXMLDOMNode ** oldChild);
  148. // Node appendChild(in Node newChild);
  149. [id(DISPID_DOM_NODE_APPENDCHILD),
  150. helpstring("append a child node")]
  151. HRESULT appendChild(
  152. [in] IXMLDOMNode * newChild,
  153. [out, retval] IXMLDOMNode ** outNewChild);
  154. // boolean hasChildNodes();
  155. [id(DISPID_DOM_NODE_HASCHILDNODES),
  156. helpstring("")]
  157. HRESULT hasChildNodes(
  158. [out, retval] VARIANT_BOOL * hasChild);
  159. // readonly attribute Node ownerDocument;
  160. [propget, id(DISPID_DOM_NODE_OWNERDOC),
  161. helpstring("document that contains the node")]
  162. HRESULT ownerDocument(
  163. [out, retval] IXMLDOMDocument ** DOMDocument);
  164. // Node cloneNode(in boolean deep);
  165. [id(DISPID_DOM_NODE_CLONENODE),
  166. helpstring("")]
  167. HRESULT cloneNode(
  168. [in] VARIANT_BOOL deep,
  169. [out, retval] IXMLDOMNode ** cloneRoot);
  170. [propget, id(DISPID_XMLDOM_NODE_STRINGTYPE),
  171. helpstring("the type of node in string form")]
  172. HRESULT nodeTypeString(
  173. [retval, out] BSTR * nodeType);
  174. [propget, id(DISPID_XMLDOM_NODE_TEXT),
  175. helpstring("text content of the node and subtree")]
  176. HRESULT text(
  177. [retval, out] BSTR * text);
  178. [propput, id(DISPID_XMLDOM_NODE_TEXT),
  179. helpstring("text content of the node and subtree")]
  180. HRESULT text(
  181. [in] BSTR text);
  182. [propget, id(DISPID_XMLDOM_NODE_SPECIFIED),
  183. helpstring("indicates whether node is a default value")]
  184. HRESULT specified(
  185. [out, retval] VARIANT_BOOL * isSpecified);
  186. // DTD Navigation.
  187. [propget, id(DISPID_XMLDOM_NODE_DEFINITION),
  188. helpstring("pointer to the definition of the node in the DTD or schema")]
  189. HRESULT definition(
  190. [retval,out] IXMLDOMNode ** definitionNode);
  191. [propget, id(DISPID_XMLDOM_NODE_NODETYPEDVALUE),
  192. helpstring("get the strongly typed value of the node")]
  193. HRESULT nodeTypedValue(
  194. [retval, out] VARIANT * typedValue);
  195. [propput, id(DISPID_XMLDOM_NODE_NODETYPEDVALUE),
  196. helpstring("get the strongly typed value of the node")]
  197. HRESULT nodeTypedValue(
  198. [in] VARIANT typedValue);
  199. [propget, id(DISPID_XMLDOM_NODE_DATATYPE),
  200. helpstring("the data type of the node")]
  201. HRESULT dataType(
  202. [retval, out] VARIANT * dataTypeName); // BSTR or VT_NULL
  203. [propput, id(DISPID_XMLDOM_NODE_DATATYPE),
  204. helpstring("the data type of the node")]
  205. HRESULT dataType(
  206. [in] BSTR dataTypeName);
  207. [propget, id(DISPID_XMLDOM_NODE_XML),
  208. helpstring("return the XML source for the node and each of its descendants")]
  209. HRESULT xml(
  210. [retval, out] BSTR * xmlString);
  211. [id(DISPID_XMLDOM_NODE_TRANSFORMNODE),
  212. helpstring("apply the stylesheet to the subtree")]
  213. HRESULT transformNode(
  214. [in] IXMLDOMNode * stylesheet,
  215. [retval, out] BSTR * xmlString);
  216. [id(DISPID_XMLDOM_NODE_SELECTNODES),
  217. helpstring("execute query on the subtree")]
  218. HRESULT selectNodes(
  219. [in] BSTR queryString,
  220. [retval, out] IXMLDOMNodeList** resultList);
  221. [id(DISPID_XMLDOM_NODE_SELECTSINGLENODE),
  222. helpstring("execute query on the subtree")]
  223. HRESULT selectSingleNode(
  224. [in] BSTR queryString,
  225. [retval, out] IXMLDOMNode** resultNode);
  226. [propget,id(DISPID_XMLDOM_NODE_PARSED),
  227. helpstring("has sub-tree been completely parsed")]
  228. HRESULT parsed(
  229. [retval, out] VARIANT_BOOL * isParsed);
  230. [propget, id(DISPID_XMLDOM_NODE_NAMESPACE),
  231. helpstring("the URI for the namespace applying to the node")]
  232. HRESULT namespaceURI(
  233. [retval, out] BSTR * namespaceURI);
  234. [propget, id(DISPID_XMLDOM_NODE_PREFIX),
  235. helpstring("the prefix for the namespace applying to the node")]
  236. HRESULT prefix(
  237. [retval, out] BSTR * prefixString);
  238. [propget, id(DISPID_XMLDOM_NODE_BASENAME),
  239. helpstring("the base name of the node (nodename with the prefix stripped off)")]
  240. HRESULT baseName(
  241. [retval, out] BSTR * nameString);
  242. [id(DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT),
  243. helpstring("apply the stylesheet to the subtree, returning the result through a document or a stream")]
  244. HRESULT transformNodeToObject(
  245. [in] IXMLDOMNode * stylesheet,
  246. [in] VARIANT outputObject);
  247. };
  248. [
  249. local, object,
  250. uuid(2933BF81-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument
  251. odl,
  252. dual,
  253. oleautomation,
  254. nonextensible,
  255. pointer_default(unique)
  256. ]
  257. interface IXMLDOMDocument : IXMLDOMNode
  258. {
  259. // readonly attribute DocumentType doctype;
  260. [propget, id(DISPID_DOM_DOCUMENT_DOCTYPE),
  261. helpstring("node corresponding to the DOCTYPE")]
  262. HRESULT doctype(
  263. [out, retval] IXMLDOMDocumentType ** documentType);
  264. // readonly attribute DOMImplementation implementation;
  265. [propget, id(DISPID_DOM_DOCUMENT_IMPLEMENTATION),
  266. helpstring("info on this DOM implementation")]
  267. HRESULT implementation(
  268. [out, retval] IXMLDOMImplementation ** impl);
  269. // attribute Element documentElement;
  270. [propget, id(DISPID_DOM_DOCUMENT_DOCUMENTELEMENT),
  271. helpstring("the root of the tree")]
  272. HRESULT documentElement(
  273. [out, retval] IXMLDOMElement ** DOMElement);
  274. [propputref, id(DISPID_DOM_DOCUMENT_DOCUMENTELEMENT),
  275. helpstring("the root of the tree")]
  276. HRESULT documentElement(
  277. [in] IXMLDOMElement * DOMElement);
  278. // Element createElement(in wstring tagName);
  279. [id(DISPID_DOM_DOCUMENT_CREATEELEMENT),
  280. helpstring("create an Element node")]
  281. HRESULT createElement(
  282. [in] BSTR tagName,
  283. [out, retval] IXMLDOMElement ** element);
  284. // DocumentFragment createDocumentFragment();
  285. [id(DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT),
  286. helpstring("create a DocumentFragment node")]
  287. HRESULT createDocumentFragment(
  288. [out, retval] IXMLDOMDocumentFragment ** docFrag );
  289. // Text createTextNode(in wstring data);
  290. [id(DISPID_DOM_DOCUMENT_CREATETEXTNODE),
  291. helpstring("create a text node")]
  292. HRESULT createTextNode(
  293. [in] BSTR data,
  294. [out, retval] IXMLDOMText ** text);
  295. // Comment createComment(in wstring data);
  296. [id(DISPID_DOM_DOCUMENT_CREATECOMMENT),
  297. helpstring("create a comment node")]
  298. HRESULT createComment(
  299. [in] BSTR data,
  300. [out, retval] IXMLDOMComment ** comment);
  301. // CDATASection createCDATASection(in wstring data);
  302. [id(DISPID_DOM_DOCUMENT_CREATECDATASECTION),
  303. helpstring("create a CDATA section node")]
  304. HRESULT createCDATASection(
  305. [in] BSTR data,
  306. [out, retval] IXMLDOMCDATASection ** cdata);
  307. // ProcessingInstruction createProcessingInstruction(in wstring target,
  308. // in wstring data);
  309. [id(DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION),
  310. helpstring("create a processing instruction node")]
  311. HRESULT createProcessingInstruction(
  312. [in] BSTR target,
  313. [in] BSTR data,
  314. [out, retval] IXMLDOMProcessingInstruction ** pi);
  315. // Attribute createAttribute(in wstring name);
  316. [id(DISPID_DOM_DOCUMENT_CREATEATTRIBUTE),
  317. helpstring("create an attribute node")]
  318. HRESULT createAttribute(
  319. [in] BSTR name,
  320. [out, retval] IXMLDOMAttribute ** attribute);
  321. // EntityReference createEntityReference(in wstring name);
  322. [id(DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE),
  323. helpstring("create an entity reference node")]
  324. HRESULT createEntityReference(
  325. [in] BSTR name,
  326. [out, retval] IXMLDOMEntityReference ** entityRef);
  327. // NodeList getElementsByTagName(in wstring tagname);
  328. [id(DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME),
  329. helpstring("build a list of elements by name")]
  330. HRESULT getElementsByTagName(
  331. [in] BSTR tagName,
  332. [out, retval] IXMLDOMNodeList ** resultList);
  333. [id(DISPID_XMLDOM_DOCUMENT_CREATENODE),
  334. helpstring("create a node of the specified node type and name")]
  335. HRESULT createNode(
  336. [in] VARIANT Type,
  337. [in] BSTR name,
  338. [in] BSTR namespaceURI,
  339. [retval, out] IXMLDOMNode ** node);
  340. [id(DISPID_XMLDOM_DOCUMENT_NODEFROMID),
  341. helpstring("retrieve node from it's ID")]
  342. HRESULT nodeFromID(
  343. [in] BSTR idString,
  344. [retval, out] IXMLDOMNode ** node);
  345. [id(DISPID_XMLDOM_DOCUMENT_LOAD),
  346. helpstring("load document from the specified XML source")]
  347. HRESULT load(
  348. [in] VARIANT xmlSource,
  349. [out, retval] VARIANT_BOOL * isSuccessful);
  350. [propget, id(DISPID_READYSTATE),
  351. helpstring("get the state of the XML document")]
  352. HRESULT readyState(
  353. [retval, out] long * value);
  354. [propget, id(DISPID_XMLDOM_DOCUMENT_PARSEERROR),
  355. helpstring("get the last parser error")]
  356. HRESULT parseError(
  357. [retval, out] IXMLDOMParseError ** errorObj);
  358. [propget, id(DISPID_XMLDOM_DOCUMENT_URL),
  359. helpstring("get the URL for the loaded XML document")]
  360. HRESULT url(
  361. [retval, out] BSTR * urlString);
  362. [propget, id(DISPID_XMLDOM_DOCUMENT_ASYNC),
  363. helpstring("flag for asynchronous download")]
  364. HRESULT async(
  365. [retval, out] VARIANT_BOOL * isAsync);
  366. [propput, id(DISPID_XMLDOM_DOCUMENT_ASYNC),
  367. helpstring("flag for asynchronous download")]
  368. HRESULT async(
  369. [in] VARIANT_BOOL isAsync);
  370. [id(DISPID_XMLDOM_DOCUMENT_ABORT),
  371. helpstring("abort an asynchronous download")]
  372. HRESULT abort();
  373. [id(DISPID_XMLDOM_DOCUMENT_LOADXML),
  374. helpstring("load the document from a string")]
  375. HRESULT loadXML(
  376. [in] BSTR bstrXML,
  377. [out, retval] VARIANT_BOOL * isSuccessful);
  378. [id(DISPID_XMLDOM_DOCUMENT_SAVE),
  379. helpstring("save the document to a specified desination")]
  380. HRESULT save(
  381. [in] VARIANT desination);
  382. [propget, id(DISPID_XMLDOM_DOCUMENT_VALIDATE),
  383. helpstring("indicates whether the parser performs validation")]
  384. HRESULT validateOnParse(
  385. [retval, out] VARIANT_BOOL * isValidating);
  386. [propput, id(DISPID_XMLDOM_DOCUMENT_VALIDATE),
  387. helpstring("indicates whether the parser performs validation")]
  388. HRESULT validateOnParse(
  389. [in] VARIANT_BOOL isValidating);
  390. [propget, id(DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE),
  391. helpstring("indicates whether the parser resolves references to external DTD/Entities/Schema")]
  392. HRESULT resolveExternals(
  393. [retval,out] VARIANT_BOOL * isResolving);
  394. [propput, id(DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE),
  395. helpstring("indicates whether the parser resolves references to external DTD/Entities/Schema")]
  396. HRESULT resolveExternals(
  397. [in] VARIANT_BOOL isResolving);
  398. [propget, id(DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE),
  399. helpstring("indicates whether the parser preserves whitespace")]
  400. HRESULT preserveWhiteSpace(
  401. [retval,out] VARIANT_BOOL * isPreserving);
  402. [propput, id(DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE),
  403. helpstring("indicates whether the parser preserves whitespace")]
  404. HRESULT preserveWhiteSpace(
  405. [in] VARIANT_BOOL isPreserving);
  406. [propput, id(DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE),
  407. helpstring("register a readystatechange event handler")]
  408. HRESULT onreadystatechange(
  409. [in] VARIANT readystatechangeSink);
  410. [propput, id(DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE),
  411. helpstring("register an ondataavailable event handler")]
  412. HRESULT ondataavailable(
  413. [in] VARIANT ondataavailableSink);
  414. [propput, id(DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE),
  415. helpstring("register an ontransformnode event handler")]
  416. HRESULT ontransformnode(
  417. [in] VARIANT ontransformnodeSink);
  418. };
  419. [
  420. local, object,
  421. uuid(2933BF82-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNodeList
  422. odl,
  423. dual,
  424. oleautomation,
  425. nonextensible,
  426. pointer_default(unique)
  427. ]
  428. interface IXMLDOMNodeList : IDispatch
  429. {
  430. // Node item(in unsigned long index);
  431. [propget, id(DISPID_VALUE),
  432. helpstring("collection of nodes")]
  433. HRESULT item(
  434. [in] long index,
  435. [out, retval] IXMLDOMNode ** listItem);
  436. // readonly attribute unsigned long length;
  437. [propget, id(DISPID_DOM_NODELIST_LENGTH),
  438. helpstring("number of nodes in the collection")]
  439. HRESULT length(
  440. [out, retval] long * listLength);
  441. [id(DISPID_XMLDOM_NODELIST_NEXTNODE),
  442. helpstring("get next node from iterator")]
  443. HRESULT nextNode(
  444. [out, retval] IXMLDOMNode ** nextItem);
  445. [id(DISPID_XMLDOM_NODELIST_RESET),
  446. helpstring("reset the position of iterator")]
  447. HRESULT reset();
  448. [propget, restricted, hidden,
  449. id(DISPID_NEWENUM)]
  450. HRESULT _newEnum(
  451. [retval, out] IUnknown ** ppUnk);
  452. };
  453. [
  454. local, object,
  455. uuid(2933BF83-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNamedNodeMap
  456. odl,
  457. dual,
  458. oleautomation,
  459. nonextensible,
  460. pointer_default(unique)
  461. ]
  462. interface IXMLDOMNamedNodeMap : IDispatch
  463. {
  464. // Node getNamedItem(in wstring name);
  465. [id(DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM),
  466. helpstring("lookup item by name")]
  467. HRESULT getNamedItem(
  468. [in] BSTR name,
  469. [out, retval] IXMLDOMNode ** namedItem);
  470. // void setNamedItem(in Node arg);
  471. [id(DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM),
  472. helpstring("set item by name")]
  473. HRESULT setNamedItem(
  474. [in] IXMLDOMNode * newItem,
  475. [out, retval] IXMLDOMNode ** nameItem);
  476. // Node removeNamedItem(in wstring name);
  477. [id(DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM),
  478. helpstring("remove item by name")]
  479. HRESULT removeNamedItem(
  480. [in] BSTR name,
  481. [out, retval] IXMLDOMNode ** namedItem);
  482. // Node item(in unsigned long index);
  483. [propget, id(DISPID_VALUE),
  484. helpstring("collection of nodes")]
  485. HRESULT item(
  486. [in] long index,
  487. [out, retval] IXMLDOMNode ** listItem);
  488. // readonly attribute unsigned long length;
  489. [propget, id(DISPID_DOM_NODELIST_LENGTH),
  490. helpstring("number of nodes in the collection")]
  491. HRESULT length(
  492. [out, retval] long * listLength);
  493. // Node getQualifiedItem(in wstring name,in Node namespace);
  494. [id(DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM),
  495. helpstring("lookup the item by name and namespace")]
  496. HRESULT getQualifiedItem(
  497. [in] BSTR baseName,
  498. [in] BSTR namespaceURI,
  499. [out, retval] IXMLDOMNode ** qualifiedItem);
  500. // Node removeQualifiedItem(in wstring name,in Node namespace);
  501. [id(DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM),
  502. helpstring("remove the item by name and namespace")]
  503. HRESULT removeQualifiedItem(
  504. [in] BSTR baseName,
  505. [in] BSTR namespaceURI,
  506. [out, retval] IXMLDOMNode ** qualifiedItem);
  507. [id(DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE),
  508. helpstring("get next node from iterator")]
  509. HRESULT nextNode(
  510. [out, retval] IXMLDOMNode ** nextItem);
  511. [id(DISPID_XMLDOM_NAMEDNODEMAP_RESET),
  512. helpstring("reset the position of iterator")]
  513. HRESULT reset();
  514. [propget, restricted, hidden,
  515. id(DISPID_NEWENUM)]
  516. HRESULT _newEnum(
  517. [retval, out] IUnknown ** ppUnk);
  518. };
  519. [
  520. local, object,
  521. uuid(3efaa413-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMDocumentFragment
  522. odl,
  523. dual,
  524. oleautomation,
  525. nonextensible,
  526. pointer_default(unique)
  527. ]
  528. interface IXMLDOMDocumentFragment : IXMLDOMNode
  529. {
  530. };
  531. [
  532. local, object,
  533. uuid(2933BF84-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMCharacterData
  534. odl,
  535. dual,
  536. oleautomation,
  537. nonextensible,
  538. pointer_default(unique)
  539. ]
  540. interface IXMLDOMCharacterData : IXMLDOMNode
  541. {
  542. // attribute wstring data;
  543. [propget, id(DISPID_DOM_DATA_DATA),
  544. helpstring("value of the node")]
  545. HRESULT data(
  546. [out, retval] BSTR * data);
  547. [propput, id(DISPID_DOM_DATA_DATA),
  548. helpstring("value of the node")]
  549. HRESULT data(
  550. [in] BSTR data);
  551. // readonly attribute unsigned long length;
  552. [propget, id(DISPID_DOM_DATA_LENGTH),
  553. helpstring("number of characters in value")]
  554. HRESULT length(
  555. [out, retval] long * dataLength);
  556. // wstring substring(in unsigned long offset,
  557. // in unsigned long count)
  558. // raises(DOMException);
  559. [id(DISPID_DOM_DATA_SUBSTRING),
  560. helpstring("retrieve substring of value")]
  561. HRESULT substringData(
  562. [in] long offset,
  563. [in] long count,
  564. [out, retval] BSTR * data);
  565. // void append(in wstring arg);
  566. [id(DISPID_DOM_DATA_APPEND),
  567. helpstring("append string to value")]
  568. HRESULT appendData(
  569. [in] BSTR data);
  570. // void insert(in unsigned long offset,
  571. // in wstring arg)
  572. // raises(DOMException);
  573. [id(DISPID_DOM_DATA_INSERT),
  574. helpstring("insert string into value")]
  575. HRESULT insertData(
  576. [in] long offset,
  577. [in] BSTR data);
  578. // void delete(in unsigned long offset,
  579. // in unsigned long count)
  580. // raises(DOMException);
  581. [id(DISPID_DOM_DATA_DELETE),
  582. helpstring("delete string within the value")]
  583. HRESULT deleteData(
  584. [in] long offset,
  585. [in] long count);
  586. // void replace(in unsigned long offset,
  587. // in unsigned long count,
  588. // in wstring arg)
  589. // raises(DOMException);
  590. [id(DISPID_DOM_DATA_REPLACE),
  591. helpstring("replace string within the value")]
  592. HRESULT replaceData(
  593. [in] long offset,
  594. [in] long count,
  595. [in] BSTR data);
  596. };
  597. [
  598. local, object,
  599. uuid(2933BF85-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMAttribute
  600. odl,
  601. dual,
  602. oleautomation,
  603. nonextensible,
  604. pointer_default(unique)
  605. ]
  606. interface IXMLDOMAttribute : IXMLDOMNode
  607. {
  608. // wstring name;
  609. [propget, id(DISPID_DOM_ATTRIBUTE_GETNAME),
  610. helpstring("get name of the attribute")]
  611. HRESULT name(
  612. [out, retval] BSTR * attributeName);
  613. // attribute boolean specified;
  614. // ! This is defined as an extended property on IXMLDOMNode
  615. // attribute wstring value;
  616. [propget, id(DISPID_DOM_ATTRIBUTE_VALUE),
  617. helpstring("string value of the attribute")]
  618. HRESULT value(
  619. [out, retval] VARIANT * attributeValue);
  620. [propput, id(DISPID_DOM_ATTRIBUTE_VALUE),
  621. helpstring("string value of the attribute")]
  622. HRESULT value(
  623. [in] VARIANT attributeValue);
  624. };
  625. [
  626. local, object,
  627. uuid(2933BF86-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMElement
  628. odl,
  629. dual,
  630. oleautomation,
  631. nonextensible,
  632. pointer_default(unique)
  633. ]
  634. interface IXMLDOMElement : IXMLDOMNode
  635. {
  636. // readonly attribute wstring tagName;
  637. [propget, id(DISPID_DOM_ELEMENT_GETTAGNAME),
  638. helpstring("get the tagName of the element")]
  639. HRESULT tagName(
  640. [out, retval] BSTR * tagName);
  641. // wstring getAttribute(in wstring name);
  642. [id(DISPID_DOM_ELEMENT_GETATTRIBUTE),
  643. helpstring("look up the string value of an attribute by name")]
  644. HRESULT getAttribute(
  645. [in] BSTR name,
  646. [out, retval] VARIANT * value);
  647. // void setAttribute(in string name,
  648. // in string value);
  649. [id(DISPID_DOM_ELEMENT_SETATTRIBUTE),
  650. helpstring("set the string value of an attribute by name")]
  651. HRESULT setAttribute(
  652. [in] BSTR name,
  653. [in] VARIANT value);
  654. // void removeAttribute(in wstring name);
  655. [id(DISPID_DOM_ELEMENT_REMOVEATTRIBUTE),
  656. helpstring("remove an attribute by name")]
  657. HRESULT removeAttribute(
  658. [in] BSTR name);
  659. // Attribute getAttributeNode(in wstring name);
  660. [id(DISPID_DOM_ELEMENT_GETATTRIBUTENODE),
  661. helpstring("look up the attribute node by name")]
  662. HRESULT getAttributeNode(
  663. [in] BSTR name,
  664. [out, retval] IXMLDOMAttribute ** attributeNode);
  665. // void setAttributeNode(in Attribute newAttr);
  666. [id(DISPID_DOM_ELEMENT_SETATTRIBUTENODE),
  667. helpstring("set the specified attribute on the element")]
  668. HRESULT setAttributeNode(
  669. [in] IXMLDOMAttribute * DOMAttribute,
  670. [out, retval] IXMLDOMAttribute ** attributeNode);
  671. // void removeAttributeNode(in Attribute oldAttr);
  672. [id(DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE),
  673. helpstring("remove the specified attribute")]
  674. HRESULT removeAttributeNode(
  675. [in] IXMLDOMAttribute * DOMAttribute,
  676. [out, retval] IXMLDOMAttribute ** attributeNode);
  677. // NodeList getElementsByTagName(in wstring tagname);
  678. [id(DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME),
  679. helpstring("build a list of elements by name")]
  680. HRESULT getElementsByTagName(
  681. [in] BSTR tagName,
  682. [out, retval] IXMLDOMNodeList ** resultList);
  683. // void normalize();
  684. [id(DISPID_DOM_ELEMENT_NORMALIZE),
  685. helpstring("collapse all adjacent text nodes in sub-tree")]
  686. HRESULT normalize();
  687. };
  688. [
  689. local, object,
  690. uuid(2933BF87-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMText
  691. odl,
  692. dual,
  693. oleautomation,
  694. nonextensible,
  695. pointer_default(unique)
  696. ]
  697. interface IXMLDOMText : IXMLDOMCharacterData
  698. {
  699. // Text splitText(in unsigned long offset);
  700. [id(DISPID_DOM_TEXT_SPLITTEXT),
  701. helpstring("split the text node into two text nodes at the position specified")]
  702. HRESULT splitText(
  703. [in] long offset,
  704. [out, retval] IXMLDOMText ** rightHandTextNode);
  705. };
  706. [
  707. local, object,
  708. uuid(2933BF88-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMComment
  709. odl,
  710. dual,
  711. oleautomation,
  712. nonextensible,
  713. pointer_default(unique)
  714. ]
  715. interface IXMLDOMComment : IXMLDOMCharacterData
  716. {
  717. };
  718. [
  719. local, object,
  720. uuid(2933BF89-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMProcessingInstruction
  721. odl,
  722. dual,
  723. oleautomation,
  724. nonextensible,
  725. pointer_default(unique)
  726. ]
  727. interface IXMLDOMProcessingInstruction : IXMLDOMNode
  728. {
  729. // read-only attribute wstring target;
  730. [propget, id(DISPID_DOM_PI_TARGET),
  731. helpstring("the target")]
  732. HRESULT target(
  733. [out, retval] BSTR * name);
  734. // attribute wstring data;
  735. [propget, id(DISPID_DOM_PI_DATA),
  736. helpstring("the data")]
  737. HRESULT data(
  738. [out, retval] BSTR * value);
  739. [propput, id(DISPID_DOM_PI_DATA),
  740. helpstring("the data")]
  741. HRESULT data(
  742. [in] BSTR value);
  743. };
  744. [
  745. local, object,
  746. uuid(2933BF8A-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMCDATASection
  747. odl,
  748. dual,
  749. oleautomation,
  750. nonextensible,
  751. pointer_default(unique)
  752. ]
  753. interface IXMLDOMCDATASection : IXMLDOMText
  754. {
  755. };
  756. [
  757. local, object,
  758. uuid(2933BF8B-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocumentType
  759. odl,
  760. dual,
  761. oleautomation,
  762. nonextensible,
  763. pointer_default(unique)
  764. ]
  765. interface IXMLDOMDocumentType : IXMLDOMNode
  766. {
  767. // readonly attribute wstring name;
  768. [propget, id(DISPID_DOM_DOCUMENTTYPE_NAME),
  769. helpstring("name of the document type (root of the tree)")]
  770. HRESULT name(
  771. [out, retval] BSTR * rootName);
  772. // readonly attribute NamedNodeMap entities;
  773. [propget, id(DISPID_DOM_DOCUMENTTYPE_ENTITIES),
  774. helpstring("a list of entities in the document")]
  775. HRESULT entities(
  776. [out, retval] IXMLDOMNamedNodeMap ** entityMap);
  777. // readonly attribute NamedNodeMap notations;
  778. [propget, id(DISPID_DOM_DOCUMENTTYPE_NOTATIONS),
  779. helpstring("a list of notations in the document")]
  780. HRESULT notations(
  781. [out, retval] IXMLDOMNamedNodeMap ** notationMap);
  782. };
  783. [
  784. local, object,
  785. uuid(2933BF8C-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNotation
  786. odl,
  787. dual,
  788. oleautomation,
  789. nonextensible,
  790. pointer_default(unique)
  791. ]
  792. interface IXMLDOMNotation : IXMLDOMNode
  793. {
  794. // attribute wstring publicId;
  795. [propget, id(DISPID_DOM_NOTATION_PUBLICID),
  796. helpstring("the public ID")]
  797. HRESULT publicId(
  798. [out, retval] VARIANT * publicID);
  799. // attribute wstring systemId;
  800. [propget, id(DISPID_DOM_NOTATION_SYSTEMID),
  801. helpstring("the system ID")]
  802. HRESULT systemId(
  803. [out, retval] VARIANT * systemID);
  804. };
  805. [
  806. local, object,
  807. uuid(2933BF8D-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMEntity
  808. odl,
  809. dual,
  810. oleautomation,
  811. nonextensible,
  812. pointer_default(unique)
  813. ]
  814. interface IXMLDOMEntity : IXMLDOMNode
  815. {
  816. // attribute wstring publicId;
  817. [propget, id(DISPID_DOM_ENTITY_PUBLICID),
  818. helpstring("the public ID")]
  819. HRESULT publicId(
  820. [out, retval] VARIANT * publicID);
  821. // attribute wstring systemId;
  822. [propget, id(DISPID_DOM_ENTITY_SYSTEMID),
  823. helpstring("the system ID")]
  824. HRESULT systemId(
  825. [out, retval] VARIANT * systemID);
  826. // attribute wstring notationName;
  827. [propget, id(DISPID_DOM_ENTITY_NOTATIONNAME),
  828. helpstring("the name of the notation")]
  829. HRESULT notationName(
  830. [out, retval] BSTR * name);
  831. };
  832. [
  833. local, object,
  834. uuid(2933BF8E-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMEntityReference
  835. odl,
  836. dual,
  837. oleautomation,
  838. nonextensible,
  839. pointer_default(unique)
  840. ]
  841. interface IXMLDOMEntityReference : IXMLDOMNode
  842. {
  843. };
  844. [
  845. local, object,
  846. nonextensible,
  847. pointer_default(unique),
  848. odl,
  849. oleautomation,
  850. dual,
  851. uuid(2933BF8F-7B36-11d2-B20E-00C04F983E60) // IID_IXMLDOMImplementation
  852. ]
  853. interface IXMLDOMImplementation : IDispatch
  854. {
  855. // boolean hasFeature(in wstring feature,
  856. // in wstring version);
  857. [id(DISPID_DOM_IMPLEMENTATION_HASFEATURE)]
  858. HRESULT hasFeature(
  859. [in] BSTR feature,
  860. [in] BSTR version,
  861. [out, retval] VARIANT_BOOL * hasFeature);
  862. };
  863. [
  864. local, object,
  865. uuid(3efaa425-272f-11d2-836f-0000f87a7782), // IID_IXTLRuntime
  866. odl,
  867. dual,
  868. oleautomation,
  869. nonextensible,
  870. helpstring("XTL runtime object"),
  871. pointer_default(unique)
  872. ]
  873. interface IXTLRuntime : IXMLDOMNode
  874. {
  875. [id(DISPID_XTLRUNTIME_UNIQUEID),
  876. helpstring("")]
  877. HRESULT uniqueID(
  878. [in]IXMLDOMNode *pNode,
  879. [out,retval]long *pID);
  880. [id(DISPID_XTLRUNTIME_DEPTH),
  881. helpstring("")]
  882. HRESULT depth(
  883. [in] IXMLDOMNode *pNode,
  884. [out,retval]long * pDepth);
  885. [id(DISPID_XTLRUNTIME_CHILDNUMBER),
  886. helpstring("")]
  887. HRESULT childNumber(
  888. [in]IXMLDOMNode *pNode,
  889. [out,retval] long *pNumber);
  890. [id(DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER),
  891. helpstring("")]
  892. HRESULT ancestorChildNumber(
  893. [in]BSTR bstrNodeName,
  894. [in]IXMLDOMNode *pNode,
  895. [out,retval]long *pNumber);
  896. [id(DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER),
  897. helpstring("")]
  898. HRESULT absoluteChildNumber(
  899. [in]IXMLDOMNode *pNode,
  900. [out,retval]long *pNumber);
  901. [id(DISPID_XTLRUNTIME_FORMATINDEX),
  902. helpstring("")]
  903. HRESULT formatIndex(
  904. [in] long lIndex,
  905. [in] BSTR bstrFormat,
  906. [out, retval]BSTR *pbstrFormattedString);
  907. [id(DISPID_XTLRUNTIME_FORMATNUMBER),
  908. helpstring("")]
  909. HRESULT formatNumber(
  910. [in] double dblNumber,
  911. [in] BSTR bstrFormat,
  912. [out, retval]BSTR *pbstrFormattedString);
  913. [id(DISPID_XTLRUNTIME_FORMATDATE),
  914. helpstring("")]
  915. HRESULT formatDate(
  916. [in] VARIANT varDate,
  917. [in] BSTR bstrFormat,
  918. [in,optional] VARIANT varDestLocale,
  919. [out, retval]BSTR *pbstrFormattedString);
  920. [id(DISPID_XTLRUNTIME_FORMATTIME),
  921. helpstring("")]
  922. HRESULT formatTime(
  923. [in] VARIANT varTime,
  924. [in] BSTR bstrFormat,
  925. [in,optional] VARIANT varDestLocale,
  926. [out, retval]BSTR *pbstrFormattedString);
  927. };
  928. [
  929. local, object,
  930. uuid(3efaa426-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseError
  931. odl,
  932. dual,
  933. oleautomation,
  934. nonextensible,
  935. helpstring("structure for reporting parser errors"),
  936. pointer_default(unique)
  937. ]
  938. interface IXMLDOMParseError : IDispatch
  939. {
  940. [propget, id(DISPID_VALUE),
  941. helpstring("the error code")]
  942. HRESULT errorCode(
  943. [retval, out] long * errorCode);
  944. [propget, id(DISPID_DOM_ERROR_URL),
  945. helpstring("the URL of the XML document containing the error")]
  946. HRESULT url(
  947. [retval, out] BSTR * urlString);
  948. [propget, id(DISPID_DOM_ERROR_REASON),
  949. helpstring("the cause of the error")]
  950. HRESULT reason(
  951. [retval, out] BSTR * reasonString);
  952. [propget, id(DISPID_DOM_ERROR_SRCTEXT),
  953. helpstring("the data where the error occurred")]
  954. HRESULT srcText(
  955. [retval, out] BSTR * sourceString);
  956. [propget, id(DISPID_DOM_ERROR_LINE),
  957. helpstring("the line number in the XML document where the error occurred")]
  958. HRESULT line(
  959. [retval, out] long * lineNumber);
  960. [propget, id(DISPID_DOM_ERROR_LINEPOS),
  961. helpstring("the character position in the line containing the error")]
  962. HRESULT linepos(
  963. [retval, out] long * linePosition);
  964. [propget, id(DISPID_DOM_ERROR_FILEPOS),
  965. helpstring("the absolute file position in the XML document containing the error")]
  966. HRESULT filepos(
  967. [retval, out] long * filePosition);
  968. };
  969. // DOM event interface
  970. [
  971. hidden,
  972. uuid(3efaa427-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMEvent
  973. ]
  974. dispinterface XMLDOMDocumentEvents
  975. {
  976. properties:
  977. methods:
  978. [id (DISPID_XMLDOMEVENT_ONDATAAVAILABLE)]
  979. HRESULT ondataavailable(void);
  980. [id (DISPID_XMLDOMEVENT_ONREADYSTATECHANGE)]
  981. HRESULT onreadystatechange(void);
  982. };
  983. // DOM Document rental-model co-Class
  984. [
  985. uuid(2933BF90-7B36-11d2-B20E-00C04F983E60), // CLSID_DOMDocument
  986. helpstring("W3C-DOM XML Document")
  987. ]
  988. coclass DOMDocument
  989. {
  990. [default] interface IXMLDOMDocument;
  991. [default, source] dispinterface XMLDOMDocumentEvents;
  992. };
  993. // DOM Document free-threaded co-Class
  994. [
  995. uuid(2933BF91-7B36-11d2-B20E-00C04F983E60), // CLSID_DOMDocument
  996. helpstring("W3C-DOM XML Document (Apartment)")
  997. ]
  998. coclass DOMFreeThreadedDocument
  999. {
  1000. [default] interface IXMLDOMDocument;
  1001. [default, source] dispinterface XMLDOMDocumentEvents;
  1002. };
  1003. [
  1004. object,
  1005. uuid(ED8C108D-4349-11D2-91A4-00C04F7969E8),
  1006. odl,
  1007. dual,
  1008. oleautomation,
  1009. helpstring("IXMLHttpRequest Interface"),
  1010. pointer_default(unique)
  1011. ]
  1012. interface IXMLHttpRequest : IDispatch
  1013. {
  1014. [id(1), helpstring("Open HTTP connection")] HRESULT open([in] BSTR bstrMethod, [in] BSTR bstrUrl, [in,optional] VARIANT varAsync, [in,optional] VARIANT bstrUser, [in,optional] VARIANT bstrPassword);
  1015. [id(2), helpstring("Add HTTP request header")] HRESULT setRequestHeader([in] BSTR bstrHeader, [in] BSTR bstrValue);
  1016. [id(3), helpstring("Get HTTP response header")] HRESULT getResponseHeader([in] BSTR bstrHeader, [out, retval] BSTR * pbstrValue);
  1017. [id(4), helpstring("Get all HTTP response headers")] HRESULT getAllResponseHeaders([out, retval] BSTR * pbstrHeaders);
  1018. [id(5), helpstring("Send HTTP request")] HRESULT send([in, optional] VARIANT varBody);
  1019. [id(6), helpstring("Abort HTTP request")] HRESULT abort();
  1020. [propget, id(7), helpstring("Get HTTP status code")] HRESULT status([out, retval] long * plStatus);
  1021. [propget, id(8), helpstring("Get HTTP status text")] HRESULT statusText([out, retval] BSTR * pbstrStatus);
  1022. [propget, id(9), helpstring("Get response body")] HRESULT responseXML([out, retval] IDispatch ** ppBody);
  1023. [propget, id(10), helpstring("Get response body")] HRESULT responseText([out, retval] BSTR * pbstrBody);
  1024. [propget, id(11), helpstring("Get response body")] HRESULT responseBody([out, retval] VARIANT * pvarBody);
  1025. [propget, id(12), helpstring("Get response body")] HRESULT responseStream([out, retval] VARIANT * pvarBody);
  1026. [propget, id(13), helpstring("Get ready state")] HRESULT readyState([out, retval] long * plState);
  1027. [propput, id(14), helpstring("Register a complete event handler")] HRESULT onreadystatechange([in] IDispatch * pReadyStateSink);
  1028. };
  1029. // XML HTTP Request Class
  1030. [
  1031. uuid(ED8C108E-4349-11D2-91A4-00C04F7969E8), // CLSID_XMLHTTPRequest
  1032. helpstring("XML HTTP Request class.")
  1033. ]
  1034. coclass XMLHTTPRequest
  1035. {
  1036. [default] interface IXMLHttpRequest;
  1037. };