layout/style/NameSpaceRule.h

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:7f2ead02bd9a
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 @namespace rules */
7
8 #ifndef mozilla_css_NameSpaceRule_h__
9 #define mozilla_css_NameSpaceRule_h__
10
11 #include "mozilla/Attributes.h"
12 #include "mozilla/MemoryReporting.h"
13 #include "mozilla/css/Rule.h"
14
15 #include "nsIDOMCSSRule.h"
16
17 class nsIAtom;
18
19 // IID for the NameSpaceRule class {f0b0dbe1-5031-4a21-b06a-dc141ef2af98}
20 #define NS_CSS_NAMESPACE_RULE_IMPL_CID \
21 {0xf0b0dbe1, 0x5031, 0x4a21, {0xb0, 0x6a, 0xdc, 0x14, 0x1e, 0xf2, 0xaf, 0x98}}
22
23
24 namespace mozilla {
25 namespace css {
26
27 class NameSpaceRule MOZ_FINAL : public Rule,
28 public nsIDOMCSSRule
29 {
30 public:
31 NameSpaceRule(nsIAtom* aPrefix, const nsString& aURLSpec);
32 private:
33 // for |Clone|
34 NameSpaceRule(const NameSpaceRule& aCopy);
35 ~NameSpaceRule();
36 public:
37 NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_NAMESPACE_RULE_IMPL_CID)
38
39 NS_DECL_ISUPPORTS
40
41 DECL_STYLE_RULE_INHERIT
42
43 // nsIStyleRule methods
44 #ifdef DEBUG
45 virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
46 #endif
47
48 // Rule methods
49 virtual int32_t GetType() const;
50 virtual already_AddRefed<Rule> Clone() const;
51
52 nsIAtom* GetPrefix() const { return mPrefix; }
53
54 void GetURLSpec(nsString& aURLSpec) const { aURLSpec = mURLSpec; }
55
56 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
57 MOZ_MUST_OVERRIDE;
58
59 // nsIDOMCSSRule interface
60 NS_DECL_NSIDOMCSSRULE
61
62 private:
63 nsCOMPtr<nsIAtom> mPrefix;
64 nsString mURLSpec;
65 };
66
67 NS_DEFINE_STATIC_IID_ACCESSOR(NameSpaceRule, NS_CSS_NAMESPACE_RULE_IMPL_CID)
68
69 } // namespace css
70 } // namespace mozilla
71
72 #endif /* mozilla_css_NameSpaceRule_h__ */

mercurial