1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_CSSRuleList_h
7 #define mozilla_dom_CSSRuleList_h
9 #include "nsIDOMCSSRule.h"
10 #include "nsIDOMCSSRuleList.h"
11 #include "nsWrapperCache.h"
18 // IID for the CSSRuleList interface
19 #define NS_ICSSRULELIST_IID \
20 { 0x56ac8d1c, 0xc1ed, 0x45fe, \
21 { 0x9a, 0x4d, 0x3a, 0xdc, 0xf9, 0xd1, 0xb9, 0x3f } }
23 class CSSRuleList
: public nsIDOMCSSRuleList
24 , public nsWrapperCache
27 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID
)
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList
)
32 virtual CSSStyleSheet
* GetParentObject() = 0;
33 virtual JSObject
* WrapObject(JSContext
* aCx
) MOZ_OVERRIDE MOZ_FINAL
;
36 GetLength(uint32_t* aLength
) MOZ_OVERRIDE MOZ_FINAL
42 Item(uint32_t aIndex
, nsIDOMCSSRule
** aReturn
) MOZ_OVERRIDE MOZ_FINAL
44 NS_IF_ADDREF(*aReturn
= Item(aIndex
));
49 nsIDOMCSSRule
* Item(uint32_t aIndex
)
52 return IndexedGetter(aIndex
, unused
);
55 virtual nsIDOMCSSRule
* IndexedGetter(uint32_t aIndex
, bool& aFound
) = 0;
56 virtual uint32_t Length() = 0;
59 virtual ~CSSRuleList() {}
62 NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList
, NS_ICSSRULELIST_IID
)
65 } // namespace mozilla
67 #endif /* mozilla_dom_CSSRuleList_h */