|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* class for CSS @import rules */ |
|
7 |
|
8 #ifndef mozilla_css_ImportRule_h__ |
|
9 #define mozilla_css_ImportRule_h__ |
|
10 |
|
11 #include "mozilla/Attributes.h" |
|
12 |
|
13 #include "mozilla/MemoryReporting.h" |
|
14 #include "mozilla/css/Rule.h" |
|
15 #include "nsIDOMCSSImportRule.h" |
|
16 #include "nsCSSRules.h" |
|
17 |
|
18 class nsMediaList; |
|
19 class nsString; |
|
20 |
|
21 namespace mozilla { |
|
22 namespace css { |
|
23 |
|
24 class ImportRule MOZ_FINAL : public Rule, |
|
25 public nsIDOMCSSImportRule |
|
26 { |
|
27 public: |
|
28 ImportRule(nsMediaList* aMedia, const nsString& aURLSpec); |
|
29 private: |
|
30 // for |Clone| |
|
31 ImportRule(const ImportRule& aCopy); |
|
32 ~ImportRule(); |
|
33 public: |
|
34 NS_DECL_ISUPPORTS |
|
35 |
|
36 DECL_STYLE_RULE_INHERIT |
|
37 |
|
38 #ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING |
|
39 using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet |
|
40 #endif |
|
41 |
|
42 // nsIStyleRule methods |
|
43 #ifdef DEBUG |
|
44 virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE; |
|
45 #endif |
|
46 |
|
47 // Rule methods |
|
48 virtual int32_t GetType() const; |
|
49 virtual already_AddRefed<Rule> Clone() const; |
|
50 |
|
51 void SetSheet(nsCSSStyleSheet*); |
|
52 |
|
53 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; |
|
54 |
|
55 // nsIDOMCSSRule interface |
|
56 NS_DECL_NSIDOMCSSRULE |
|
57 |
|
58 // nsIDOMCSSImportRule interface |
|
59 NS_DECL_NSIDOMCSSIMPORTRULE |
|
60 |
|
61 private: |
|
62 nsString mURLSpec; |
|
63 nsRefPtr<nsMediaList> mMedia; |
|
64 nsRefPtr<nsCSSStyleSheet> mChildSheet; |
|
65 }; |
|
66 |
|
67 } // namespace css |
|
68 } // namespace mozilla |
|
69 |
|
70 #endif /* mozilla_css_ImportRule_h__ */ |