layout/style/nsIStyleSheet.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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
michael@0 6 /*
michael@0 7 * interface representing a collection of style data attached to a
michael@0 8 * document, which may be or be combined into a style rule processor
michael@0 9 */
michael@0 10
michael@0 11 #ifndef nsIStyleSheet_h___
michael@0 12 #define nsIStyleSheet_h___
michael@0 13
michael@0 14 #include "mozilla/MemoryReporting.h"
michael@0 15 #include <stdio.h>
michael@0 16 #include "nsISupports.h"
michael@0 17
michael@0 18 class nsString;
michael@0 19 class nsIURI;
michael@0 20 class nsIDocument;
michael@0 21
michael@0 22 // IID for the nsIStyleSheet interface
michael@0 23 // 3eb34a60-04bd-41d9-9f60-882694e61c38
michael@0 24 #define NS_ISTYLE_SHEET_IID \
michael@0 25 { 0x3eb34a60, 0x04bd, 0x41d9, \
michael@0 26 { 0x9f, 0x60, 0x88, 0x26, 0x94, 0xe6, 0x1c, 0x38 } }
michael@0 27
michael@0 28 /**
michael@0 29 * A style sheet is a thing associated with a document that has style
michael@0 30 * rules. Those style rules can be reached in one of two ways, depending
michael@0 31 * on which level of the nsStyleSet it is in:
michael@0 32 * 1) It can be |QueryInterface|d to nsIStyleRuleProcessor
michael@0 33 * 2) It can be |QueryInterface|d to nsCSSStyleSheet, with which the
michael@0 34 * |nsStyleSet| uses an |nsCSSRuleProcessor| to access the rules.
michael@0 35 */
michael@0 36 class nsIStyleSheet : public nsISupports {
michael@0 37 public:
michael@0 38 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLE_SHEET_IID)
michael@0 39
michael@0 40 // basic style sheet data
michael@0 41 virtual nsIURI* GetSheetURI() const = 0;
michael@0 42 virtual nsIURI* GetBaseURI() const = 0;
michael@0 43 virtual void GetTitle(nsString& aTitle) const = 0;
michael@0 44 virtual void GetType(nsString& aType) const = 0;
michael@0 45 virtual bool HasRules() const = 0;
michael@0 46
michael@0 47 /**
michael@0 48 * Whether the sheet is applicable. A sheet that is not applicable
michael@0 49 * should never be inserted into a style set. A sheet may not be
michael@0 50 * applicable for a variety of reasons including being disabled and
michael@0 51 * being incomplete.
michael@0 52 *
michael@0 53 */
michael@0 54 virtual bool IsApplicable() const = 0;
michael@0 55
michael@0 56 /**
michael@0 57 * Set the stylesheet to be enabled. This may or may not make it
michael@0 58 * applicable. Note that this WILL inform the sheet's document of
michael@0 59 * its new applicable state if the state changes but WILL NOT call
michael@0 60 * BeginUpdate() or EndUpdate() on the document -- calling those is
michael@0 61 * the caller's responsibility. This allows use of SetEnabled when
michael@0 62 * batched updates are desired. If you want updates handled for
michael@0 63 * you, see nsIDOMStyleSheet::SetDisabled().
michael@0 64 */
michael@0 65 virtual void SetEnabled(bool aEnabled) = 0;
michael@0 66
michael@0 67 /**
michael@0 68 * Whether the sheet is complete.
michael@0 69 */
michael@0 70 virtual bool IsComplete() const = 0;
michael@0 71 virtual void SetComplete() = 0;
michael@0 72
michael@0 73 // style sheet owner info
michael@0 74 virtual nsIStyleSheet* GetParentSheet() const = 0; // may be null
michael@0 75 virtual nsIDocument* GetOwningDocument() const = 0; // may be null
michael@0 76 virtual void SetOwningDocument(nsIDocument* aDocument) = 0;
michael@0 77
michael@0 78 #ifdef DEBUG
michael@0 79 virtual void List(FILE* out = stdout, int32_t aIndent = 0) const = 0;
michael@0 80 #endif
michael@0 81
michael@0 82 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
michael@0 83 };
michael@0 84
michael@0 85 NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleSheet, NS_ISTYLE_SHEET_IID)
michael@0 86
michael@0 87 #endif /* nsIStyleSheet_h___ */

mercurial