netwerk/streamconv/converters/nsIndexedToHTML.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef ____nsindexedtohtml___h___
michael@0 7 #define ____nsindexedtohtml___h___
michael@0 8
michael@0 9 #include "nsCOMPtr.h"
michael@0 10 #include "nsString.h"
michael@0 11 #include "nsIStreamConverter.h"
michael@0 12 #include "nsIDirIndexListener.h"
michael@0 13
michael@0 14 #define NS_NSINDEXEDTOHTMLCONVERTER_CID \
michael@0 15 { 0xcf0f71fd, 0xfafd, 0x4e2b, {0x9f, 0xdc, 0x13, 0x4d, 0x97, 0x2e, 0x16, 0xe2} }
michael@0 16
michael@0 17 class nsIDateTimeFormat;
michael@0 18 class nsIStringBundle;
michael@0 19 class nsITextToSubURI;
michael@0 20 class nsIUnicodeEncoder;
michael@0 21
michael@0 22 class nsIndexedToHTML : public nsIStreamConverter,
michael@0 23 public nsIDirIndexListener
michael@0 24 {
michael@0 25 public:
michael@0 26 NS_DECL_ISUPPORTS
michael@0 27 NS_DECL_NSISTREAMCONVERTER
michael@0 28 NS_DECL_NSIREQUESTOBSERVER
michael@0 29 NS_DECL_NSISTREAMLISTENER
michael@0 30 NS_DECL_NSIDIRINDEXLISTENER
michael@0 31
michael@0 32 nsIndexedToHTML();
michael@0 33 virtual ~nsIndexedToHTML();
michael@0 34
michael@0 35 nsresult Init(nsIStreamListener *aListener);
michael@0 36
michael@0 37 static nsresult
michael@0 38 Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
michael@0 39
michael@0 40 protected:
michael@0 41
michael@0 42 void FormatSizeString(int64_t inSize, nsCString& outSizeString);
michael@0 43 nsresult SendToListener(nsIRequest* aRequest, nsISupports *aContext, const nsACString &aBuffer);
michael@0 44 // Helper to properly implement OnStartRequest
michael@0 45 nsresult DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
michael@0 46 nsCString& aBuffer);
michael@0 47
michael@0 48 protected:
michael@0 49 nsCOMPtr<nsIDirIndexParser> mParser;
michael@0 50 nsCOMPtr<nsIStreamListener> mListener; // final listener (consumer)
michael@0 51
michael@0 52 nsCOMPtr<nsIDateTimeFormat> mDateTime;
michael@0 53 nsCOMPtr<nsIStringBundle> mBundle;
michael@0 54
michael@0 55 nsCOMPtr<nsITextToSubURI> mTextToSubURI;
michael@0 56 nsCOMPtr<nsIUnicodeEncoder> mUnicodeEncoder;
michael@0 57
michael@0 58 private:
michael@0 59 // Expecting absolute locations, given by 201 lines.
michael@0 60 bool mExpectAbsLoc;
michael@0 61 };
michael@0 62
michael@0 63 #endif
michael@0 64

mercurial