1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/res/nsIResProtocolHandler.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; 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 +#include "nsIProtocolHandler.idl" 1.10 + 1.11 +/** 1.12 + * Protocol handler interface for the resource:// protocol 1.13 + */ 1.14 +[scriptable, uuid(067ca872-e947-4bd6-8946-a479cb6ba5dd)] 1.15 +interface nsIResProtocolHandler : nsIProtocolHandler 1.16 +{ 1.17 + /** 1.18 + * Sets the substitution for the root key: 1.19 + * resource://root/path ==> baseURI.resolve(path) 1.20 + * 1.21 + * A null baseURI removes the specified substitution. 1.22 + * 1.23 + * A root key should always be lowercase; however, this may not be 1.24 + * enforced. 1.25 + */ 1.26 + void setSubstitution(in ACString root, in nsIURI baseURI); 1.27 + 1.28 + /** 1.29 + * Gets the substitution for the root key. 1.30 + * 1.31 + * @throws NS_ERROR_NOT_AVAILABLE if none exists. 1.32 + */ 1.33 + nsIURI getSubstitution(in ACString root); 1.34 + 1.35 + /** 1.36 + * Returns TRUE if the substitution exists and FALSE otherwise. 1.37 + */ 1.38 + boolean hasSubstitution(in ACString root); 1.39 + 1.40 + /** 1.41 + * Utility function to resolve a resource URI. A resolved URI is not 1.42 + * guaranteed to reference a resource that exists (ie. opening a channel to 1.43 + * the resolved URI may fail). 1.44 + * 1.45 + * @throws NS_ERROR_NOT_AVAILABLE if resURI.host() is an unknown root key. 1.46 + */ 1.47 + AUTF8String resolveURI(in nsIURI resURI); 1.48 +};