2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2006-03-25 05:47:31 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
/* class for CSS @import rules */
|
2006-03-25 05:47:31 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
#ifndef mozilla_css_ImportRule_h__
|
|
|
|
#define mozilla_css_ImportRule_h__
|
1999-06-10 05:32:38 +00:00
|
|
|
|
2011-11-21 06:21:16 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2013-06-23 12:03:39 +00:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2011-04-08 01:23:46 +00:00
|
|
|
#include "mozilla/css/Rule.h"
|
2011-03-17 17:41:52 +00:00
|
|
|
#include "nsIDOMCSSImportRule.h"
|
1999-06-10 05:32:38 +00:00
|
|
|
|
2005-03-30 00:36:57 +00:00
|
|
|
class nsMediaList;
|
2010-05-20 02:28:00 +00:00
|
|
|
class nsString;
|
1999-06-10 05:32:38 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
namespace mozilla {
|
2014-06-20 10:32:49 +00:00
|
|
|
|
|
|
|
class CSSStyleSheet;
|
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
namespace css {
|
2010-05-20 02:28:00 +00:00
|
|
|
|
2011-11-21 06:21:16 +00:00
|
|
|
class ImportRule MOZ_FINAL : public Rule,
|
|
|
|
public nsIDOMCSSImportRule
|
2011-03-17 17:41:52 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-07-14 22:57:54 +00:00
|
|
|
ImportRule(nsMediaList* aMedia, const nsString& aURLSpec,
|
|
|
|
uint32_t aLineNumber, uint32_t aColumnNumber);
|
2011-03-17 17:41:52 +00:00
|
|
|
private:
|
|
|
|
// for |Clone|
|
|
|
|
ImportRule(const ImportRule& aCopy);
|
|
|
|
~ImportRule();
|
1999-06-10 05:32:38 +00:00
|
|
|
public:
|
2014-09-19 01:12:31 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(ImportRule, nsIStyleRule)
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2011-03-17 17:41:52 +00:00
|
|
|
|
|
|
|
DECL_STYLE_RULE_INHERIT
|
|
|
|
|
2010-08-08 05:30:57 +00:00
|
|
|
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
|
2011-03-07 03:59:03 +00:00
|
|
|
using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet
|
2010-08-08 05:30:57 +00:00
|
|
|
#endif
|
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
// nsIStyleRule methods
|
|
|
|
#ifdef DEBUG
|
2013-05-14 16:33:23 +00:00
|
|
|
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
|
2011-03-17 17:41:52 +00:00
|
|
|
#endif
|
|
|
|
|
2011-04-08 01:23:46 +00:00
|
|
|
// Rule methods
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual int32_t GetType() const;
|
2011-04-08 01:23:46 +00:00
|
|
|
virtual already_AddRefed<Rule> Clone() const;
|
2011-03-17 17:41:52 +00:00
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
void SetSheet(CSSStyleSheet*);
|
1999-06-10 05:32:38 +00:00
|
|
|
|
2013-06-23 12:03:39 +00:00
|
|
|
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
2012-01-03 02:19:14 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
// nsIDOMCSSRule interface
|
|
|
|
NS_DECL_NSIDOMCSSRULE
|
1999-06-10 05:32:38 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
// nsIDOMCSSImportRule interface
|
|
|
|
NS_DECL_NSIDOMCSSIMPORTRULE
|
2001-08-04 21:19:53 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
private:
|
|
|
|
nsString mURLSpec;
|
|
|
|
nsRefPtr<nsMediaList> mMedia;
|
2014-06-20 10:32:49 +00:00
|
|
|
nsRefPtr<CSSStyleSheet> mChildSheet;
|
1999-06-10 05:32:38 +00:00
|
|
|
};
|
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
} // namespace css
|
|
|
|
} // namespace mozilla
|
2005-11-11 14:36:26 +00:00
|
|
|
|
2011-03-17 17:41:52 +00:00
|
|
|
#endif /* mozilla_css_ImportRule_h__ */
|