content/base/public/nsIStyleSheetLinkingElement.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/public/nsIStyleSheetLinkingElement.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,101 @@
     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 +#ifndef nsIStyleSheetLinkingElement_h__
     1.9 +#define nsIStyleSheetLinkingElement_h__
    1.10 +
    1.11 +
    1.12 +#include "nsISupports.h"
    1.13 +
    1.14 +class nsICSSLoaderObserver;
    1.15 +class nsIURI;
    1.16 +
    1.17 +#define NS_ISTYLESHEETLINKINGELEMENT_IID          \
    1.18 +{ 0xd753c84a, 0x17fd, 0x4d5f, \
    1.19 + { 0xb2, 0xe9, 0x63, 0x52, 0x8c, 0x87, 0x99, 0x7a } }
    1.20 +
    1.21 +class nsIStyleSheet;
    1.22 +class nsCSSStyleSheet;
    1.23 +
    1.24 +class nsIStyleSheetLinkingElement : public nsISupports {
    1.25 +public:
    1.26 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLESHEETLINKINGELEMENT_IID)
    1.27 +
    1.28 +  /**
    1.29 +   * Used to make the association between a style sheet and
    1.30 +   * the element that linked it to the document.
    1.31 +   *
    1.32 +   * @param aStyleSheet the style sheet associated with this
    1.33 +   *                    element.
    1.34 +   */
    1.35 +  NS_IMETHOD SetStyleSheet(nsCSSStyleSheet* aStyleSheet) = 0;
    1.36 +
    1.37 +  /**
    1.38 +   * Used to obtain the style sheet linked in by this element.
    1.39 +   *
    1.40 +   * @param aStyleSheet out parameter that returns the style
    1.41 +   *                    sheet associated with this element.
    1.42 +   */
    1.43 +  NS_IMETHOD GetStyleSheet(nsIStyleSheet*& aStyleSheet) = 0;
    1.44 +
    1.45 +  /**
    1.46 +   * Initialize the stylesheet linking element. If aDontLoadStyle is
    1.47 +   * true the element will ignore the first modification to the
    1.48 +   * element that would cause a stylesheet to be loaded. Subsequent
    1.49 +   * modifications to the element will not be ignored.
    1.50 +   */
    1.51 +  NS_IMETHOD InitStyleLinkElement(bool aDontLoadStyle) = 0;
    1.52 +
    1.53 +  /**
    1.54 +   * Tells this element to update the stylesheet.
    1.55 +   *
    1.56 +   * @param aObserver    observer to notify once the stylesheet is loaded.
    1.57 +   *                     This will be passed to the CSSLoader
    1.58 +   * @param [out] aWillNotify whether aObserver will be notified when the sheet
    1.59 +   *                          loads.  If this is false, then either we didn't
    1.60 +   *                          start the sheet load at all, the load failed, or
    1.61 +   *                          this was an inline sheet that completely finished
    1.62 +   *                          loading.  In the case when the load failed the
    1.63 +   *                          failure code will be returned.
    1.64 +   * @param [out] whether the sheet is an alternate sheet.  This value is only
    1.65 +   *              meaningful if aWillNotify is true.
    1.66 +   */
    1.67 +  NS_IMETHOD UpdateStyleSheet(nsICSSLoaderObserver* aObserver,
    1.68 +                              bool *aWillNotify,
    1.69 +                              bool *aIsAlternate) = 0;
    1.70 +
    1.71 +  /**
    1.72 +   * Tells this element whether to update the stylesheet when the
    1.73 +   * element's properties change.
    1.74 +   *
    1.75 +   * @param aEnableUpdates update on changes or not.
    1.76 +   */
    1.77 +  NS_IMETHOD SetEnableUpdates(bool aEnableUpdates) = 0;
    1.78 +
    1.79 +  /**
    1.80 +   * Gets the charset that the element claims the style sheet is in
    1.81 +   *
    1.82 +   * @param aCharset the charset
    1.83 +   */
    1.84 +  NS_IMETHOD GetCharset(nsAString& aCharset) = 0;
    1.85 +
    1.86 +  /**
    1.87 +   * Tells this element to use a different base URI. This is used for
    1.88 +   * proper loading of xml-stylesheet processing instructions in XUL overlays
    1.89 +   * and is only currently used by nsXMLStylesheetPI.
    1.90 +   *
    1.91 +   * @param aNewBaseURI the new base URI, nullptr to use the default base URI.
    1.92 +   */
    1.93 +  virtual void OverrideBaseURI(nsIURI* aNewBaseURI) = 0;
    1.94 +
    1.95 +  // This doesn't entirely belong here since they only make sense for
    1.96 +  // some types of linking elements, but it's a better place than
    1.97 +  // anywhere else.
    1.98 +  virtual void SetLineNumber(uint32_t aLineNumber) = 0;
    1.99 +};
   1.100 +
   1.101 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleSheetLinkingElement,
   1.102 +                              NS_ISTYLESHEETLINKINGELEMENT_IID)
   1.103 +
   1.104 +#endif // nsILinkingElement_h__

mercurial