2001-09-25 22:53:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-03-27 23:11:08 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2002-03-14 22:11:14 +00:00
|
|
|
%{C++
|
2014-06-20 10:32:49 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class CSSStyleSheet;
|
|
|
|
} // namespace mozilla
|
2002-03-14 22:11:14 +00:00
|
|
|
%}
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
[ptr] native CSSStyleSheet(mozilla::CSSStyleSheet);
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2002-03-14 22:11:14 +00:00
|
|
|
[scriptable, uuid(4805e682-49b9-11d3-9ce4-ed60bd6cb5bc)]
|
2001-03-27 23:11:08 +00:00
|
|
|
|
|
|
|
interface nsIEditorStyleSheets : nsISupports
|
|
|
|
{
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Load and apply the style sheet, specified by aURL, to the
|
2002-09-13 19:47:38 +00:00
|
|
|
* editor's document, replacing the last style sheet added (if any).
|
2009-08-30 16:29:18 +00:00
|
|
|
* This is always asynchronous, and may cause network I/O.
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be loaded and applied.
|
2001-03-27 23:11:08 +00:00
|
|
|
*/
|
2002-09-13 19:47:38 +00:00
|
|
|
void replaceStyleSheet(in AString aURL);
|
|
|
|
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Add the given style sheet to the editor's document,
|
2002-09-13 19:47:38 +00:00
|
|
|
* on top of any that are already there.
|
2009-08-30 16:29:18 +00:00
|
|
|
* This is always asynchronous, and may cause network I/O.
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be loaded and applied.
|
2002-09-13 19:47:38 +00:00
|
|
|
*/
|
|
|
|
void addStyleSheet(in AString aURL);
|
|
|
|
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Load and apply the override style sheet, specified by aURL, to the
|
|
|
|
* editor's document, replacing the last override style sheet added (if any).
|
|
|
|
* This is always synchronous, so aURL should be a local file with only
|
|
|
|
* local @imports. This action is not undoable. It is not intended for
|
|
|
|
* "user" style sheets, only for editor developers to add sheets to change
|
|
|
|
* display behavior for editing (like showing special cursors) that will
|
|
|
|
* not be affected by loading "document" style sheets with addStyleSheet or
|
|
|
|
* especially replaceStyleSheet.
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be loaded and applied.
|
2002-09-13 19:47:38 +00:00
|
|
|
*/
|
|
|
|
void replaceOverrideStyleSheet(in AString aURL);
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Load and apply an override style sheet, specified by aURL, to
|
2002-09-13 19:47:38 +00:00
|
|
|
* the editor's document, on top of any that are already there.
|
2009-08-30 16:29:18 +00:00
|
|
|
* This is always synchronous, so the same caveats about local files and no
|
|
|
|
* non-local @import as replaceOverrideStyleSheet apply here, too.
|
2001-03-27 23:11:08 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be loaded and applied.
|
2001-03-27 23:11:08 +00:00
|
|
|
*/
|
2002-09-13 19:47:38 +00:00
|
|
|
void addOverrideStyleSheet(in AString aURL);
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Remove the given style sheet from the editor's document
|
2001-03-27 23:11:08 +00:00
|
|
|
* This is always synchronous
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be removed
|
2001-03-27 23:11:08 +00:00
|
|
|
*/
|
2002-09-13 19:47:38 +00:00
|
|
|
void removeStyleSheet(in AString aURL);
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Remove the given override style sheet from the editor's document
|
2001-03-27 23:11:08 +00:00
|
|
|
* This is always synchronous
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be removed.
|
2001-03-27 23:11:08 +00:00
|
|
|
*/
|
2002-09-13 19:47:38 +00:00
|
|
|
void removeOverrideStyleSheet(in AString aURL);
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2009-08-30 16:29:18 +00:00
|
|
|
/** Enable or disable the given style sheet from the editor's document
|
2001-03-27 23:11:08 +00:00
|
|
|
* This is always synchronous
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
2009-08-30 16:29:18 +00:00
|
|
|
* @param aURL The style sheet to be enabled or disabled
|
|
|
|
* @param aEnable true to enable, or false to disable the style sheet
|
2001-03-27 23:11:08 +00:00
|
|
|
*/
|
2011-08-07 05:03:32 +00:00
|
|
|
void enableStyleSheet(in AString aURL, in boolean aEnable);
|
2001-03-27 23:11:08 +00:00
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
/** Get the CSSStyleSheet associated with the given URL.
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
|
|
|
* @param aURL The style sheet's URL
|
|
|
|
* @return the style sheet
|
|
|
|
*/
|
2014-06-20 10:32:49 +00:00
|
|
|
[noscript] CSSStyleSheet getStyleSheetForURL(in AString aURL);
|
2002-09-13 19:47:38 +00:00
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
/** Get the URL associated with the given CSSStyleSheet.
|
2002-09-13 19:47:38 +00:00
|
|
|
*
|
|
|
|
* @param aStyleSheet The style sheet
|
|
|
|
* @return the style sheet's URL
|
|
|
|
*/
|
2014-06-20 10:32:49 +00:00
|
|
|
[noscript] AString getURLForStyleSheet(in CSSStyleSheet aStyleSheet);
|
2001-03-27 23:11:08 +00:00
|
|
|
};
|