|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* interface for managing user and user-agent style sheets */ |
|
7 |
|
8 #include "nsISupports.idl" |
|
9 |
|
10 interface nsIURI; |
|
11 |
|
12 /* |
|
13 * nsIStyleSheetService allows extensions or embeddors to add to the |
|
14 * built-in list of user or agent style sheets. |
|
15 */ |
|
16 |
|
17 [scriptable, uuid(1f42a6a2-ab0a-45d4-8a96-396f58ea6c6d)] |
|
18 interface nsIStyleSheetService : nsISupports |
|
19 { |
|
20 const unsigned long AGENT_SHEET = 0; |
|
21 const unsigned long USER_SHEET = 1; |
|
22 const unsigned long AUTHOR_SHEET = 2; |
|
23 |
|
24 /** |
|
25 * Synchronously loads a style sheet from |sheetURI| and adds it to the list |
|
26 * of user or agent style sheets. |
|
27 * |
|
28 * A user sheet loaded via this API will come before userContent.css and |
|
29 * userChrome.css in the cascade (so the rules in it will have lower |
|
30 * precedence than rules in those sheets). |
|
31 * |
|
32 * An agent sheet loaded via this API will come after ua.css in the cascade |
|
33 * (so the rules in it will have higher precedence than rules in ua.css). |
|
34 * |
|
35 * The relative ordering of two user or two agent sheets loaded via |
|
36 * this API is undefined. |
|
37 * |
|
38 * Sheets added via this API take effect on all documents, including |
|
39 * already-loaded ones, immediately. |
|
40 */ |
|
41 void loadAndRegisterSheet(in nsIURI sheetURI, in unsigned long type); |
|
42 |
|
43 /** |
|
44 * Returns true if a style sheet at |sheetURI| has previously been |
|
45 * added to the list of style sheets specified by |type|. |
|
46 */ |
|
47 boolean sheetRegistered(in nsIURI sheetURI, in unsigned long type); |
|
48 |
|
49 /** |
|
50 * Remove the style sheet at |sheetURI| from the list of style sheets |
|
51 * specified by |type|. The removal takes effect immediately, even for |
|
52 * already-loaded documents. |
|
53 */ |
|
54 void unregisterSheet(in nsIURI sheetURI, in unsigned long type); |
|
55 }; |