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