Thu, 15 Jan 2015 21:13:52 +0100
Remove forgotten relic of ABI crash risk averse overloaded method change.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsIStreamListener.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIInputStream; |
michael@0 | 9 | interface nsIRequestObserver; |
michael@0 | 10 | interface nsIURI; |
michael@0 | 11 | |
michael@0 | 12 | interface nsISAXContentHandler; |
michael@0 | 13 | interface nsISAXDTDHandler; |
michael@0 | 14 | interface nsISAXEntityResolver; |
michael@0 | 15 | interface nsISAXErrorHandler; |
michael@0 | 16 | interface nsISAXLexicalHandler; |
michael@0 | 17 | interface nsIMozSAXXMLDeclarationHandler; |
michael@0 | 18 | |
michael@0 | 19 | /** |
michael@0 | 20 | * Interface for reading an XML document using callbacks. |
michael@0 | 21 | * |
michael@0 | 22 | * nsISAXXMLReader is the interface that an XML parser's SAX2 |
michael@0 | 23 | * driver must implement. This interface allows an application to set |
michael@0 | 24 | * and query features and properties in the parser, to register event |
michael@0 | 25 | * handlers for document processing, and to initiate a document |
michael@0 | 26 | * parse. |
michael@0 | 27 | */ |
michael@0 | 28 | [scriptable, uuid(5b1de802-9091-454f-9972-5753c0d0c70e)] |
michael@0 | 29 | interface nsISAXXMLReader : nsIStreamListener { |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * The base URI. |
michael@0 | 33 | */ |
michael@0 | 34 | attribute nsIURI baseURI; |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * If the application does not register a content handler, all |
michael@0 | 38 | * content events reported by the SAX parser will be silently |
michael@0 | 39 | * ignored. |
michael@0 | 40 | * |
michael@0 | 41 | * Applications may register a new or different handler in the |
michael@0 | 42 | * middle of a parse, and the SAX parser must begin using the new |
michael@0 | 43 | * handler immediately. |
michael@0 | 44 | */ |
michael@0 | 45 | attribute nsISAXContentHandler contentHandler; |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * If the application does not register a DTD handler, all DTD |
michael@0 | 49 | * events reported by the SAX parser will be silently ignored. |
michael@0 | 50 | * |
michael@0 | 51 | * Applications may register a new or different handler in the |
michael@0 | 52 | * middle of a parse, and the SAX parser must begin using the new |
michael@0 | 53 | * handler immediately. |
michael@0 | 54 | */ |
michael@0 | 55 | attribute nsISAXDTDHandler dtdHandler; |
michael@0 | 56 | |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * If the application does not register an error handler, all |
michael@0 | 60 | * error events reported by the SAX parser will be silently ignored; |
michael@0 | 61 | * however, normal processing may not continue. It is highly |
michael@0 | 62 | * recommended that all SAX applications implement an error handler |
michael@0 | 63 | * to avoid unexpected bugs. |
michael@0 | 64 | * |
michael@0 | 65 | * Applications may register a new or different handler in the |
michael@0 | 66 | * middle of a parse, and the SAX parser must begin using the new |
michael@0 | 67 | * handler immediately. |
michael@0 | 68 | */ |
michael@0 | 69 | attribute nsISAXErrorHandler errorHandler; |
michael@0 | 70 | |
michael@0 | 71 | /** |
michael@0 | 72 | * A handler for the (optional) XML declaration of a document. |
michael@0 | 73 | * <?xml version='1.0'?> |
michael@0 | 74 | * |
michael@0 | 75 | * @note This is not part of the SAX standard. |
michael@0 | 76 | */ |
michael@0 | 77 | attribute nsIMozSAXXMLDeclarationHandler declarationHandler; |
michael@0 | 78 | |
michael@0 | 79 | /** |
michael@0 | 80 | * If the application does not register a lexical handler, all |
michael@0 | 81 | * lexical events (e.g. startDTD) reported by the SAX parser will be |
michael@0 | 82 | * silently ignored. |
michael@0 | 83 | * |
michael@0 | 84 | * Applications may register a new or different handler in the |
michael@0 | 85 | * middle of a parse, and the SAX parser must begin using the new |
michael@0 | 86 | * handler immediately. |
michael@0 | 87 | */ |
michael@0 | 88 | attribute nsISAXLexicalHandler lexicalHandler; |
michael@0 | 89 | |
michael@0 | 90 | /** |
michael@0 | 91 | * Set the value of a feature flag. |
michael@0 | 92 | * |
michael@0 | 93 | * The feature name is any fully-qualified URI. It is possible |
michael@0 | 94 | * for an XMLReader to expose a feature value but to be unable to |
michael@0 | 95 | * change the current value. Some feature values may be immutable |
michael@0 | 96 | * or mutable only in specific contexts, such as before, during, or |
michael@0 | 97 | * after a parse. |
michael@0 | 98 | * |
michael@0 | 99 | * All XMLReaders are required to support setting |
michael@0 | 100 | * http://xml.org/sax/features/namespaces to true and |
michael@0 | 101 | * http://xml.org/sax/features/namespace-prefixes to false. |
michael@0 | 102 | * |
michael@0 | 103 | * @param name String flag for a parser feature. |
michael@0 | 104 | * @param value Turn the feature on/off. |
michael@0 | 105 | * |
michael@0 | 106 | * @note This is currently supported only for |
michael@0 | 107 | * http://xml.org/sax/features/namespace-prefixes . All other |
michael@0 | 108 | * features will result in a NOT_IMPLEMENTED exception. |
michael@0 | 109 | */ |
michael@0 | 110 | void setFeature(in AString name, in boolean value); |
michael@0 | 111 | |
michael@0 | 112 | /** |
michael@0 | 113 | * Look up the value of a feature flag. |
michael@0 | 114 | * |
michael@0 | 115 | * The feature name is any fully-qualified URI. It is |
michael@0 | 116 | * possible for an XMLReader to recognize a feature name but |
michael@0 | 117 | * temporarily be unable to return its value. |
michael@0 | 118 | * Some feature values may be available only in specific |
michael@0 | 119 | * contexts, such as before, during, or after a parse. |
michael@0 | 120 | * |
michael@0 | 121 | * All XMLReaders are required to recognize the |
michael@0 | 122 | * http://xml.org/sax/features/namespaces and the |
michael@0 | 123 | * http://xml.org/sax/features/namespace-prefixes feature names. |
michael@0 | 124 | * |
michael@0 | 125 | * @param name String flag for a parser feature. |
michael@0 | 126 | * |
michael@0 | 127 | * @note This is currently supported only for |
michael@0 | 128 | * http://xml.org/sax/features/namespace-prefixes . All other |
michael@0 | 129 | * features will result in a NOT_IMPLEMENTED exception. |
michael@0 | 130 | */ |
michael@0 | 131 | boolean getFeature(in AString name); |
michael@0 | 132 | |
michael@0 | 133 | /** |
michael@0 | 134 | * Set the value of a property. NOT CURRENTLY IMPLEMENTED. |
michael@0 | 135 | * |
michael@0 | 136 | * The property name is any fully-qualified URI. It is possible |
michael@0 | 137 | * for an XMLReader to recognize a property name but to be unable to |
michael@0 | 138 | * change the current value. Some property values may be immutable |
michael@0 | 139 | * or mutable only in specific contexts, such as before, during, or |
michael@0 | 140 | * after a parse. |
michael@0 | 141 | * |
michael@0 | 142 | * XMLReaders are not required to recognize setting any specific |
michael@0 | 143 | * property names, though a core set is defined by SAX2. |
michael@0 | 144 | * |
michael@0 | 145 | * This method is also the standard mechanism for setting |
michael@0 | 146 | * extended handlers. |
michael@0 | 147 | * |
michael@0 | 148 | * @param name String flag for a parser feature |
michael@0 | 149 | * @param value Turn the feature on/off. |
michael@0 | 150 | */ |
michael@0 | 151 | void setProperty(in AString name, in nsISupports value); |
michael@0 | 152 | |
michael@0 | 153 | /** |
michael@0 | 154 | * Look up the value of a property. NOT CURRENTLY IMPLEMENTED. |
michael@0 | 155 | * |
michael@0 | 156 | * The property name is any fully-qualified URI. It is |
michael@0 | 157 | * possible for an XMLReader to recognize a property name but |
michael@0 | 158 | * temporarily be unable to return its value. |
michael@0 | 159 | * Some property values may be available only in specific |
michael@0 | 160 | * contexts, such as before, during, or after a parse. |
michael@0 | 161 | * |
michael@0 | 162 | * XMLReaders are not required to recognize any specific |
michael@0 | 163 | * property names, though an initial core set is documented for |
michael@0 | 164 | * SAX2. |
michael@0 | 165 | * |
michael@0 | 166 | * Implementors are free (and encouraged) to invent their own properties, |
michael@0 | 167 | * using names built on their own URIs. |
michael@0 | 168 | * |
michael@0 | 169 | * @param name The property name, which is a fully-qualified URI. |
michael@0 | 170 | * @return The current value of the property. |
michael@0 | 171 | */ |
michael@0 | 172 | boolean getProperty(in AString name); |
michael@0 | 173 | |
michael@0 | 174 | /** |
michael@0 | 175 | * |
michael@0 | 176 | * @param str The UTF16 string to be parsed |
michael@0 | 177 | * @param contentType The content type of the string (see parseFromStream) |
michael@0 | 178 | * |
michael@0 | 179 | */ |
michael@0 | 180 | void parseFromString(in AString str, in string contentType); |
michael@0 | 181 | |
michael@0 | 182 | /** |
michael@0 | 183 | * |
michael@0 | 184 | * @param stream The byte stream whose contents are parsed |
michael@0 | 185 | * @param charset The character set that was used to encode the byte |
michael@0 | 186 | * stream. NULL if not specified. |
michael@0 | 187 | * @param contentType The content type of the string - either text/xml, |
michael@0 | 188 | * application/xml, or application/xhtml+xml. |
michael@0 | 189 | * Must not be NULL. |
michael@0 | 190 | * |
michael@0 | 191 | */ |
michael@0 | 192 | void parseFromStream(in nsIInputStream stream, |
michael@0 | 193 | in string charset, |
michael@0 | 194 | in string contentType); |
michael@0 | 195 | |
michael@0 | 196 | /** |
michael@0 | 197 | * Begin an asynchronous parse. This method initializes the parser, |
michael@0 | 198 | * and must be called before any nsIStreamListener methods. It is |
michael@0 | 199 | * then the caller's duty to call nsIStreamListener methods to drive |
michael@0 | 200 | * the parser. Once this method is called, the caller must not call |
michael@0 | 201 | * one of the other parse methods. |
michael@0 | 202 | * |
michael@0 | 203 | * @param observer The nsIRequestObserver to notify upon start or stop. |
michael@0 | 204 | * Can be NULL. |
michael@0 | 205 | */ |
michael@0 | 206 | void parseAsync(in nsIRequestObserver observer); |
michael@0 | 207 | }; |