1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11 * @update gess 7/20/98
13 * This interface defines standard interface for DTD's. Note that this
14 * isn't HTML specific. DTD's have several functions within the parser
16 * 1) To coordinate the consumption of an input stream via the
18 * 2) To serve as proxy to represent the containment rules of the
20 * 3) To offer autodetection services to the parser (mainly for doc
24 #include "nsISupports.h"
29 0x3de05873, 0xefa7, 0x410d, { \
30 0xa4, 0x61, 0x80, 0x33, 0xaf, 0xd9, 0xe3, 0x26 \
34 enum eAutoDetectResult
{
40 eDTDMode_quirks
, // pre 4.0 versions
41 eDTDMode_full_standards
,
48 class nsIDTD
: public nsISupports
{
50 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDTD_IID
)
53 * Called by the parser after the parsing process has concluded
55 virtual void DidBuildModel() = 0;
58 * Called (possibly repeatedly) by the parser to parse tokens and construct
59 * the document model via the sink provided to WillBuildModel.
61 * @param aCountLines - informs the DTD whether to count newlines
62 * (not wanted, e.g., when handling document.write)
63 * @param aCharsetPtr - address of an nsCString containing the charset
64 * that the DTD should use (pointer in case the DTD
65 * opts to ignore this parameter)
67 NS_IMETHOD
BuildModel(nsIContentSink
* aSink
) = 0;
70 * Use this id you want to stop the building content model
71 * --------------[ Sets DTD to STOP mode ]----------------
72 * It's recommended to use this method in accordance with
73 * the parser's terminate() method.
75 * @update harishd 07/22/99
79 NS_IMETHOD_(void) Terminate() = 0;
82 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDTD
, NS_IDTD_IID
)
84 #define NS_DECL_NSIDTD \
85 void DidBuildModel() override; \
86 NS_IMETHOD BuildModel(nsIContentSink* aSink) override; \
87 NS_IMETHOD_(void) Terminate() override;
88 #endif /* nsIDTD_h___ */