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
32 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID
)
34 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
35 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList
)
37 virtual CSSStyleSheet
* GetParentObject() = 0;
38 virtual JSObject
* WrapObject(JSContext
* aCx
) MOZ_OVERRIDE MOZ_FINAL
;
41 GetLength(uint32_t* aLength
) MOZ_OVERRIDE MOZ_FINAL
47 Item(uint32_t aIndex
, nsIDOMCSSRule
** aReturn
) MOZ_OVERRIDE MOZ_FINAL
49 NS_IF_ADDREF(*aReturn
= Item(aIndex
));
54 nsIDOMCSSRule
* Item(uint32_t aIndex
)
57 return IndexedGetter(aIndex
, unused
);
60 virtual nsIDOMCSSRule
* IndexedGetter(uint32_t aIndex
, bool& aFound
) = 0;
61 virtual uint32_t Length() = 0;
64 virtual ~CSSRuleList() {}
67 NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList
, NS_ICSSRULELIST_IID
)
70 } // namespace mozilla
72 #endif /* mozilla_dom_CSSRuleList_h */