1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/nsICSSRuleList.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsICSSRuleList_h 1.10 +#define nsICSSRuleList_h 1.11 + 1.12 +#include "nsIDOMCSSRule.h" 1.13 +#include "nsIDOMCSSRuleList.h" 1.14 + 1.15 +// IID for the nsICSSRuleList interface 1.16 +#define NS_ICSSRULELIST_IID \ 1.17 +{ 0xccc0135a, 0xbcb6, 0x4654, \ 1.18 + { 0x8c, 0x78, 0x74, 0x35, 0x97, 0x9b, 0x88, 0x19 } } 1.19 + 1.20 +class nsICSSRuleList : public nsIDOMCSSRuleList 1.21 +{ 1.22 +public: 1.23 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID) 1.24 + 1.25 + NS_IMETHOD 1.26 + GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL 1.27 + { 1.28 + *aLength = Length(); 1.29 + return NS_OK; 1.30 + } 1.31 + NS_IMETHOD 1.32 + Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL 1.33 + { 1.34 + NS_IF_ADDREF(*aReturn = Item(aIndex)); 1.35 + return NS_OK; 1.36 + } 1.37 + 1.38 + // WebIDL API 1.39 + nsIDOMCSSRule* Item(uint32_t aIndex) 1.40 + { 1.41 + bool unused; 1.42 + return IndexedGetter(aIndex, unused); 1.43 + } 1.44 + 1.45 + virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0; 1.46 + virtual uint32_t Length() = 0; 1.47 +}; 1.48 + 1.49 +NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSRuleList, NS_ICSSRULELIST_IID) 1.50 + 1.51 +#endif /* nsICSSRuleList_h */