michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: /* interface for managing user and user-agent style sheets */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: michael@0: /* michael@0: * nsIStyleSheetService allows extensions or embeddors to add to the michael@0: * built-in list of user or agent style sheets. michael@0: */ michael@0: michael@0: [scriptable, uuid(1f42a6a2-ab0a-45d4-8a96-396f58ea6c6d)] michael@0: interface nsIStyleSheetService : nsISupports michael@0: { michael@0: const unsigned long AGENT_SHEET = 0; michael@0: const unsigned long USER_SHEET = 1; michael@0: const unsigned long AUTHOR_SHEET = 2; michael@0: michael@0: /** michael@0: * Synchronously loads a style sheet from |sheetURI| and adds it to the list michael@0: * of user or agent style sheets. michael@0: * michael@0: * A user sheet loaded via this API will come before userContent.css and michael@0: * userChrome.css in the cascade (so the rules in it will have lower michael@0: * precedence than rules in those sheets). michael@0: * michael@0: * An agent sheet loaded via this API will come after ua.css in the cascade michael@0: * (so the rules in it will have higher precedence than rules in ua.css). michael@0: * michael@0: * The relative ordering of two user or two agent sheets loaded via michael@0: * this API is undefined. michael@0: * michael@0: * Sheets added via this API take effect on all documents, including michael@0: * already-loaded ones, immediately. michael@0: */ michael@0: void loadAndRegisterSheet(in nsIURI sheetURI, in unsigned long type); michael@0: michael@0: /** michael@0: * Returns true if a style sheet at |sheetURI| has previously been michael@0: * added to the list of style sheets specified by |type|. michael@0: */ michael@0: boolean sheetRegistered(in nsIURI sheetURI, in unsigned long type); michael@0: michael@0: /** michael@0: * Remove the style sheet at |sheetURI| from the list of style sheets michael@0: * specified by |type|. The removal takes effect immediately, even for michael@0: * already-loaded documents. michael@0: */ michael@0: void unregisterSheet(in nsIURI sheetURI, in unsigned long type); michael@0: };