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 "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIChannel; michael@0: michael@0: [scriptable, uuid(9575693c-60d9-4332-b6b8-6c29289339cb)] michael@0: interface nsIAboutModule : nsISupports michael@0: { michael@0: /** michael@0: * Constructs a new channel for the about protocol module. michael@0: * michael@0: * @param aURI the uri of the new channel michael@0: */ michael@0: nsIChannel newChannel(in nsIURI aURI); michael@0: michael@0: /** michael@0: * A flag that indicates whether a URI is safe for untrusted michael@0: * content. If it is, web pages and so forth will be allowed to michael@0: * link to this about: URI, and the about: protocol handler will michael@0: * enforce that the principal of channels created for it be based michael@0: * on their originalURI or URI (depending on the channel flags), michael@0: * by setting their "owner" to null. michael@0: * Otherwise, only chrome will be able to link to it. michael@0: */ michael@0: const unsigned long URI_SAFE_FOR_UNTRUSTED_CONTENT = (1 << 0); michael@0: michael@0: /** michael@0: * A flag that indicates whether script should be enabled for the michael@0: * given about: URI even if it's disabled in general. michael@0: */ michael@0: const unsigned long ALLOW_SCRIPT = (1 << 1); michael@0: michael@0: /** michael@0: * A flag that indicates whether this about: URI doesn't want to be listed michael@0: * in about:about, especially if it's not useful without a query string. michael@0: */ michael@0: const unsigned long HIDE_FROM_ABOUTABOUT = (1 << 2); michael@0: michael@0: /** michael@0: * A method to get the flags that apply to a given about: URI. The URI michael@0: * passed in is guaranteed to be one of the URIs that this module michael@0: * registered to deal with. michael@0: */ michael@0: unsigned long getURIFlags(in nsIURI aURI); michael@0: }; michael@0: michael@0: %{C++ michael@0: michael@0: #define NS_ABOUT_MODULE_CONTRACTID "@mozilla.org/network/protocol/about;1" michael@0: #define NS_ABOUT_MODULE_CONTRACTID_PREFIX NS_ABOUT_MODULE_CONTRACTID "?what=" michael@0: #define NS_ABOUT_MODULE_CONTRACTID_LENGTH 49 // strlen(NS_ABOUT_MODULE_CONTRACTID_PREFIX) michael@0: michael@0: %}