michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsICSSRuleList_h michael@0: #define nsICSSRuleList_h michael@0: michael@0: #include "nsIDOMCSSRule.h" michael@0: #include "nsIDOMCSSRuleList.h" michael@0: michael@0: // IID for the nsICSSRuleList interface michael@0: #define NS_ICSSRULELIST_IID \ michael@0: { 0xccc0135a, 0xbcb6, 0x4654, \ michael@0: { 0x8c, 0x78, 0x74, 0x35, 0x97, 0x9b, 0x88, 0x19 } } michael@0: michael@0: class nsICSSRuleList : public nsIDOMCSSRuleList michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID) michael@0: michael@0: NS_IMETHOD michael@0: GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL michael@0: { michael@0: *aLength = Length(); michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHOD michael@0: Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL michael@0: { michael@0: NS_IF_ADDREF(*aReturn = Item(aIndex)); michael@0: return NS_OK; michael@0: } michael@0: michael@0: // WebIDL API michael@0: nsIDOMCSSRule* Item(uint32_t aIndex) michael@0: { michael@0: bool unused; michael@0: return IndexedGetter(aIndex, unused); michael@0: } michael@0: michael@0: virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0; michael@0: virtual uint32_t Length() = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSRuleList, NS_ICSSRULELIST_IID) michael@0: michael@0: #endif /* nsICSSRuleList_h */