Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_dom_StyleSheetList_h
8 : #define mozilla_dom_StyleSheetList_h
9 :
10 : #include "nsIDOMStyleSheetList.h"
11 : #include "nsWrapperCache.h"
12 :
13 : class nsINode;
14 :
15 : namespace mozilla {
16 : class StyleSheet;
17 :
18 : namespace dom {
19 :
20 2 : class StyleSheetList : public nsIDOMStyleSheetList
21 : , public nsWrapperCache
22 : {
23 : public:
24 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25 79 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
26 : NS_DECL_NSIDOMSTYLESHEETLIST
27 :
28 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override final;
29 :
30 : virtual nsINode* GetParentObject() const = 0;
31 :
32 : virtual uint32_t Length() = 0;
33 : virtual StyleSheet* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
34 0 : StyleSheet* Item(uint32_t aIndex)
35 : {
36 0 : bool dummy = false;
37 0 : return IndexedGetter(aIndex, dummy);
38 : }
39 :
40 : protected:
41 0 : virtual ~StyleSheetList() {}
42 : };
43 :
44 : } // namespace dom
45 : } // namespace mozilla
46 :
47 : #endif // mozilla_dom_StyleSheetList_h
|