Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / xml / nsIXMLContentSink.h
blobeba9b356f09ffa08dfa4676700bb2806b7d9d846
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsIXMLContentSink_h___
7 #define nsIXMLContentSink_h___
9 #include "nsIContentSink.h"
10 #include "nsISupports.h"
12 class nsIURI;
13 class nsIChannel;
14 namespace mozilla::dom {
15 class Document;
16 } // namespace mozilla::dom
18 #define NS_IXMLCONTENT_SINK_IID \
19 { \
20 0x63fedea0, 0x9b0f, 0x4d64, { \
21 0x9b, 0xa5, 0x37, 0xc6, 0x99, 0x73, 0x29, 0x35 \
22 } \
25 /**
26 * This interface represents a content sink for generic XML files.
27 * The goal of this sink is to deal with XML documents that do not
28 * have pre-built semantics, though it may also be implemented for
29 * cases in which semantics are hard-wired.
31 * The expectation is that the parser has already performed
32 * well-formedness and validity checking.
34 * XXX The expectation is that entity expansion will be done by the sink
35 * itself. This would require, however, that the sink has the ability
36 * to query the parser for entity replacement text.
38 * XXX This interface does not contain a mechanism for the sink to
39 * get specific schema/DTD information from the parser. This information
40 * may be necessary for entity expansion. It is also necessary for
41 * building the DOM portions that relate to the schema.
43 * XXX This interface does not deal with the presence of an external
44 * subset. It seems possible that this could be dealt with completely
45 * at the parser level.
48 class nsIXMLContentSink : public nsIContentSink {
49 public:
50 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXMLCONTENT_SINK_IID)
51 virtual bool IsPrettyPrintXML() const { return false; }
52 virtual bool IsPrettyPrintHasSpecialRoot() const { return false; }
55 NS_DEFINE_STATIC_IID_ACCESSOR(nsIXMLContentSink, NS_IXMLCONTENT_SINK_IID)
57 nsresult NS_NewXMLContentSink(nsIXMLContentSink** aInstancePtrResult,
58 mozilla::dom::Document* aDoc, nsIURI* aURL,
59 nsISupports* aContainer, nsIChannel* aChannel);
61 #endif // nsIXMLContentSink_h___