michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * MODULE NOTES: michael@0: * @update gess 4/1/98 michael@0: * michael@0: */ michael@0: michael@0: #ifndef __CParserContext michael@0: #define __CParserContext michael@0: michael@0: #include "nsIParser.h" michael@0: #include "nsIURL.h" michael@0: #include "nsIDTD.h" michael@0: #include "nsIStreamListener.h" michael@0: #include "nsIRequest.h" michael@0: #include "nsScanner.h" michael@0: #include "nsString.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsAutoPtr.h" michael@0: michael@0: /** michael@0: * Note that the parser is given FULL access to all michael@0: * data in a parsercontext. Hey, that what it's for! michael@0: */ michael@0: michael@0: class CParserContext { michael@0: public: michael@0: enum eContextType {eCTNone,eCTURL,eCTString,eCTStream}; michael@0: michael@0: CParserContext(CParserContext* aPrevContext, michael@0: nsScanner* aScanner, michael@0: void* aKey = 0, michael@0: eParserCommands aCommand = eViewNormal, michael@0: nsIRequestObserver* aListener = 0, michael@0: eAutoDetectResult aStatus = eUnknownDetect, michael@0: bool aCopyUnused = false); michael@0: michael@0: ~CParserContext(); michael@0: michael@0: nsresult GetTokenizer(nsIDTD* aDTD, michael@0: nsIContentSink* aSink, michael@0: nsITokenizer*& aTokenizer); michael@0: void SetMimeType(const nsACString& aMimeType); michael@0: michael@0: nsCOMPtr mRequest; // provided by necko to differnciate different input streams michael@0: // why is mRequest strongly referenced? see bug 102376. michael@0: nsCOMPtr mListener; michael@0: void* const mKey; michael@0: nsCOMPtr mTokenizer; michael@0: CParserContext* const mPrevContext; michael@0: nsAutoPtr mScanner; michael@0: michael@0: nsCString mMimeType; michael@0: nsDTDMode mDTDMode; michael@0: michael@0: eParserDocType mDocType; michael@0: eStreamState mStreamListenerState; michael@0: eContextType mContextType; michael@0: eAutoDetectResult mAutoDetectStatus; michael@0: eParserCommands mParserCommand; michael@0: michael@0: bool mMultipart; michael@0: bool mCopyUnused; michael@0: }; michael@0: michael@0: #endif