Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / dom / base / nsINodeList.h
blob329c06df9b94b7660d063949461f56d7fa22a806
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/. */
7 #ifndef nsINodeList_h___
8 #define nsINodeList_h___
10 #include "nsWrapperCache.h"
11 #include "nsISupports.h"
12 #include "nsIContent.h"
14 // IID for the nsINodeList interface
15 #define NS_INODELIST_IID \
16 { \
17 0xadb5e54c, 0x6e96, 0x4102, { \
18 0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a \
19 } \
22 class nsIContent;
23 class nsINode;
25 /**
26 * An internal interface for a reasonably fast indexOf.
28 class nsINodeList : public nsISupports, public nsWrapperCache {
29 public:
30 NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODELIST_IID)
32 /**
33 * Get the index of the given node in the list. Will return -1 if the node
34 * is not in the list.
36 virtual int32_t IndexOf(nsIContent* aContent) = 0;
38 /**
39 * Get the root node for this nodelist.
41 virtual nsINode* GetParentObject() = 0;
43 virtual uint32_t Length() = 0;
44 virtual nsIContent* Item(uint32_t aIndex) = 0;
45 nsIContent* IndexedGetter(uint32_t aIndex, bool& aFound) {
46 nsIContent* item = Item(aIndex);
47 aFound = !!item;
48 return item;
52 NS_DEFINE_STATIC_IID_ACCESSOR(nsINodeList, NS_INODELIST_IID)
54 #endif /* nsINodeList_h___ */