2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
/* class for CSS @import rules */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
#ifndef mozilla_css_ImportRule_h__
|
|
|
|
#define mozilla_css_ImportRule_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-11-20 22:21:16 -08:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2011-04-07 18:23:46 -07:00
|
|
|
#include "mozilla/css/Rule.h"
|
2011-03-17 10:41:52 -07:00
|
|
|
#include "nsIDOMCSSImportRule.h"
|
|
|
|
#include "nsCSSRules.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsMediaList;
|
2010-05-19 19:28:00 -07:00
|
|
|
class nsString;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace css {
|
2010-05-19 19:28:00 -07:00
|
|
|
|
2011-11-20 22:21:16 -08:00
|
|
|
class ImportRule MOZ_FINAL : public Rule,
|
|
|
|
public nsIDOMCSSImportRule
|
2011-03-17 10:41:52 -07:00
|
|
|
{
|
|
|
|
public:
|
2011-03-22 22:22:59 -07:00
|
|
|
ImportRule(nsMediaList* aMedia, const nsString& aURLSpec);
|
2011-03-17 10:41:52 -07:00
|
|
|
private:
|
|
|
|
// for |Clone|
|
|
|
|
ImportRule(const ImportRule& aCopy);
|
|
|
|
~ImportRule();
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
2011-03-17 22:18:08 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2011-03-17 10:41:52 -07:00
|
|
|
|
|
|
|
DECL_STYLE_RULE_INHERIT
|
|
|
|
|
2010-08-07 22:30:57 -07:00
|
|
|
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
|
2011-03-06 19:59:03 -08:00
|
|
|
using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet
|
2010-08-07 22:30:57 -07:00
|
|
|
#endif
|
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
// nsIStyleRule methods
|
|
|
|
#ifdef DEBUG
|
|
|
|
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
|
|
|
#endif
|
|
|
|
|
2011-04-07 18:23:46 -07:00
|
|
|
// Rule methods
|
2011-03-17 10:41:52 -07:00
|
|
|
virtual PRInt32 GetType() const;
|
2011-04-07 18:23:46 -07:00
|
|
|
virtual already_AddRefed<Rule> Clone() const;
|
2011-03-17 10:41:52 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
void SetSheet(nsCSSStyleSheet*);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-01-02 18:19:14 -08:00
|
|
|
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
// nsIDOMCSSRule interface
|
|
|
|
NS_DECL_NSIDOMCSSRULE
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
// nsIDOMCSSImportRule interface
|
|
|
|
NS_DECL_NSIDOMCSSIMPORTRULE
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
private:
|
|
|
|
nsString mURLSpec;
|
|
|
|
nsRefPtr<nsMediaList> mMedia;
|
|
|
|
nsRefPtr<nsCSSStyleSheet> mChildSheet;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
} // namespace css
|
|
|
|
} // namespace mozilla
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
#endif /* mozilla_css_ImportRule_h__ */
|