|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 interface nsIURI; |
|
10 |
|
11 [scriptable, uuid(249fb5ad-ae29-4e2c-a728-ba5cf464d188)] |
|
12 interface nsIChromeRegistry : nsISupports |
|
13 { |
|
14 const int32_t NONE = 0; |
|
15 const int32_t PARTIAL = 1; |
|
16 const int32_t FULL = 2; |
|
17 |
|
18 /** |
|
19 * Resolve a chrome URL to an loadable URI using the information in the |
|
20 * registry. Does not modify aChromeURL. |
|
21 * |
|
22 * Chrome URLs are allowed to be specified in "shorthand", leaving the |
|
23 * "file" portion off. In that case, the URL is expanded to: |
|
24 * |
|
25 * chrome://package/provider/package.ext |
|
26 * |
|
27 * where "ext" is: |
|
28 * |
|
29 * "xul" for a "content" package, |
|
30 * "css" for a "skin" package, and |
|
31 * "dtd" for a "locale" package. |
|
32 * |
|
33 * @param aChromeURL the URL that is to be converted. |
|
34 */ |
|
35 nsIURI convertChromeURL(in nsIURI aChromeURL); |
|
36 |
|
37 /** |
|
38 * refresh the chrome list at runtime, looking for new packages/etc |
|
39 */ |
|
40 void checkForNewChrome(); |
|
41 |
|
42 /** |
|
43 * returns whether XPCNativeWrappers are enabled for aURI. |
|
44 */ |
|
45 [notxpcom] boolean wrappersEnabled(in nsIURI aURI); |
|
46 }; |
|
47 |
|
48 [scriptable, uuid(c2461347-2b8f-48c7-9d59-3a61fb868828)] |
|
49 interface nsIXULChromeRegistry : nsIChromeRegistry |
|
50 { |
|
51 /* Should be called when locales change to reload all chrome (including XUL). */ |
|
52 void reloadChrome(); |
|
53 |
|
54 ACString getSelectedLocale(in ACString packageName); |
|
55 |
|
56 // Get the direction of the locale via the intl.uidirection.<locale> pref |
|
57 boolean isLocaleRTL(in ACString package); |
|
58 |
|
59 /* Should be called when skins change. Reloads only stylesheets. */ |
|
60 void refreshSkins(); |
|
61 |
|
62 /** |
|
63 * Installable skin XBL is not always granted the same privileges as other |
|
64 * chrome. This asks the chrome registry whether scripts are allowed to be |
|
65 * run for a particular chrome URI. Do not pass non-chrome URIs to this |
|
66 * method. |
|
67 */ |
|
68 boolean allowScriptsForPackage(in nsIURI url); |
|
69 |
|
70 /** |
|
71 * Content should only be allowed to load chrome JS from certain packages. |
|
72 * This method reflects the contentaccessible flag on packages. |
|
73 * Do not pass non-chrome URIs to this method. |
|
74 */ |
|
75 boolean allowContentToAccess(in nsIURI url); |
|
76 }; |
|
77 |
|
78 %{ C++ |
|
79 |
|
80 #define NS_CHROMEREGISTRY_CONTRACTID \ |
|
81 "@mozilla.org/chrome/chrome-registry;1" |
|
82 |
|
83 /** |
|
84 * Chrome registry will notify various caches that all chrome files need |
|
85 * flushing. |
|
86 */ |
|
87 #define NS_CHROME_FLUSH_TOPIC \ |
|
88 "chrome-flush-caches" |
|
89 |
|
90 /** |
|
91 * Chrome registry will notify various caches that skin files need flushing. |
|
92 * If "chrome-flush-caches" is notified, this topic will *not* be notified. |
|
93 */ |
|
94 #define NS_CHROME_FLUSH_SKINS_TOPIC \ |
|
95 "chrome-flush-skin-caches" |
|
96 |
|
97 %} |