michael@0: /* -*- Mode: C++; 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: #include "nsISupports.idl" michael@0: michael@0: %{C++ michael@0: class nsCSSStyleSheet; michael@0: %} michael@0: michael@0: [ptr] native nsCSSStyleSheet(nsCSSStyleSheet); michael@0: michael@0: [scriptable, uuid(4805e682-49b9-11d3-9ce4-ed60bd6cb5bc)] michael@0: michael@0: interface nsIEditorStyleSheets : nsISupports michael@0: { michael@0: /** Load and apply the style sheet, specified by aURL, to the michael@0: * editor's document, replacing the last style sheet added (if any). michael@0: * This is always asynchronous, and may cause network I/O. michael@0: * michael@0: * @param aURL The style sheet to be loaded and applied. michael@0: */ michael@0: void replaceStyleSheet(in AString aURL); michael@0: michael@0: /** Add the given style sheet to the editor's document, michael@0: * on top of any that are already there. michael@0: * This is always asynchronous, and may cause network I/O. michael@0: * michael@0: * @param aURL The style sheet to be loaded and applied. michael@0: */ michael@0: void addStyleSheet(in AString aURL); michael@0: michael@0: /** Load and apply the override style sheet, specified by aURL, to the michael@0: * editor's document, replacing the last override style sheet added (if any). michael@0: * This is always synchronous, so aURL should be a local file with only michael@0: * local @imports. This action is not undoable. It is not intended for michael@0: * "user" style sheets, only for editor developers to add sheets to change michael@0: * display behavior for editing (like showing special cursors) that will michael@0: * not be affected by loading "document" style sheets with addStyleSheet or michael@0: * especially replaceStyleSheet. michael@0: * michael@0: * @param aURL The style sheet to be loaded and applied. michael@0: */ michael@0: void replaceOverrideStyleSheet(in AString aURL); michael@0: michael@0: /** Load and apply an override style sheet, specified by aURL, to michael@0: * the editor's document, on top of any that are already there. michael@0: * This is always synchronous, so the same caveats about local files and no michael@0: * non-local @import as replaceOverrideStyleSheet apply here, too. michael@0: * michael@0: * @param aURL The style sheet to be loaded and applied. michael@0: */ michael@0: void addOverrideStyleSheet(in AString aURL); michael@0: michael@0: /** Remove the given style sheet from the editor's document michael@0: * This is always synchronous michael@0: * michael@0: * @param aURL The style sheet to be removed michael@0: */ michael@0: void removeStyleSheet(in AString aURL); michael@0: michael@0: /** Remove the given override style sheet from the editor's document michael@0: * This is always synchronous michael@0: * michael@0: * @param aURL The style sheet to be removed. michael@0: */ michael@0: void removeOverrideStyleSheet(in AString aURL); michael@0: michael@0: /** Enable or disable the given style sheet from the editor's document michael@0: * This is always synchronous michael@0: * michael@0: * @param aURL The style sheet to be enabled or disabled michael@0: * @param aEnable true to enable, or false to disable the style sheet michael@0: */ michael@0: void enableStyleSheet(in AString aURL, in boolean aEnable); michael@0: michael@0: /** Get the nsCSSStyleSheet associated with the given URL. michael@0: * michael@0: * @param aURL The style sheet's URL michael@0: * @return the style sheet michael@0: */ michael@0: [noscript] nsCSSStyleSheet getStyleSheetForURL(in AString aURL); michael@0: michael@0: /** Get the URL associated with the given nsCSSStyleSheet. michael@0: * michael@0: * @param aStyleSheet The style sheet michael@0: * @return the style sheet's URL michael@0: */ michael@0: [noscript] AString getURLForStyleSheet(in nsCSSStyleSheet aStyleSheet); michael@0: };