1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/idl/nsIEditorStyleSheets.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,91 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +%{C++ 1.12 +class nsCSSStyleSheet; 1.13 +%} 1.14 + 1.15 +[ptr] native nsCSSStyleSheet(nsCSSStyleSheet); 1.16 + 1.17 +[scriptable, uuid(4805e682-49b9-11d3-9ce4-ed60bd6cb5bc)] 1.18 + 1.19 +interface nsIEditorStyleSheets : nsISupports 1.20 +{ 1.21 + /** Load and apply the style sheet, specified by aURL, to the 1.22 + * editor's document, replacing the last style sheet added (if any). 1.23 + * This is always asynchronous, and may cause network I/O. 1.24 + * 1.25 + * @param aURL The style sheet to be loaded and applied. 1.26 + */ 1.27 + void replaceStyleSheet(in AString aURL); 1.28 + 1.29 + /** Add the given style sheet to the editor's document, 1.30 + * on top of any that are already there. 1.31 + * This is always asynchronous, and may cause network I/O. 1.32 + * 1.33 + * @param aURL The style sheet to be loaded and applied. 1.34 + */ 1.35 + void addStyleSheet(in AString aURL); 1.36 + 1.37 + /** Load and apply the override style sheet, specified by aURL, to the 1.38 + * editor's document, replacing the last override style sheet added (if any). 1.39 + * This is always synchronous, so aURL should be a local file with only 1.40 + * local @imports. This action is not undoable. It is not intended for 1.41 + * "user" style sheets, only for editor developers to add sheets to change 1.42 + * display behavior for editing (like showing special cursors) that will 1.43 + * not be affected by loading "document" style sheets with addStyleSheet or 1.44 + * especially replaceStyleSheet. 1.45 + * 1.46 + * @param aURL The style sheet to be loaded and applied. 1.47 + */ 1.48 + void replaceOverrideStyleSheet(in AString aURL); 1.49 + 1.50 + /** Load and apply an override style sheet, specified by aURL, to 1.51 + * the editor's document, on top of any that are already there. 1.52 + * This is always synchronous, so the same caveats about local files and no 1.53 + * non-local @import as replaceOverrideStyleSheet apply here, too. 1.54 + * 1.55 + * @param aURL The style sheet to be loaded and applied. 1.56 + */ 1.57 + void addOverrideStyleSheet(in AString aURL); 1.58 + 1.59 + /** Remove the given style sheet from the editor's document 1.60 + * This is always synchronous 1.61 + * 1.62 + * @param aURL The style sheet to be removed 1.63 + */ 1.64 + void removeStyleSheet(in AString aURL); 1.65 + 1.66 + /** Remove the given override style sheet from the editor's document 1.67 + * This is always synchronous 1.68 + * 1.69 + * @param aURL The style sheet to be removed. 1.70 + */ 1.71 + void removeOverrideStyleSheet(in AString aURL); 1.72 + 1.73 + /** Enable or disable the given style sheet from the editor's document 1.74 + * This is always synchronous 1.75 + * 1.76 + * @param aURL The style sheet to be enabled or disabled 1.77 + * @param aEnable true to enable, or false to disable the style sheet 1.78 + */ 1.79 + void enableStyleSheet(in AString aURL, in boolean aEnable); 1.80 + 1.81 + /** Get the nsCSSStyleSheet associated with the given URL. 1.82 + * 1.83 + * @param aURL The style sheet's URL 1.84 + * @return the style sheet 1.85 + */ 1.86 + [noscript] nsCSSStyleSheet getStyleSheetForURL(in AString aURL); 1.87 + 1.88 + /** Get the URL associated with the given nsCSSStyleSheet. 1.89 + * 1.90 + * @param aStyleSheet The style sheet 1.91 + * @return the style sheet's URL 1.92 + */ 1.93 + [noscript] AString getURLForStyleSheet(in nsCSSStyleSheet aStyleSheet); 1.94 +};