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 @import rules */ michael@0: michael@0: #ifndef mozilla_css_ImportRule_h__ michael@0: #define mozilla_css_ImportRule_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #include "mozilla/MemoryReporting.h" michael@0: #include "mozilla/css/Rule.h" michael@0: #include "nsIDOMCSSImportRule.h" michael@0: #include "nsCSSRules.h" michael@0: michael@0: class nsMediaList; michael@0: class nsString; michael@0: michael@0: namespace mozilla { michael@0: namespace css { michael@0: michael@0: class ImportRule MOZ_FINAL : public Rule, michael@0: public nsIDOMCSSImportRule michael@0: { michael@0: public: michael@0: ImportRule(nsMediaList* aMedia, const nsString& aURLSpec); michael@0: private: michael@0: // for |Clone| michael@0: ImportRule(const ImportRule& aCopy); michael@0: ~ImportRule(); michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: DECL_STYLE_RULE_INHERIT michael@0: michael@0: #ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING michael@0: using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet michael@0: #endif 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: void SetSheet(nsCSSStyleSheet*); michael@0: michael@0: virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; michael@0: michael@0: // nsIDOMCSSRule interface michael@0: NS_DECL_NSIDOMCSSRULE michael@0: michael@0: // nsIDOMCSSImportRule interface michael@0: NS_DECL_NSIDOMCSSIMPORTRULE michael@0: michael@0: private: michael@0: nsString mURLSpec; michael@0: nsRefPtr mMedia; michael@0: nsRefPtr mChildSheet; michael@0: }; michael@0: michael@0: } // namespace css michael@0: } // namespace mozilla michael@0: michael@0: #endif /* mozilla_css_ImportRule_h__ */