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