michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIProtocolHandler.idl" michael@0: michael@0: /** michael@0: * Protocol handler interface for the resource:// protocol michael@0: */ michael@0: [scriptable, uuid(067ca872-e947-4bd6-8946-a479cb6ba5dd)] michael@0: interface nsIResProtocolHandler : nsIProtocolHandler michael@0: { michael@0: /** michael@0: * Sets the substitution for the root key: michael@0: * resource://root/path ==> baseURI.resolve(path) michael@0: * michael@0: * A null baseURI removes the specified substitution. michael@0: * michael@0: * A root key should always be lowercase; however, this may not be michael@0: * enforced. michael@0: */ michael@0: void setSubstitution(in ACString root, in nsIURI baseURI); michael@0: michael@0: /** michael@0: * Gets the substitution for the root key. michael@0: * michael@0: * @throws NS_ERROR_NOT_AVAILABLE if none exists. michael@0: */ michael@0: nsIURI getSubstitution(in ACString root); michael@0: michael@0: /** michael@0: * Returns TRUE if the substitution exists and FALSE otherwise. michael@0: */ michael@0: boolean hasSubstitution(in ACString root); michael@0: michael@0: /** michael@0: * Utility function to resolve a resource URI. A resolved URI is not michael@0: * guaranteed to reference a resource that exists (ie. opening a channel to michael@0: * the resolved URI may fail). michael@0: * michael@0: * @throws NS_ERROR_NOT_AVAILABLE if resURI.host() is an unknown root key. michael@0: */ michael@0: AUTF8String resolveURI(in nsIURI resURI); michael@0: };