Bug 1698048 - Move browser/themes/shared/reader/readerMode.svg to the browser/themes...
[gecko.git] / netwerk / protocol / res / nsISubstitutingProtocolHandler.idl
blobcf2e0d42abc10262a30be38341a73d9215da87b4
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
6 #include "nsIProtocolHandler.idl"
9 /**
10 * Protocol handler superinterface for a protocol which performs substitutions
11 * from URIs of its scheme to URIs of another scheme.
13 [scriptable, uuid(154c64fd-a69e-4105-89f8-bd7dfe621372)]
14 interface nsISubstitutingProtocolHandler : nsIProtocolHandler
16 /**
17 * Content script may access files in this package.
19 const short ALLOW_CONTENT_ACCESS = 1 << 0;
20 /**
21 * This substitution exposes nsIJARURI instead of a nsIFileURL. By default
22 * NewURI will always return a nsIFileURL even when the URL is jar:
24 const short RESOLVE_JAR_URI = 1 << 1;
26 /**
27 * Sets the substitution for the root key:
28 * resource://root/path ==> baseURI.resolve(path)
30 * A null baseURI removes the specified substitution.
32 * The root key will be converted to lower-case to conform to
33 * case-insensitive URI hostname matching behavior.
35 [must_use] void setSubstitution(in ACString root, in nsIURI baseURI);
37 /**
38 * Same as setSubstitution, but with specific flags.
40 [must_use] void setSubstitutionWithFlags(in ACString root, in nsIURI baseURI, in uint32_t flags);
42 /**
43 * Gets the substitution for the root key.
45 * @throws NS_ERROR_NOT_AVAILABLE if none exists.
47 [must_use] nsIURI getSubstitution(in ACString root);
49 /**
50 * Returns TRUE if the substitution exists and FALSE otherwise.
52 [must_use] boolean hasSubstitution(in ACString root);
54 /**
55 * Utility function to resolve a substituted URI. A resolved URI is not
56 * guaranteed to reference a resource that exists (ie. opening a channel to
57 * the resolved URI may fail).
59 * @throws NS_ERROR_NOT_AVAILABLE if resURI.host() is an unknown root key.
61 [must_use] AUTF8String resolveURI(in nsIURI resURI);