1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef NSDEFAULTURIFIXUP_H
8 #define NSDEFAULTURIFIXUP_H
10 #include "nsIURIFixup.h"
12 class nsDefaultURIFixupInfo
;
15 class nsDefaultURIFixup
: public nsIURIFixup
24 virtual ~nsDefaultURIFixup();
27 /* additional members */
28 nsresult
FileURIFixup(const nsACString
&aStringURI
, nsIURI
** aURI
);
29 nsresult
ConvertFileToStringURI(const nsACString
& aIn
, nsCString
& aOut
);
30 nsresult
FixupURIProtocol(const nsACString
& aIn
,
31 nsDefaultURIFixupInfo
* aFixupInfo
,
33 void KeywordURIFixup(const nsACString
&aStringURI
,
34 nsDefaultURIFixupInfo
* aFixupInfo
,
35 nsIInputStream
** aPostData
);
36 bool PossiblyByteExpandedFileName(const nsAString
& aIn
);
37 bool PossiblyHostPortUrl(const nsACString
& aUrl
);
38 bool MakeAlternateURI(nsIURI
*aURI
);
39 bool IsLikelyFTP(const nsCString
& aHostSpec
);
42 class nsDefaultURIFixupInfo
: public nsIURIFixupInfo
46 NS_DECL_NSIURIFIXUPINFO
48 explicit nsDefaultURIFixupInfo(const nsACString
& aOriginalInput
);
50 friend class nsDefaultURIFixup
;
53 virtual ~nsDefaultURIFixupInfo();
56 nsCOMPtr
<nsISupports
> mConsumer
;
57 nsCOMPtr
<nsIURI
> mPreferredURI
;
58 nsCOMPtr
<nsIURI
> mFixedURI
;
59 bool mFixupUsedKeyword
;
60 bool mFixupChangedProtocol
;
61 bool mFixupCreatedAlternateURI
;
62 nsAutoCString mOriginalInput
;