1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3
* The contents of this file are subject to the Netscape Public
4
* License Version 1.1 (the "License"); you may not use this file
5
* except in compliance with the License. You may obtain a copy of
6
* the License at http://www.mozilla.org/NPL/
8
* Software distributed under the License is distributed on an "AS
9
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
* implied. See the License for the specific language governing
11
* rights and limitations under the License.
13
* The Original Code is mozilla.org code.
15
* The Initial Developer of the Original Code is Netscape
16
* Communications Corporation. Portions created by Netscape are
17
* Copyright (C) 1998 Netscape Communications Corporation. All
30
#ifndef __NS_VIEWSOURCE_HTML_
31
#define __NS_VIEWSOURCE_HTML_
34
#include "nsISupports.h"
35
#include "nsHTMLTokens.h"
36
#include "nsIHTMLContentSink.h"
37
#include "nsDTDUtils.h"
38
#include "nsParserNode.h"
40
#define NS_VIEWSOURCE_HTML_IID \
41
{0xb6003010, 0x7932, 0x11d2, \
42
{0x80, 0x1b, 0x0, 0x60, 0x8, 0xbf, 0xc4, 0x89 }}
50
class CViewSourceHTML: public nsIDTD
58
virtual ~CViewSourceHTML();
61
* Set this to TRUE if you want the DTD to verify its
63
* @update gess 7/23/98
67
virtual void SetVerification(PRBool aEnable);
70
nsresult WriteTag(PRInt32 tagType,
71
const nsAString &aText,
73
PRBool aNewlineRequired);
75
nsresult WriteAttributes(PRInt32 attrCount);
76
nsresult GenerateSummary();
77
void StartNewPreBlock(void);
78
// Utility method for adding attributes to the nodes we generate
79
void AddAttrToNode(nsCParserStartNode& aNode,
80
nsTokenAllocator* aAllocator,
81
const nsAString& aAttrName,
82
const nsAString& aAttrValue);
87
nsIHTMLContentSink* mSink;
89
nsITokenizer* mTokenizer; // weak
95
PRInt32 mMarkupDeclaration;
104
PRPackedBool mSyntaxHighlight;
105
PRPackedBool mWrapLongLines;
106
PRPackedBool mHasOpenRoot;
107
PRPackedBool mHasOpenBody;
110
eParserCommands mParserCommand; //tells us to viewcontent/viewsource/viewerrors...
111
eParserDocType mDocType;
120
PRUint32 mTokenCount;
123
extern nsresult NS_NewViewSourceHTML(nsIDTD** aInstancePtrResult);