nsIDOMDocument.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/dom/public/idl/core/nsIDOMDocument.idl
  3. */
  4. #ifndef __gen_nsIDOMDocument_h__
  5. #define __gen_nsIDOMDocument_h__
  6. #ifndef __gen_nsIDOMNode_h__
  7. #include "nsIDOMNode.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. /* starting interface: nsIDOMDocument */
  14. #define NS_IDOMDOCUMENT_IID_STR "a6cf9075-15b3-11d2-932e-00805f8add32"
  15. #define NS_IDOMDOCUMENT_IID \
  16. {0xa6cf9075, 0x15b3, 0x11d2, \
  17. { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
  18. class NS_NO_VTABLE nsIDOMDocument : public nsIDOMNode {
  19. public:
  20. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMDOCUMENT_IID)
  21. /**
  22. * The nsIDOMDocument interface represents the entire HTML or XML document.
  23. * Conceptually, it is the root of the document tree, and provides the
  24. * primary access to the document's data.
  25. * Since elements, text nodes, comments, processing instructions, etc.
  26. * cannot exist outside the context of a Document, the nsIDOMDocument
  27. * interface also contains the factory methods needed to create these
  28. * objects.
  29. *
  30. * For more information on this interface please see
  31. * http://www.w3.org/TR/DOM-Level-2-Core/
  32. *
  33. * @status FROZEN
  34. */
  35. /* readonly attribute nsIDOMDocumentType doctype; */
  36. NS_IMETHOD GetDoctype(nsIDOMDocumentType * *aDoctype) = 0;
  37. /* readonly attribute nsIDOMDOMImplementation implementation; */
  38. NS_IMETHOD GetImplementation(nsIDOMDOMImplementation * *aImplementation) = 0;
  39. /* readonly attribute nsIDOMElement documentElement; */
  40. NS_IMETHOD GetDocumentElement(nsIDOMElement * *aDocumentElement) = 0;
  41. /* nsIDOMElement createElement (in DOMString tagName) raises (DOMException); */
  42. NS_IMETHOD CreateElement(const nsAString & tagName, nsIDOMElement **_retval) = 0;
  43. /* nsIDOMDocumentFragment createDocumentFragment (); */
  44. NS_IMETHOD CreateDocumentFragment(nsIDOMDocumentFragment **_retval) = 0;
  45. /* nsIDOMText createTextNode (in DOMString data); */
  46. NS_IMETHOD CreateTextNode(const nsAString & data, nsIDOMText **_retval) = 0;
  47. /* nsIDOMComment createComment (in DOMString data); */
  48. NS_IMETHOD CreateComment(const nsAString & data, nsIDOMComment **_retval) = 0;
  49. /* nsIDOMCDATASection createCDATASection (in DOMString data) raises (DOMException); */
  50. NS_IMETHOD CreateCDATASection(const nsAString & data, nsIDOMCDATASection **_retval) = 0;
  51. /* nsIDOMProcessingInstruction createProcessingInstruction (in DOMString target, in DOMString data) raises (DOMException); */
  52. NS_IMETHOD CreateProcessingInstruction(const nsAString & target, const nsAString & data, nsIDOMProcessingInstruction **_retval) = 0;
  53. /* nsIDOMAttr createAttribute (in DOMString name) raises (DOMException); */
  54. NS_IMETHOD CreateAttribute(const nsAString & name, nsIDOMAttr **_retval) = 0;
  55. /* nsIDOMEntityReference createEntityReference (in DOMString name) raises (DOMException); */
  56. NS_IMETHOD CreateEntityReference(const nsAString & name, nsIDOMEntityReference **_retval) = 0;
  57. /* nsIDOMNodeList getElementsByTagName (in DOMString tagname); */
  58. NS_IMETHOD GetElementsByTagName(const nsAString & tagname, nsIDOMNodeList **_retval) = 0;
  59. /* nsIDOMNode importNode (in nsIDOMNode importedNode, in boolean deep) raises (DOMException); */
  60. NS_IMETHOD ImportNode(nsIDOMNode *importedNode, PRBool deep, nsIDOMNode **_retval) = 0;
  61. /* nsIDOMElement createElementNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException); */
  62. NS_IMETHOD CreateElementNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMElement **_retval) = 0;
  63. /* nsIDOMAttr createAttributeNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException); */
  64. NS_IMETHOD CreateAttributeNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMAttr **_retval) = 0;
  65. /* nsIDOMNodeList getElementsByTagNameNS (in DOMString namespaceURI, in DOMString localName); */
  66. NS_IMETHOD GetElementsByTagNameNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMNodeList **_retval) = 0;
  67. /* nsIDOMElement getElementById (in DOMString elementId); */
  68. NS_IMETHOD GetElementById(const nsAString & elementId, nsIDOMElement **_retval) = 0;
  69. };
  70. /* Use this macro when declaring classes that implement this interface. */
  71. #define NS_DECL_NSIDOMDOCUMENT \
  72. NS_IMETHOD GetDoctype(nsIDOMDocumentType * *aDoctype); \
  73. NS_IMETHOD GetImplementation(nsIDOMDOMImplementation * *aImplementation); \
  74. NS_IMETHOD GetDocumentElement(nsIDOMElement * *aDocumentElement); \
  75. NS_IMETHOD CreateElement(const nsAString & tagName, nsIDOMElement **_retval); \
  76. NS_IMETHOD CreateDocumentFragment(nsIDOMDocumentFragment **_retval); \
  77. NS_IMETHOD CreateTextNode(const nsAString & data, nsIDOMText **_retval); \
  78. NS_IMETHOD CreateComment(const nsAString & data, nsIDOMComment **_retval); \
  79. NS_IMETHOD CreateCDATASection(const nsAString & data, nsIDOMCDATASection **_retval); \
  80. NS_IMETHOD CreateProcessingInstruction(const nsAString & target, const nsAString & data, nsIDOMProcessingInstruction **_retval); \
  81. NS_IMETHOD CreateAttribute(const nsAString & name, nsIDOMAttr **_retval); \
  82. NS_IMETHOD CreateEntityReference(const nsAString & name, nsIDOMEntityReference **_retval); \
  83. NS_IMETHOD GetElementsByTagName(const nsAString & tagname, nsIDOMNodeList **_retval); \
  84. NS_IMETHOD ImportNode(nsIDOMNode *importedNode, PRBool deep, nsIDOMNode **_retval); \
  85. NS_IMETHOD CreateElementNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMElement **_retval); \
  86. NS_IMETHOD CreateAttributeNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMAttr **_retval); \
  87. NS_IMETHOD GetElementsByTagNameNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMNodeList **_retval); \
  88. NS_IMETHOD GetElementById(const nsAString & elementId, nsIDOMElement **_retval);
  89. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  90. #define NS_FORWARD_NSIDOMDOCUMENT(_to) \
  91. NS_IMETHOD GetDoctype(nsIDOMDocumentType * *aDoctype) { return _to GetDoctype(aDoctype); } \
  92. NS_IMETHOD GetImplementation(nsIDOMDOMImplementation * *aImplementation) { return _to GetImplementation(aImplementation); } \
  93. NS_IMETHOD GetDocumentElement(nsIDOMElement * *aDocumentElement) { return _to GetDocumentElement(aDocumentElement); } \
  94. NS_IMETHOD CreateElement(const nsAString & tagName, nsIDOMElement **_retval) { return _to CreateElement(tagName, _retval); } \
  95. NS_IMETHOD CreateDocumentFragment(nsIDOMDocumentFragment **_retval) { return _to CreateDocumentFragment(_retval); } \
  96. NS_IMETHOD CreateTextNode(const nsAString & data, nsIDOMText **_retval) { return _to CreateTextNode(data, _retval); } \
  97. NS_IMETHOD CreateComment(const nsAString & data, nsIDOMComment **_retval) { return _to CreateComment(data, _retval); } \
  98. NS_IMETHOD CreateCDATASection(const nsAString & data, nsIDOMCDATASection **_retval) { return _to CreateCDATASection(data, _retval); } \
  99. NS_IMETHOD CreateProcessingInstruction(const nsAString & target, const nsAString & data, nsIDOMProcessingInstruction **_retval) { return _to CreateProcessingInstruction(target, data, _retval); } \
  100. NS_IMETHOD CreateAttribute(const nsAString & name, nsIDOMAttr **_retval) { return _to CreateAttribute(name, _retval); } \
  101. NS_IMETHOD CreateEntityReference(const nsAString & name, nsIDOMEntityReference **_retval) { return _to CreateEntityReference(name, _retval); } \
  102. NS_IMETHOD GetElementsByTagName(const nsAString & tagname, nsIDOMNodeList **_retval) { return _to GetElementsByTagName(tagname, _retval); } \
  103. NS_IMETHOD ImportNode(nsIDOMNode *importedNode, PRBool deep, nsIDOMNode **_retval) { return _to ImportNode(importedNode, deep, _retval); } \
  104. NS_IMETHOD CreateElementNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMElement **_retval) { return _to CreateElementNS(namespaceURI, qualifiedName, _retval); } \
  105. NS_IMETHOD CreateAttributeNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMAttr **_retval) { return _to CreateAttributeNS(namespaceURI, qualifiedName, _retval); } \
  106. NS_IMETHOD GetElementsByTagNameNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMNodeList **_retval) { return _to GetElementsByTagNameNS(namespaceURI, localName, _retval); } \
  107. NS_IMETHOD GetElementById(const nsAString & elementId, nsIDOMElement **_retval) { return _to GetElementById(elementId, _retval); }
  108. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  109. #define NS_FORWARD_SAFE_NSIDOMDOCUMENT(_to) \
  110. NS_IMETHOD GetDoctype(nsIDOMDocumentType * *aDoctype) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDoctype(aDoctype); } \
  111. NS_IMETHOD GetImplementation(nsIDOMDOMImplementation * *aImplementation) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImplementation(aImplementation); } \
  112. NS_IMETHOD GetDocumentElement(nsIDOMElement * *aDocumentElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocumentElement(aDocumentElement); } \
  113. NS_IMETHOD CreateElement(const nsAString & tagName, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateElement(tagName, _retval); } \
  114. NS_IMETHOD CreateDocumentFragment(nsIDOMDocumentFragment **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateDocumentFragment(_retval); } \
  115. NS_IMETHOD CreateTextNode(const nsAString & data, nsIDOMText **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateTextNode(data, _retval); } \
  116. NS_IMETHOD CreateComment(const nsAString & data, nsIDOMComment **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateComment(data, _retval); } \
  117. NS_IMETHOD CreateCDATASection(const nsAString & data, nsIDOMCDATASection **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateCDATASection(data, _retval); } \
  118. NS_IMETHOD CreateProcessingInstruction(const nsAString & target, const nsAString & data, nsIDOMProcessingInstruction **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateProcessingInstruction(target, data, _retval); } \
  119. NS_IMETHOD CreateAttribute(const nsAString & name, nsIDOMAttr **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateAttribute(name, _retval); } \
  120. NS_IMETHOD CreateEntityReference(const nsAString & name, nsIDOMEntityReference **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateEntityReference(name, _retval); } \
  121. NS_IMETHOD GetElementsByTagName(const nsAString & tagname, nsIDOMNodeList **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementsByTagName(tagname, _retval); } \
  122. NS_IMETHOD ImportNode(nsIDOMNode *importedNode, PRBool deep, nsIDOMNode **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportNode(importedNode, deep, _retval); } \
  123. NS_IMETHOD CreateElementNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateElementNS(namespaceURI, qualifiedName, _retval); } \
  124. NS_IMETHOD CreateAttributeNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMAttr **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateAttributeNS(namespaceURI, qualifiedName, _retval); } \
  125. NS_IMETHOD GetElementsByTagNameNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMNodeList **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementsByTagNameNS(namespaceURI, localName, _retval); } \
  126. NS_IMETHOD GetElementById(const nsAString & elementId, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementById(elementId, _retval); }
  127. #if 0
  128. /* Use the code below as a template for the implementation class for this interface. */
  129. /* Header file */
  130. class nsDOMDocument : public nsIDOMDocument
  131. {
  132. public:
  133. NS_DECL_ISUPPORTS
  134. NS_DECL_NSIDOMDOCUMENT
  135. nsDOMDocument();
  136. private:
  137. ~nsDOMDocument();
  138. protected:
  139. /* additional members */
  140. };
  141. /* Implementation file */
  142. NS_IMPL_ISUPPORTS1(nsDOMDocument, nsIDOMDocument)
  143. nsDOMDocument::nsDOMDocument()
  144. {
  145. /* member initializers and constructor code */
  146. }
  147. nsDOMDocument::~nsDOMDocument()
  148. {
  149. /* destructor code */
  150. }
  151. /* readonly attribute nsIDOMDocumentType doctype; */
  152. NS_IMETHODIMP nsDOMDocument::GetDoctype(nsIDOMDocumentType * *aDoctype)
  153. {
  154. return NS_ERROR_NOT_IMPLEMENTED;
  155. }
  156. /* readonly attribute nsIDOMDOMImplementation implementation; */
  157. NS_IMETHODIMP nsDOMDocument::GetImplementation(nsIDOMDOMImplementation * *aImplementation)
  158. {
  159. return NS_ERROR_NOT_IMPLEMENTED;
  160. }
  161. /* readonly attribute nsIDOMElement documentElement; */
  162. NS_IMETHODIMP nsDOMDocument::GetDocumentElement(nsIDOMElement * *aDocumentElement)
  163. {
  164. return NS_ERROR_NOT_IMPLEMENTED;
  165. }
  166. /* nsIDOMElement createElement (in DOMString tagName) raises (DOMException); */
  167. NS_IMETHODIMP nsDOMDocument::CreateElement(const nsAString & tagName, nsIDOMElement **_retval)
  168. {
  169. return NS_ERROR_NOT_IMPLEMENTED;
  170. }
  171. /* nsIDOMDocumentFragment createDocumentFragment (); */
  172. NS_IMETHODIMP nsDOMDocument::CreateDocumentFragment(nsIDOMDocumentFragment **_retval)
  173. {
  174. return NS_ERROR_NOT_IMPLEMENTED;
  175. }
  176. /* nsIDOMText createTextNode (in DOMString data); */
  177. NS_IMETHODIMP nsDOMDocument::CreateTextNode(const nsAString & data, nsIDOMText **_retval)
  178. {
  179. return NS_ERROR_NOT_IMPLEMENTED;
  180. }
  181. /* nsIDOMComment createComment (in DOMString data); */
  182. NS_IMETHODIMP nsDOMDocument::CreateComment(const nsAString & data, nsIDOMComment **_retval)
  183. {
  184. return NS_ERROR_NOT_IMPLEMENTED;
  185. }
  186. /* nsIDOMCDATASection createCDATASection (in DOMString data) raises (DOMException); */
  187. NS_IMETHODIMP nsDOMDocument::CreateCDATASection(const nsAString & data, nsIDOMCDATASection **_retval)
  188. {
  189. return NS_ERROR_NOT_IMPLEMENTED;
  190. }
  191. /* nsIDOMProcessingInstruction createProcessingInstruction (in DOMString target, in DOMString data) raises (DOMException); */
  192. NS_IMETHODIMP nsDOMDocument::CreateProcessingInstruction(const nsAString & target, const nsAString & data, nsIDOMProcessingInstruction **_retval)
  193. {
  194. return NS_ERROR_NOT_IMPLEMENTED;
  195. }
  196. /* nsIDOMAttr createAttribute (in DOMString name) raises (DOMException); */
  197. NS_IMETHODIMP nsDOMDocument::CreateAttribute(const nsAString & name, nsIDOMAttr **_retval)
  198. {
  199. return NS_ERROR_NOT_IMPLEMENTED;
  200. }
  201. /* nsIDOMEntityReference createEntityReference (in DOMString name) raises (DOMException); */
  202. NS_IMETHODIMP nsDOMDocument::CreateEntityReference(const nsAString & name, nsIDOMEntityReference **_retval)
  203. {
  204. return NS_ERROR_NOT_IMPLEMENTED;
  205. }
  206. /* nsIDOMNodeList getElementsByTagName (in DOMString tagname); */
  207. NS_IMETHODIMP nsDOMDocument::GetElementsByTagName(const nsAString & tagname, nsIDOMNodeList **_retval)
  208. {
  209. return NS_ERROR_NOT_IMPLEMENTED;
  210. }
  211. /* nsIDOMNode importNode (in nsIDOMNode importedNode, in boolean deep) raises (DOMException); */
  212. NS_IMETHODIMP nsDOMDocument::ImportNode(nsIDOMNode *importedNode, PRBool deep, nsIDOMNode **_retval)
  213. {
  214. return NS_ERROR_NOT_IMPLEMENTED;
  215. }
  216. /* nsIDOMElement createElementNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException); */
  217. NS_IMETHODIMP nsDOMDocument::CreateElementNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMElement **_retval)
  218. {
  219. return NS_ERROR_NOT_IMPLEMENTED;
  220. }
  221. /* nsIDOMAttr createAttributeNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException); */
  222. NS_IMETHODIMP nsDOMDocument::CreateAttributeNS(const nsAString & namespaceURI, const nsAString & qualifiedName, nsIDOMAttr **_retval)
  223. {
  224. return NS_ERROR_NOT_IMPLEMENTED;
  225. }
  226. /* nsIDOMNodeList getElementsByTagNameNS (in DOMString namespaceURI, in DOMString localName); */
  227. NS_IMETHODIMP nsDOMDocument::GetElementsByTagNameNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMNodeList **_retval)
  228. {
  229. return NS_ERROR_NOT_IMPLEMENTED;
  230. }
  231. /* nsIDOMElement getElementById (in DOMString elementId); */
  232. NS_IMETHODIMP nsDOMDocument::GetElementById(const nsAString & elementId, nsIDOMElement **_retval)
  233. {
  234. return NS_ERROR_NOT_IMPLEMENTED;
  235. }
  236. /* End of implementation class template. */
  237. #endif
  238. #endif /* __gen_nsIDOMDocument_h__ */