1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/streamconv/converters/nsIndexedToHTML.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef ____nsindexedtohtml___h___ 1.10 +#define ____nsindexedtohtml___h___ 1.11 + 1.12 +#include "nsCOMPtr.h" 1.13 +#include "nsString.h" 1.14 +#include "nsIStreamConverter.h" 1.15 +#include "nsIDirIndexListener.h" 1.16 + 1.17 +#define NS_NSINDEXEDTOHTMLCONVERTER_CID \ 1.18 +{ 0xcf0f71fd, 0xfafd, 0x4e2b, {0x9f, 0xdc, 0x13, 0x4d, 0x97, 0x2e, 0x16, 0xe2} } 1.19 + 1.20 +class nsIDateTimeFormat; 1.21 +class nsIStringBundle; 1.22 +class nsITextToSubURI; 1.23 +class nsIUnicodeEncoder; 1.24 + 1.25 +class nsIndexedToHTML : public nsIStreamConverter, 1.26 + public nsIDirIndexListener 1.27 +{ 1.28 +public: 1.29 + NS_DECL_ISUPPORTS 1.30 + NS_DECL_NSISTREAMCONVERTER 1.31 + NS_DECL_NSIREQUESTOBSERVER 1.32 + NS_DECL_NSISTREAMLISTENER 1.33 + NS_DECL_NSIDIRINDEXLISTENER 1.34 + 1.35 + nsIndexedToHTML(); 1.36 + virtual ~nsIndexedToHTML(); 1.37 + 1.38 + nsresult Init(nsIStreamListener *aListener); 1.39 + 1.40 + static nsresult 1.41 + Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); 1.42 + 1.43 +protected: 1.44 + 1.45 + void FormatSizeString(int64_t inSize, nsCString& outSizeString); 1.46 + nsresult SendToListener(nsIRequest* aRequest, nsISupports *aContext, const nsACString &aBuffer); 1.47 + // Helper to properly implement OnStartRequest 1.48 + nsresult DoOnStartRequest(nsIRequest* request, nsISupports *aContext, 1.49 + nsCString& aBuffer); 1.50 + 1.51 +protected: 1.52 + nsCOMPtr<nsIDirIndexParser> mParser; 1.53 + nsCOMPtr<nsIStreamListener> mListener; // final listener (consumer) 1.54 + 1.55 + nsCOMPtr<nsIDateTimeFormat> mDateTime; 1.56 + nsCOMPtr<nsIStringBundle> mBundle; 1.57 + 1.58 + nsCOMPtr<nsITextToSubURI> mTextToSubURI; 1.59 + nsCOMPtr<nsIUnicodeEncoder> mUnicodeEncoder; 1.60 + 1.61 +private: 1.62 + // Expecting absolute locations, given by 201 lines. 1.63 + bool mExpectAbsLoc; 1.64 +}; 1.65 + 1.66 +#endif 1.67 +