Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | #ifndef nsIStyleSheetLinkingElement_h__ |
michael@0 | 6 | #define nsIStyleSheetLinkingElement_h__ |
michael@0 | 7 | |
michael@0 | 8 | |
michael@0 | 9 | #include "nsISupports.h" |
michael@0 | 10 | |
michael@0 | 11 | class nsICSSLoaderObserver; |
michael@0 | 12 | class nsIURI; |
michael@0 | 13 | |
michael@0 | 14 | #define NS_ISTYLESHEETLINKINGELEMENT_IID \ |
michael@0 | 15 | { 0xd753c84a, 0x17fd, 0x4d5f, \ |
michael@0 | 16 | { 0xb2, 0xe9, 0x63, 0x52, 0x8c, 0x87, 0x99, 0x7a } } |
michael@0 | 17 | |
michael@0 | 18 | class nsIStyleSheet; |
michael@0 | 19 | class nsCSSStyleSheet; |
michael@0 | 20 | |
michael@0 | 21 | class nsIStyleSheetLinkingElement : public nsISupports { |
michael@0 | 22 | public: |
michael@0 | 23 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLESHEETLINKINGELEMENT_IID) |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Used to make the association between a style sheet and |
michael@0 | 27 | * the element that linked it to the document. |
michael@0 | 28 | * |
michael@0 | 29 | * @param aStyleSheet the style sheet associated with this |
michael@0 | 30 | * element. |
michael@0 | 31 | */ |
michael@0 | 32 | NS_IMETHOD SetStyleSheet(nsCSSStyleSheet* aStyleSheet) = 0; |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | * Used to obtain the style sheet linked in by this element. |
michael@0 | 36 | * |
michael@0 | 37 | * @param aStyleSheet out parameter that returns the style |
michael@0 | 38 | * sheet associated with this element. |
michael@0 | 39 | */ |
michael@0 | 40 | NS_IMETHOD GetStyleSheet(nsIStyleSheet*& aStyleSheet) = 0; |
michael@0 | 41 | |
michael@0 | 42 | /** |
michael@0 | 43 | * Initialize the stylesheet linking element. If aDontLoadStyle is |
michael@0 | 44 | * true the element will ignore the first modification to the |
michael@0 | 45 | * element that would cause a stylesheet to be loaded. Subsequent |
michael@0 | 46 | * modifications to the element will not be ignored. |
michael@0 | 47 | */ |
michael@0 | 48 | NS_IMETHOD InitStyleLinkElement(bool aDontLoadStyle) = 0; |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * Tells this element to update the stylesheet. |
michael@0 | 52 | * |
michael@0 | 53 | * @param aObserver observer to notify once the stylesheet is loaded. |
michael@0 | 54 | * This will be passed to the CSSLoader |
michael@0 | 55 | * @param [out] aWillNotify whether aObserver will be notified when the sheet |
michael@0 | 56 | * loads. If this is false, then either we didn't |
michael@0 | 57 | * start the sheet load at all, the load failed, or |
michael@0 | 58 | * this was an inline sheet that completely finished |
michael@0 | 59 | * loading. In the case when the load failed the |
michael@0 | 60 | * failure code will be returned. |
michael@0 | 61 | * @param [out] whether the sheet is an alternate sheet. This value is only |
michael@0 | 62 | * meaningful if aWillNotify is true. |
michael@0 | 63 | */ |
michael@0 | 64 | NS_IMETHOD UpdateStyleSheet(nsICSSLoaderObserver* aObserver, |
michael@0 | 65 | bool *aWillNotify, |
michael@0 | 66 | bool *aIsAlternate) = 0; |
michael@0 | 67 | |
michael@0 | 68 | /** |
michael@0 | 69 | * Tells this element whether to update the stylesheet when the |
michael@0 | 70 | * element's properties change. |
michael@0 | 71 | * |
michael@0 | 72 | * @param aEnableUpdates update on changes or not. |
michael@0 | 73 | */ |
michael@0 | 74 | NS_IMETHOD SetEnableUpdates(bool aEnableUpdates) = 0; |
michael@0 | 75 | |
michael@0 | 76 | /** |
michael@0 | 77 | * Gets the charset that the element claims the style sheet is in |
michael@0 | 78 | * |
michael@0 | 79 | * @param aCharset the charset |
michael@0 | 80 | */ |
michael@0 | 81 | NS_IMETHOD GetCharset(nsAString& aCharset) = 0; |
michael@0 | 82 | |
michael@0 | 83 | /** |
michael@0 | 84 | * Tells this element to use a different base URI. This is used for |
michael@0 | 85 | * proper loading of xml-stylesheet processing instructions in XUL overlays |
michael@0 | 86 | * and is only currently used by nsXMLStylesheetPI. |
michael@0 | 87 | * |
michael@0 | 88 | * @param aNewBaseURI the new base URI, nullptr to use the default base URI. |
michael@0 | 89 | */ |
michael@0 | 90 | virtual void OverrideBaseURI(nsIURI* aNewBaseURI) = 0; |
michael@0 | 91 | |
michael@0 | 92 | // This doesn't entirely belong here since they only make sense for |
michael@0 | 93 | // some types of linking elements, but it's a better place than |
michael@0 | 94 | // anywhere else. |
michael@0 | 95 | virtual void SetLineNumber(uint32_t aLineNumber) = 0; |
michael@0 | 96 | }; |
michael@0 | 97 | |
michael@0 | 98 | NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleSheetLinkingElement, |
michael@0 | 99 | NS_ISTYLESHEETLINKINGELEMENT_IID) |
michael@0 | 100 | |
michael@0 | 101 | #endif // nsILinkingElement_h__ |