Classes | Defines | Typedefs | Functions

nsContentList.h File Reference

#include "nsISupports.h"
#include "nsCOMArray.h"
#include "nsString.h"
#include "nsIHTMLCollection.h"
#include "nsIDOMNodeList.h"
#include "nsINodeList.h"
#include "nsStubMutationObserver.h"
#include "nsIAtom.h"
#include "nsINameSpaceManager.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "nsCRT.h"
#include "mozilla/dom/Element.h"
Include dependency graph for nsContentList.h:
This graph shows which files directly or indirectly include this file:

Classes

class  nsBaseContentList
class  nsBaseContentList::cycleCollection
class  nsFormContentList
class  nsContentListKey
 Class that's used as the key to hash nsContentList implementations for fast retrieval. More...
class  nsContentList
 Class that implements a live NodeList that matches Elements in the tree based on some criterion. More...
class  nsFuncStringCacheKey
class  nsCacheableFuncStringContentList

Defines

#define kNameSpaceID_Wildcard   PR_INT32_MIN
#define LIST_UP_TO_DATE   0
 LIST_UP_TO_DATE means that the list is up to date and need not do any walking to be able to answer any questions anyone may have.
#define LIST_DIRTY   1
 LIST_DIRTY means that the list contains no useful information and if anyone asks it anything it will have to populate itself before answering.
#define LIST_LAZY   2
 LIST_LAZY means that the list has populated itself to a certain extent and that that part of the list is still valid.

Typedefs

typedef PRBool(* nsContentListMatchFunc )(nsIContent *aContent, PRInt32 aNamespaceID, nsIAtom *aAtom, void *aData)
typedef void(* nsContentListDestroyFunc )(void *aData)
typedef void *(* nsFuncStringContentListDataAllocator )(nsINode *aRootNode, const nsString_external *aString)
 A function that allocates the matching data for this FuncStringContentList.

Functions

already_AddRefed< nsContentListNS_GetContentList (nsINode *aRootNode, PRInt32 aMatchNameSpaceId, nsIAtom *aHTMLMatchAtom, nsIAtom *aXMLMatchAtom=0L)
already_AddRefed< nsContentListNS_GetFuncStringContentList (nsINode *aRootNode, nsContentListMatchFunc aFunc, nsContentListDestroyFunc aDestroyFunc, nsFuncStringContentListDataAllocator aDataAllocator, const nsAString &aString)

Define Documentation

#define kNameSpaceID_Wildcard   PR_INT32_MIN
#define LIST_DIRTY   1

LIST_DIRTY means that the list contains no useful information and if anyone asks it anything it will have to populate itself before answering.

#define LIST_LAZY   2

LIST_LAZY means that the list has populated itself to a certain extent and that that part of the list is still valid.

Requests for things outside that part of the list will require walking the tree some more. When a list is in this state, the last thing in mElements is the last node in the tree that the list looked at.

#define LIST_UP_TO_DATE   0

LIST_UP_TO_DATE means that the list is up to date and need not do any walking to be able to answer any questions anyone may have.


Typedef Documentation

typedef void(* nsContentListDestroyFunc)(void *aData)
typedef PRBool(* nsContentListMatchFunc)(nsIContent *aContent, PRInt32 aNamespaceID, nsIAtom *aAtom, void *aData)
typedef void*(* nsFuncStringContentListDataAllocator)(nsINode *aRootNode, const nsString_external *aString)

A function that allocates the matching data for this FuncStringContentList.

Returning aString is perfectly fine; in that case the destructor function should be a no-op.


Function Documentation

already_AddRefed<nsContentList> NS_GetContentList ( nsINode *  aRootNode,
PRInt32  aMatchNameSpaceId,
nsIAtom aHTMLMatchAtom,
nsIAtom aXMLMatchAtom = 0L 
)
already_AddRefed<nsContentList> NS_GetFuncStringContentList ( nsINode *  aRootNode,
nsContentListMatchFunc  aFunc,
nsContentListDestroyFunc  aDestroyFunc,
nsFuncStringContentListDataAllocator  aDataAllocator,
const nsAString aString 
)