michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: #ifndef ____nsindexedtohtml___h___ michael@0: #define ____nsindexedtohtml___h___ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "nsIStreamConverter.h" michael@0: #include "nsIDirIndexListener.h" michael@0: michael@0: #define NS_NSINDEXEDTOHTMLCONVERTER_CID \ michael@0: { 0xcf0f71fd, 0xfafd, 0x4e2b, {0x9f, 0xdc, 0x13, 0x4d, 0x97, 0x2e, 0x16, 0xe2} } michael@0: michael@0: class nsIDateTimeFormat; michael@0: class nsIStringBundle; michael@0: class nsITextToSubURI; michael@0: class nsIUnicodeEncoder; michael@0: michael@0: class nsIndexedToHTML : public nsIStreamConverter, michael@0: public nsIDirIndexListener michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISTREAMCONVERTER michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSISTREAMLISTENER michael@0: NS_DECL_NSIDIRINDEXLISTENER michael@0: michael@0: nsIndexedToHTML(); michael@0: virtual ~nsIndexedToHTML(); michael@0: michael@0: nsresult Init(nsIStreamListener *aListener); michael@0: michael@0: static nsresult michael@0: Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); michael@0: michael@0: protected: michael@0: michael@0: void FormatSizeString(int64_t inSize, nsCString& outSizeString); michael@0: nsresult SendToListener(nsIRequest* aRequest, nsISupports *aContext, const nsACString &aBuffer); michael@0: // Helper to properly implement OnStartRequest michael@0: nsresult DoOnStartRequest(nsIRequest* request, nsISupports *aContext, michael@0: nsCString& aBuffer); michael@0: michael@0: protected: michael@0: nsCOMPtr mParser; michael@0: nsCOMPtr mListener; // final listener (consumer) michael@0: michael@0: nsCOMPtr mDateTime; michael@0: nsCOMPtr mBundle; michael@0: michael@0: nsCOMPtr mTextToSubURI; michael@0: nsCOMPtr mUnicodeEncoder; michael@0: michael@0: private: michael@0: // Expecting absolute locations, given by 201 lines. michael@0: bool mExpectAbsLoc; michael@0: }; michael@0: michael@0: #endif michael@0: