2008-10-22 07:31:14 -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-07-08 23:19:27 -07:00
|
|
|
|
2014-06-09 19:11:00 -07:00
|
|
|
#ifndef mozilla_dom_CSSRuleList_h
|
|
|
|
#define mozilla_dom_CSSRuleList_h
|
2007-07-08 23:19:27 -07:00
|
|
|
|
2013-07-24 00:27:17 -07:00
|
|
|
#include "nsIDOMCSSRule.h"
|
2008-10-22 07:31:14 -07:00
|
|
|
#include "nsIDOMCSSRuleList.h"
|
2014-05-03 00:32:54 -07:00
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
2014-06-20 04:00:08 -07:00
|
|
|
namespace mozilla {
|
2014-06-20 03:32:49 -07:00
|
|
|
class CSSStyleSheet;
|
|
|
|
|
2014-06-09 19:11:00 -07:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
// IID for the CSSRuleList interface
|
2008-10-22 07:31:14 -07:00
|
|
|
#define NS_ICSSRULELIST_IID \
|
2014-05-03 00:32:54 -07:00
|
|
|
{ 0x56ac8d1c, 0xc1ed, 0x45fe, \
|
|
|
|
{ 0x9a, 0x4d, 0x3a, 0xdc, 0xf9, 0xd1, 0xb9, 0x3f } }
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2014-06-09 19:11:00 -07:00
|
|
|
class CSSRuleList : public nsIDOMCSSRuleList
|
|
|
|
, public nsWrapperCache
|
2007-07-08 23:19:27 -07:00
|
|
|
{
|
2008-10-22 07:31:14 -07:00
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
|
|
|
|
|
2014-05-03 00:32:54 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2014-06-09 19:11:00 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
|
2014-05-03 00:32:54 -07:00
|
|
|
|
2014-06-20 03:32:49 -07:00
|
|
|
virtual CSSStyleSheet* GetParentObject() = 0;
|
2014-05-03 00:32:54 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL;
|
|
|
|
|
2013-07-24 00:27:17 -07:00
|
|
|
NS_IMETHOD
|
|
|
|
GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
*aLength = Length();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
NS_IMETHOD
|
|
|
|
Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
NS_IF_ADDREF(*aReturn = Item(aIndex));
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// WebIDL API
|
|
|
|
nsIDOMCSSRule* Item(uint32_t aIndex)
|
|
|
|
{
|
|
|
|
bool unused;
|
|
|
|
return IndexedGetter(aIndex, unused);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
|
|
|
|
virtual uint32_t Length() = 0;
|
2014-06-23 15:40:01 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~CSSRuleList() {}
|
2007-07-08 23:19:27 -07:00
|
|
|
};
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2014-06-09 19:11:00 -07:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2014-06-09 19:11:00 -07:00
|
|
|
#endif /* mozilla_dom_CSSRuleList_h */
|