michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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: michael@0: [scriptable, uuid(249fb5ad-ae29-4e2c-a728-ba5cf464d188)] michael@0: interface nsIChromeRegistry : nsISupports michael@0: { michael@0: const int32_t NONE = 0; michael@0: const int32_t PARTIAL = 1; michael@0: const int32_t FULL = 2; michael@0: michael@0: /** michael@0: * Resolve a chrome URL to an loadable URI using the information in the michael@0: * registry. Does not modify aChromeURL. michael@0: * michael@0: * Chrome URLs are allowed to be specified in "shorthand", leaving the michael@0: * "file" portion off. In that case, the URL is expanded to: michael@0: * michael@0: * chrome://package/provider/package.ext michael@0: * michael@0: * where "ext" is: michael@0: * michael@0: * "xul" for a "content" package, michael@0: * "css" for a "skin" package, and michael@0: * "dtd" for a "locale" package. michael@0: * michael@0: * @param aChromeURL the URL that is to be converted. michael@0: */ michael@0: nsIURI convertChromeURL(in nsIURI aChromeURL); michael@0: michael@0: /** michael@0: * refresh the chrome list at runtime, looking for new packages/etc michael@0: */ michael@0: void checkForNewChrome(); michael@0: michael@0: /** michael@0: * returns whether XPCNativeWrappers are enabled for aURI. michael@0: */ michael@0: [notxpcom] boolean wrappersEnabled(in nsIURI aURI); michael@0: }; michael@0: michael@0: [scriptable, uuid(c2461347-2b8f-48c7-9d59-3a61fb868828)] michael@0: interface nsIXULChromeRegistry : nsIChromeRegistry michael@0: { michael@0: /* Should be called when locales change to reload all chrome (including XUL). */ michael@0: void reloadChrome(); michael@0: michael@0: ACString getSelectedLocale(in ACString packageName); michael@0: michael@0: // Get the direction of the locale via the intl.uidirection. pref michael@0: boolean isLocaleRTL(in ACString package); michael@0: michael@0: /* Should be called when skins change. Reloads only stylesheets. */ michael@0: void refreshSkins(); michael@0: michael@0: /** michael@0: * Installable skin XBL is not always granted the same privileges as other michael@0: * chrome. This asks the chrome registry whether scripts are allowed to be michael@0: * run for a particular chrome URI. Do not pass non-chrome URIs to this michael@0: * method. michael@0: */ michael@0: boolean allowScriptsForPackage(in nsIURI url); michael@0: michael@0: /** michael@0: * Content should only be allowed to load chrome JS from certain packages. michael@0: * This method reflects the contentaccessible flag on packages. michael@0: * Do not pass non-chrome URIs to this method. michael@0: */ michael@0: boolean allowContentToAccess(in nsIURI url); michael@0: }; michael@0: michael@0: %{ C++ michael@0: michael@0: #define NS_CHROMEREGISTRY_CONTRACTID \ michael@0: "@mozilla.org/chrome/chrome-registry;1" michael@0: michael@0: /** michael@0: * Chrome registry will notify various caches that all chrome files need michael@0: * flushing. michael@0: */ michael@0: #define NS_CHROME_FLUSH_TOPIC \ michael@0: "chrome-flush-caches" michael@0: michael@0: /** michael@0: * Chrome registry will notify various caches that skin files need flushing. michael@0: * If "chrome-flush-caches" is notified, this topic will *not* be notified. michael@0: */ michael@0: #define NS_CHROME_FLUSH_SKINS_TOPIC \ michael@0: "chrome-flush-skin-caches" michael@0: michael@0: %}