2008-09-10 20:15:29 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-09-10 20:15:29 -07:00
|
|
|
|
|
|
|
#ifndef nsINodeList_h___
|
|
|
|
#define nsINodeList_h___
|
|
|
|
|
2009-01-02 09:00:18 -08:00
|
|
|
#include "nsIDOMNodeList.h"
|
2009-06-15 23:32:10 -07:00
|
|
|
#include "nsWrapperCache.h"
|
2009-01-02 09:00:18 -08:00
|
|
|
|
2009-06-15 23:32:10 -07:00
|
|
|
class nsINode;
|
2009-01-29 11:46:18 -08:00
|
|
|
class nsIContent;
|
2008-09-10 20:15:29 -07:00
|
|
|
|
|
|
|
// IID for the nsINodeList interface
|
|
|
|
#define NS_INODELIST_IID \
|
2011-08-20 06:53:33 -07:00
|
|
|
{ 0xe60b773e, 0x5d20, 0x43f6, \
|
|
|
|
{ 0xb0, 0x8c, 0xfd, 0x65, 0x26, 0xce, 0xe0, 0x7a } }
|
2008-09-10 20:15:29 -07:00
|
|
|
|
|
|
|
/**
|
2011-08-20 06:53:33 -07:00
|
|
|
* An internal interface for a reasonably fast indexOf.
|
2008-09-10 20:15:29 -07:00
|
|
|
*/
|
2009-06-15 23:32:10 -07:00
|
|
|
class nsINodeList : public nsIDOMNodeList,
|
|
|
|
public nsWrapperCache
|
2008-10-22 07:31:14 -07:00
|
|
|
{
|
2008-09-10 20:15:29 -07:00
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODELIST_IID)
|
|
|
|
|
2009-01-29 11:46:18 -08:00
|
|
|
/**
|
|
|
|
* Get the index of the given node in the list. Will return -1 if the node
|
|
|
|
* is not in the list.
|
|
|
|
*/
|
|
|
|
virtual PRInt32 IndexOf(nsIContent* aContent) = 0;
|
2009-06-15 23:32:10 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the root node for this nodelist.
|
|
|
|
*/
|
|
|
|
virtual nsINode* GetParentObject() = 0;
|
2008-09-10 20:15:29 -07:00
|
|
|
};
|
|
|
|
|
2008-11-03 02:31:47 -08:00
|
|
|
#define NS_NODELIST_OFFSET_AND_INTERFACE_TABLE_BEGIN(_class) \
|
|
|
|
NS_OFFSET_AND_INTERFACE_TABLE_BEGIN_AMBIGUOUS(_class, nsINodeList)
|
|
|
|
|
2008-09-10 20:15:29 -07:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsINodeList, NS_INODELIST_IID)
|
|
|
|
|
|
|
|
#endif /* nsINodeList_h___ */
|