1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/chrome/public/nsIChromeRegistry.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIURI; 1.13 + 1.14 +[scriptable, uuid(249fb5ad-ae29-4e2c-a728-ba5cf464d188)] 1.15 +interface nsIChromeRegistry : nsISupports 1.16 +{ 1.17 + const int32_t NONE = 0; 1.18 + const int32_t PARTIAL = 1; 1.19 + const int32_t FULL = 2; 1.20 + 1.21 + /** 1.22 + * Resolve a chrome URL to an loadable URI using the information in the 1.23 + * registry. Does not modify aChromeURL. 1.24 + * 1.25 + * Chrome URLs are allowed to be specified in "shorthand", leaving the 1.26 + * "file" portion off. In that case, the URL is expanded to: 1.27 + * 1.28 + * chrome://package/provider/package.ext 1.29 + * 1.30 + * where "ext" is: 1.31 + * 1.32 + * "xul" for a "content" package, 1.33 + * "css" for a "skin" package, and 1.34 + * "dtd" for a "locale" package. 1.35 + * 1.36 + * @param aChromeURL the URL that is to be converted. 1.37 + */ 1.38 + nsIURI convertChromeURL(in nsIURI aChromeURL); 1.39 + 1.40 + /** 1.41 + * refresh the chrome list at runtime, looking for new packages/etc 1.42 + */ 1.43 + void checkForNewChrome(); 1.44 + 1.45 + /** 1.46 + * returns whether XPCNativeWrappers are enabled for aURI. 1.47 + */ 1.48 + [notxpcom] boolean wrappersEnabled(in nsIURI aURI); 1.49 +}; 1.50 + 1.51 +[scriptable, uuid(c2461347-2b8f-48c7-9d59-3a61fb868828)] 1.52 +interface nsIXULChromeRegistry : nsIChromeRegistry 1.53 +{ 1.54 + /* Should be called when locales change to reload all chrome (including XUL). */ 1.55 + void reloadChrome(); 1.56 + 1.57 + ACString getSelectedLocale(in ACString packageName); 1.58 + 1.59 + // Get the direction of the locale via the intl.uidirection.<locale> pref 1.60 + boolean isLocaleRTL(in ACString package); 1.61 + 1.62 + /* Should be called when skins change. Reloads only stylesheets. */ 1.63 + void refreshSkins(); 1.64 + 1.65 + /** 1.66 + * Installable skin XBL is not always granted the same privileges as other 1.67 + * chrome. This asks the chrome registry whether scripts are allowed to be 1.68 + * run for a particular chrome URI. Do not pass non-chrome URIs to this 1.69 + * method. 1.70 + */ 1.71 + boolean allowScriptsForPackage(in nsIURI url); 1.72 + 1.73 + /** 1.74 + * Content should only be allowed to load chrome JS from certain packages. 1.75 + * This method reflects the contentaccessible flag on packages. 1.76 + * Do not pass non-chrome URIs to this method. 1.77 + */ 1.78 + boolean allowContentToAccess(in nsIURI url); 1.79 +}; 1.80 + 1.81 +%{ C++ 1.82 + 1.83 +#define NS_CHROMEREGISTRY_CONTRACTID \ 1.84 + "@mozilla.org/chrome/chrome-registry;1" 1.85 + 1.86 +/** 1.87 + * Chrome registry will notify various caches that all chrome files need 1.88 + * flushing. 1.89 + */ 1.90 +#define NS_CHROME_FLUSH_TOPIC \ 1.91 + "chrome-flush-caches" 1.92 + 1.93 +/** 1.94 + * Chrome registry will notify various caches that skin files need flushing. 1.95 + * If "chrome-flush-caches" is notified, this topic will *not* be notified. 1.96 + */ 1.97 +#define NS_CHROME_FLUSH_SKINS_TOPIC \ 1.98 + "chrome-flush-skin-caches" 1.99 + 1.100 +%}