PageRenderTime 27ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/mozilla/mozilla/dist/include/xml/nsISAXXMLReader.h

http://kmbrasil.codeplex.com
C++ Header | 420 lines | 183 code | 55 blank | 182 comment | 0 complexity | 90a7ac25fbe91c6e5295f22360040e4b MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/parser/xml/public/nsISAXXMLReader.idl
  3. */
  4. #ifndef __gen_nsISAXXMLReader_h__
  5. #define __gen_nsISAXXMLReader_h__
  6. #ifndef __gen_nsIStreamListener_h__
  7. #include "nsIStreamListener.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. class nsIInputStream; /* forward declaration */
  14. class nsIRequestObserver; /* forward declaration */
  15. class nsIURI; /* forward declaration */
  16. class nsISAXContentHandler; /* forward declaration */
  17. class nsISAXDTDHandler; /* forward declaration */
  18. class nsISAXEntityResolver; /* forward declaration */
  19. class nsISAXErrorHandler; /* forward declaration */
  20. class nsISAXLexicalHandler; /* forward declaration */
  21. /* starting interface: nsISAXXMLReader */
  22. #define NS_ISAXXMLREADER_IID_STR "5556997e-d816-4218-8b54-803d4261206e"
  23. #define NS_ISAXXMLREADER_IID \
  24. {0x5556997e, 0xd816, 0x4218, \
  25. { 0x8b, 0x54, 0x80, 0x3d, 0x42, 0x61, 0x20, 0x6e }}
  26. /**
  27. * Interface for reading an XML document using callbacks.
  28. *
  29. * nsISAXXMLReader is the interface that an XML parser's SAX2
  30. * driver must implement. This interface allows an application to set
  31. * and query features and properties in the parser, to register event
  32. * handlers for document processing, and to initiate a document
  33. * parse.
  34. */
  35. class NS_NO_VTABLE nsISAXXMLReader : public nsIStreamListener {
  36. public:
  37. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISAXXMLREADER_IID)
  38. /**
  39. * The base URI.
  40. */
  41. /* attribute nsIURI baseURI; */
  42. NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) = 0;
  43. NS_IMETHOD SetBaseURI(nsIURI * aBaseURI) = 0;
  44. /**
  45. * If the application does not register a content handler, all
  46. * content events reported by the SAX parser will be silently
  47. * ignored.
  48. *
  49. * Applications may register a new or different handler in the
  50. * middle of a parse, and the SAX parser must begin using the new
  51. * handler immediately.
  52. */
  53. /* attribute nsISAXContentHandler contentHandler; */
  54. NS_IMETHOD GetContentHandler(nsISAXContentHandler * *aContentHandler) = 0;
  55. NS_IMETHOD SetContentHandler(nsISAXContentHandler * aContentHandler) = 0;
  56. /**
  57. * If the application does not register a DTD handler, all DTD
  58. * events reported by the SAX parser will be silently ignored.
  59. *
  60. * Applications may register a new or different handler in the
  61. * middle of a parse, and the SAX parser must begin using the new
  62. * handler immediately.
  63. */
  64. /* attribute nsISAXDTDHandler dtdHandler; */
  65. NS_IMETHOD GetDtdHandler(nsISAXDTDHandler * *aDtdHandler) = 0;
  66. NS_IMETHOD SetDtdHandler(nsISAXDTDHandler * aDtdHandler) = 0;
  67. /**
  68. * If the application does not register an error handler, all
  69. * error events reported by the SAX parser will be silently ignored;
  70. * however, normal processing may not continue. It is highly
  71. * recommended that all SAX applications implement an error handler
  72. * to avoid unexpected bugs.
  73. *
  74. * Applications may register a new or different handler in the
  75. * middle of a parse, and the SAX parser must begin using the new
  76. * handler immediately.
  77. */
  78. /* attribute nsISAXErrorHandler errorHandler; */
  79. NS_IMETHOD GetErrorHandler(nsISAXErrorHandler * *aErrorHandler) = 0;
  80. NS_IMETHOD SetErrorHandler(nsISAXErrorHandler * aErrorHandler) = 0;
  81. /**
  82. * If the application does not register a lexical handler, all
  83. * lexical events (e.g. startDTD) reported by the SAX parser will be
  84. * silently ignored.
  85. *
  86. * Applications may register a new or different handler in the
  87. * middle of a parse, and the SAX parser must begin using the new
  88. * handler immediately.
  89. */
  90. /* attribute nsISAXLexicalHandler lexicalHandler; */
  91. NS_IMETHOD GetLexicalHandler(nsISAXLexicalHandler * *aLexicalHandler) = 0;
  92. NS_IMETHOD SetLexicalHandler(nsISAXLexicalHandler * aLexicalHandler) = 0;
  93. /**
  94. * Set the value of a feature flag. NOT CURRENTLY IMPLEMENTED.
  95. *
  96. * The feature name is any fully-qualified URI. It is possible
  97. * for an XMLReader to expose a feature value but to be unable to
  98. * change the current value. Some feature values may be immutable
  99. * or mutable only in specific contexts, such as before, during, or
  100. * after a parse.
  101. *
  102. * All XMLReaders are required to support setting
  103. * http://xml.org/sax/features/namespaces to true and
  104. * http://xml.org/sax/features/namespace-prefixes to false.
  105. *
  106. * @param name String flag for a parser feature.
  107. * @param value Turn the feature on/off.
  108. */
  109. /* void setFeature (in AString name, in boolean value); */
  110. NS_IMETHOD SetFeature(const nsAString & name, PRBool value) = 0;
  111. /**
  112. * Look up the value of a feature flag. NOT CURRENTLY IMPLEMENTED.
  113. *
  114. * The feature name is any fully-qualified URI. It is
  115. * possible for an XMLReader to recognize a feature name but
  116. * temporarily be unable to return its value.
  117. * Some feature values may be available only in specific
  118. * contexts, such as before, during, or after a parse.
  119. *
  120. * All XMLReaders are required to recognize the
  121. * http://xml.org/sax/features/namespaces and the
  122. * http://xml.org/sax/features/namespace-prefixes feature names.
  123. *
  124. * @param name String flag for a parser feature.
  125. */
  126. /* boolean getFeature (in AString name); */
  127. NS_IMETHOD GetFeature(const nsAString & name, PRBool *_retval) = 0;
  128. /**
  129. * Set the value of a property. NOT CURRENTLY IMPLEMENTED.
  130. *
  131. * The property name is any fully-qualified URI. It is possible
  132. * for an XMLReader to recognize a property name but to be unable to
  133. * change the current value. Some property values may be immutable
  134. * or mutable only in specific contexts, such as before, during, or
  135. * after a parse.
  136. *
  137. * XMLReaders are not required to recognize setting any specific
  138. * property names, though a core set is defined by SAX2.
  139. *
  140. * This method is also the standard mechanism for setting
  141. * extended handlers.
  142. *
  143. * @param name String flag for a parser feature
  144. * @param value Turn the feature on/off.
  145. */
  146. /* void setProperty (in AString name, in nsISupports value); */
  147. NS_IMETHOD SetProperty(const nsAString & name, nsISupports *value) = 0;
  148. /**
  149. * Look up the value of a property. NOT CURRENTLY IMPLEMENTED.
  150. *
  151. * The property name is any fully-qualified URI. It is
  152. * possible for an XMLReader to recognize a property name but
  153. * temporarily be unable to return its value.
  154. * Some property values may be available only in specific
  155. * contexts, such as before, during, or after a parse.
  156. *
  157. * XMLReaders are not required to recognize any specific
  158. * property names, though an initial core set is documented for
  159. * SAX2.
  160. *
  161. * Implementors are free (and encouraged) to invent their own properties,
  162. * using names built on their own URIs.
  163. *
  164. * @param name The property name, which is a fully-qualified URI.
  165. * @return The current value of the property.
  166. */
  167. /* boolean getProperty (in AString name); */
  168. NS_IMETHOD GetProperty(const nsAString & name, PRBool *_retval) = 0;
  169. /**
  170. *
  171. * @param str The UTF16 string to be parsed
  172. * @param contentType The content type of the string (see parseFromStream)
  173. *
  174. */
  175. /* void parseFromString (in AString str, in string contentType); */
  176. NS_IMETHOD ParseFromString(const nsAString & str, const char *contentType) = 0;
  177. /**
  178. *
  179. * @param stream The byte stream whose contents are parsed
  180. * @param charset The character set that was used to encode the byte
  181. * stream. NULL if not specified.
  182. * @param contentType The content type of the string - either text/xml,
  183. * application/xml, or application/xhtml+xml.
  184. * Must not be NULL.
  185. *
  186. */
  187. /* void parseFromStream (in nsIInputStream stream, in string charset, in string contentType); */
  188. NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, const char *contentType) = 0;
  189. /**
  190. * Begin an asynchronous parse. This method initializes the parser,
  191. * and must be called before any nsIStreamListener methods. It is
  192. * then the caller's duty to call nsIStreamListener methods to drive
  193. * the parser. Once this method is called, the caller must not call
  194. * one of the other parse methods.
  195. *
  196. * @param observer The nsIRequestObserver to notify upon start or stop.
  197. * Can be NULL.
  198. */
  199. /* void parseAsync (in nsIRequestObserver observer); */
  200. NS_IMETHOD ParseAsync(nsIRequestObserver *observer) = 0;
  201. };
  202. /* Use this macro when declaring classes that implement this interface. */
  203. #define NS_DECL_NSISAXXMLREADER \
  204. NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI); \
  205. NS_IMETHOD SetBaseURI(nsIURI * aBaseURI); \
  206. NS_IMETHOD GetContentHandler(nsISAXContentHandler * *aContentHandler); \
  207. NS_IMETHOD SetContentHandler(nsISAXContentHandler * aContentHandler); \
  208. NS_IMETHOD GetDtdHandler(nsISAXDTDHandler * *aDtdHandler); \
  209. NS_IMETHOD SetDtdHandler(nsISAXDTDHandler * aDtdHandler); \
  210. NS_IMETHOD GetErrorHandler(nsISAXErrorHandler * *aErrorHandler); \
  211. NS_IMETHOD SetErrorHandler(nsISAXErrorHandler * aErrorHandler); \
  212. NS_IMETHOD GetLexicalHandler(nsISAXLexicalHandler * *aLexicalHandler); \
  213. NS_IMETHOD SetLexicalHandler(nsISAXLexicalHandler * aLexicalHandler); \
  214. NS_IMETHOD SetFeature(const nsAString & name, PRBool value); \
  215. NS_IMETHOD GetFeature(const nsAString & name, PRBool *_retval); \
  216. NS_IMETHOD SetProperty(const nsAString & name, nsISupports *value); \
  217. NS_IMETHOD GetProperty(const nsAString & name, PRBool *_retval); \
  218. NS_IMETHOD ParseFromString(const nsAString & str, const char *contentType); \
  219. NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, const char *contentType); \
  220. NS_IMETHOD ParseAsync(nsIRequestObserver *observer);
  221. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  222. #define NS_FORWARD_NSISAXXMLREADER(_to) \
  223. NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) { return _to GetBaseURI(aBaseURI); } \
  224. NS_IMETHOD SetBaseURI(nsIURI * aBaseURI) { return _to SetBaseURI(aBaseURI); } \
  225. NS_IMETHOD GetContentHandler(nsISAXContentHandler * *aContentHandler) { return _to GetContentHandler(aContentHandler); } \
  226. NS_IMETHOD SetContentHandler(nsISAXContentHandler * aContentHandler) { return _to SetContentHandler(aContentHandler); } \
  227. NS_IMETHOD GetDtdHandler(nsISAXDTDHandler * *aDtdHandler) { return _to GetDtdHandler(aDtdHandler); } \
  228. NS_IMETHOD SetDtdHandler(nsISAXDTDHandler * aDtdHandler) { return _to SetDtdHandler(aDtdHandler); } \
  229. NS_IMETHOD GetErrorHandler(nsISAXErrorHandler * *aErrorHandler) { return _to GetErrorHandler(aErrorHandler); } \
  230. NS_IMETHOD SetErrorHandler(nsISAXErrorHandler * aErrorHandler) { return _to SetErrorHandler(aErrorHandler); } \
  231. NS_IMETHOD GetLexicalHandler(nsISAXLexicalHandler * *aLexicalHandler) { return _to GetLexicalHandler(aLexicalHandler); } \
  232. NS_IMETHOD SetLexicalHandler(nsISAXLexicalHandler * aLexicalHandler) { return _to SetLexicalHandler(aLexicalHandler); } \
  233. NS_IMETHOD SetFeature(const nsAString & name, PRBool value) { return _to SetFeature(name, value); } \
  234. NS_IMETHOD GetFeature(const nsAString & name, PRBool *_retval) { return _to GetFeature(name, _retval); } \
  235. NS_IMETHOD SetProperty(const nsAString & name, nsISupports *value) { return _to SetProperty(name, value); } \
  236. NS_IMETHOD GetProperty(const nsAString & name, PRBool *_retval) { return _to GetProperty(name, _retval); } \
  237. NS_IMETHOD ParseFromString(const nsAString & str, const char *contentType) { return _to ParseFromString(str, contentType); } \
  238. NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, const char *contentType) { return _to ParseFromStream(stream, charset, contentType); } \
  239. NS_IMETHOD ParseAsync(nsIRequestObserver *observer) { return _to ParseAsync(observer); }
  240. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  241. #define NS_FORWARD_SAFE_NSISAXXMLREADER(_to) \
  242. NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBaseURI(aBaseURI); } \
  243. NS_IMETHOD SetBaseURI(nsIURI * aBaseURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBaseURI(aBaseURI); } \
  244. NS_IMETHOD GetContentHandler(nsISAXContentHandler * *aContentHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentHandler(aContentHandler); } \
  245. NS_IMETHOD SetContentHandler(nsISAXContentHandler * aContentHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentHandler(aContentHandler); } \
  246. NS_IMETHOD GetDtdHandler(nsISAXDTDHandler * *aDtdHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDtdHandler(aDtdHandler); } \
  247. NS_IMETHOD SetDtdHandler(nsISAXDTDHandler * aDtdHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDtdHandler(aDtdHandler); } \
  248. NS_IMETHOD GetErrorHandler(nsISAXErrorHandler * *aErrorHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorHandler(aErrorHandler); } \
  249. NS_IMETHOD SetErrorHandler(nsISAXErrorHandler * aErrorHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetErrorHandler(aErrorHandler); } \
  250. NS_IMETHOD GetLexicalHandler(nsISAXLexicalHandler * *aLexicalHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLexicalHandler(aLexicalHandler); } \
  251. NS_IMETHOD SetLexicalHandler(nsISAXLexicalHandler * aLexicalHandler) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLexicalHandler(aLexicalHandler); } \
  252. NS_IMETHOD SetFeature(const nsAString & name, PRBool value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFeature(name, value); } \
  253. NS_IMETHOD GetFeature(const nsAString & name, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFeature(name, _retval); } \
  254. NS_IMETHOD SetProperty(const nsAString & name, nsISupports *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetProperty(name, value); } \
  255. NS_IMETHOD GetProperty(const nsAString & name, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProperty(name, _retval); } \
  256. NS_IMETHOD ParseFromString(const nsAString & str, const char *contentType) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFromString(str, contentType); } \
  257. NS_IMETHOD ParseFromStream(nsIInputStream *stream, const char *charset, const char *contentType) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFromStream(stream, charset, contentType); } \
  258. NS_IMETHOD ParseAsync(nsIRequestObserver *observer) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseAsync(observer); }
  259. #if 0
  260. /* Use the code below as a template for the implementation class for this interface. */
  261. /* Header file */
  262. class nsSAXXMLReader : public nsISAXXMLReader
  263. {
  264. public:
  265. NS_DECL_ISUPPORTS
  266. NS_DECL_NSISAXXMLREADER
  267. nsSAXXMLReader();
  268. private:
  269. ~nsSAXXMLReader();
  270. protected:
  271. /* additional members */
  272. };
  273. /* Implementation file */
  274. NS_IMPL_ISUPPORTS1(nsSAXXMLReader, nsISAXXMLReader)
  275. nsSAXXMLReader::nsSAXXMLReader()
  276. {
  277. /* member initializers and constructor code */
  278. }
  279. nsSAXXMLReader::~nsSAXXMLReader()
  280. {
  281. /* destructor code */
  282. }
  283. /* attribute nsIURI baseURI; */
  284. NS_IMETHODIMP nsSAXXMLReader::GetBaseURI(nsIURI * *aBaseURI)
  285. {
  286. return NS_ERROR_NOT_IMPLEMENTED;
  287. }
  288. NS_IMETHODIMP nsSAXXMLReader::SetBaseURI(nsIURI * aBaseURI)
  289. {
  290. return NS_ERROR_NOT_IMPLEMENTED;
  291. }
  292. /* attribute nsISAXContentHandler contentHandler; */
  293. NS_IMETHODIMP nsSAXXMLReader::GetContentHandler(nsISAXContentHandler * *aContentHandler)
  294. {
  295. return NS_ERROR_NOT_IMPLEMENTED;
  296. }
  297. NS_IMETHODIMP nsSAXXMLReader::SetContentHandler(nsISAXContentHandler * aContentHandler)
  298. {
  299. return NS_ERROR_NOT_IMPLEMENTED;
  300. }
  301. /* attribute nsISAXDTDHandler dtdHandler; */
  302. NS_IMETHODIMP nsSAXXMLReader::GetDtdHandler(nsISAXDTDHandler * *aDtdHandler)
  303. {
  304. return NS_ERROR_NOT_IMPLEMENTED;
  305. }
  306. NS_IMETHODIMP nsSAXXMLReader::SetDtdHandler(nsISAXDTDHandler * aDtdHandler)
  307. {
  308. return NS_ERROR_NOT_IMPLEMENTED;
  309. }
  310. /* attribute nsISAXErrorHandler errorHandler; */
  311. NS_IMETHODIMP nsSAXXMLReader::GetErrorHandler(nsISAXErrorHandler * *aErrorHandler)
  312. {
  313. return NS_ERROR_NOT_IMPLEMENTED;
  314. }
  315. NS_IMETHODIMP nsSAXXMLReader::SetErrorHandler(nsISAXErrorHandler * aErrorHandler)
  316. {
  317. return NS_ERROR_NOT_IMPLEMENTED;
  318. }
  319. /* attribute nsISAXLexicalHandler lexicalHandler; */
  320. NS_IMETHODIMP nsSAXXMLReader::GetLexicalHandler(nsISAXLexicalHandler * *aLexicalHandler)
  321. {
  322. return NS_ERROR_NOT_IMPLEMENTED;
  323. }
  324. NS_IMETHODIMP nsSAXXMLReader::SetLexicalHandler(nsISAXLexicalHandler * aLexicalHandler)
  325. {
  326. return NS_ERROR_NOT_IMPLEMENTED;
  327. }
  328. /* void setFeature (in AString name, in boolean value); */
  329. NS_IMETHODIMP nsSAXXMLReader::SetFeature(const nsAString & name, PRBool value)
  330. {
  331. return NS_ERROR_NOT_IMPLEMENTED;
  332. }
  333. /* boolean getFeature (in AString name); */
  334. NS_IMETHODIMP nsSAXXMLReader::GetFeature(const nsAString & name, PRBool *_retval)
  335. {
  336. return NS_ERROR_NOT_IMPLEMENTED;
  337. }
  338. /* void setProperty (in AString name, in nsISupports value); */
  339. NS_IMETHODIMP nsSAXXMLReader::SetProperty(const nsAString & name, nsISupports *value)
  340. {
  341. return NS_ERROR_NOT_IMPLEMENTED;
  342. }
  343. /* boolean getProperty (in AString name); */
  344. NS_IMETHODIMP nsSAXXMLReader::GetProperty(const nsAString & name, PRBool *_retval)
  345. {
  346. return NS_ERROR_NOT_IMPLEMENTED;
  347. }
  348. /* void parseFromString (in AString str, in string contentType); */
  349. NS_IMETHODIMP nsSAXXMLReader::ParseFromString(const nsAString & str, const char *contentType)
  350. {
  351. return NS_ERROR_NOT_IMPLEMENTED;
  352. }
  353. /* void parseFromStream (in nsIInputStream stream, in string charset, in string contentType); */
  354. NS_IMETHODIMP nsSAXXMLReader::ParseFromStream(nsIInputStream *stream, const char *charset, const char *contentType)
  355. {
  356. return NS_ERROR_NOT_IMPLEMENTED;
  357. }
  358. /* void parseAsync (in nsIRequestObserver observer); */
  359. NS_IMETHODIMP nsSAXXMLReader::ParseAsync(nsIRequestObserver *observer)
  360. {
  361. return NS_ERROR_NOT_IMPLEMENTED;
  362. }
  363. /* End of implementation class template. */
  364. #endif
  365. #endif /* __gen_nsISAXXMLReader_h__ */