michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* class for CSS @namespace rules */ michael@0: michael@0: #ifndef mozilla_css_NameSpaceRule_h__ michael@0: #define mozilla_css_NameSpaceRule_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "mozilla/MemoryReporting.h" michael@0: #include "mozilla/css/Rule.h" michael@0: michael@0: #include "nsIDOMCSSRule.h" michael@0: michael@0: class nsIAtom; michael@0: michael@0: // IID for the NameSpaceRule class {f0b0dbe1-5031-4a21-b06a-dc141ef2af98} michael@0: #define NS_CSS_NAMESPACE_RULE_IMPL_CID \ michael@0: {0xf0b0dbe1, 0x5031, 0x4a21, {0xb0, 0x6a, 0xdc, 0x14, 0x1e, 0xf2, 0xaf, 0x98}} michael@0: michael@0: michael@0: namespace mozilla { michael@0: namespace css { michael@0: michael@0: class NameSpaceRule MOZ_FINAL : public Rule, michael@0: public nsIDOMCSSRule michael@0: { michael@0: public: michael@0: NameSpaceRule(nsIAtom* aPrefix, const nsString& aURLSpec); michael@0: private: michael@0: // for |Clone| michael@0: NameSpaceRule(const NameSpaceRule& aCopy); michael@0: ~NameSpaceRule(); michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_NAMESPACE_RULE_IMPL_CID) michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: DECL_STYLE_RULE_INHERIT michael@0: michael@0: // nsIStyleRule methods michael@0: #ifdef DEBUG michael@0: virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE; michael@0: #endif michael@0: michael@0: // Rule methods michael@0: virtual int32_t GetType() const; michael@0: virtual already_AddRefed Clone() const; michael@0: michael@0: nsIAtom* GetPrefix() const { return mPrefix; } michael@0: michael@0: void GetURLSpec(nsString& aURLSpec) const { aURLSpec = mURLSpec; } michael@0: michael@0: virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const michael@0: MOZ_MUST_OVERRIDE; michael@0: michael@0: // nsIDOMCSSRule interface michael@0: NS_DECL_NSIDOMCSSRULE michael@0: michael@0: private: michael@0: nsCOMPtr mPrefix; michael@0: nsString mURLSpec; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(NameSpaceRule, NS_CSS_NAMESPACE_RULE_IMPL_CID) michael@0: michael@0: } // namespace css michael@0: } // namespace mozilla michael@0: michael@0: #endif /* mozilla_css_NameSpaceRule_h__ */