Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
nsDocShellEnumerator Class Reference

#include <nsDocShellEnumerator.h>

Inheritance diagram for nsDocShellEnumerator:
Inheritance graph
[legend]
Collaboration diagram for nsDocShellEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsDocShellEnumerator (PRInt32 inEnumerationDirection)
virtual ~nsDocShellEnumerator ()
nsresult GetEnumerationRootItem (nsIDocShellTreeItem **aEnumerationRootItem)
nsresult SetEnumerationRootItem (nsIDocShellTreeItem *aEnumerationRootItem)
nsresult GetEnumDocShellType (PRInt32 *aEnumerationItemType)
nsresult SetEnumDocShellType (PRInt32 aEnumerationItemType)
nsresult First ()
boolean hasMoreElements ()
 Called to determine whether or not the enumerator has any elements that can be returned via getNext().
nsISupports getNext ()
 Called to retrieve the next element in the enumerator.

Protected Types

enum  { enumerateForwards, enumerateBackwards }

Protected Member Functions

nsresult EnsureDocShellArray ()
nsresult ClearState ()
nsresult BuildDocShellArray (nsVoidArray &inItemArray)
virtual nsresult BuildArrayRecursive (nsIDocShellTreeItem *inItem, nsVoidArray &inItemArray)=0

Protected Attributes

nsIDocShellTreeItemmRootItem
nsVoidArraymItemArray
PRInt32 mCurIndex
PRInt32 mDocShellType
const PRInt8 mEnumerationDirection

Detailed Description

Definition at line 66 of file nsDocShellEnumerator.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
enumerateForwards 
enumerateBackwards 

Definition at line 70 of file nsDocShellEnumerator.h.


Constructor & Destructor Documentation

Definition at line 53 of file nsDocShellEnumerator.cpp.

{
  delete mItemArray;
}

Member Function Documentation

virtual nsresult nsDocShellEnumerator::BuildArrayRecursive ( nsIDocShellTreeItem inItem,
nsVoidArray inItemArray 
) [protected, pure virtual]

Implemented in nsDocShellBackwardsEnumerator, and nsDocShellForwardsEnumerator.

Here is the caller graph for this function:

Definition at line 154 of file nsDocShellEnumerator.cpp.

{
  NS_ENSURE_TRUE(mRootItem, NS_ERROR_NOT_INITIALIZED);
  inItemArray.Clear();
  return BuildArrayRecursive(mRootItem, inItemArray);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 145 of file nsDocShellEnumerator.cpp.

{
  delete mItemArray;
  mItemArray = nsnull;
  
  mCurIndex = 0;
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 132 of file nsDocShellEnumerator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 126 of file nsDocShellEnumerator.cpp.

{
  mCurIndex = 0;
  return EnsureDocShellArray();
}

Here is the call graph for this function:

Definition at line 112 of file nsDocShellEnumerator.cpp.

{
  NS_ENSURE_ARG_POINTER(aEnumerationItemType);
  *aEnumerationItemType = mDocShellType;
  return NS_OK;
}

Definition at line 97 of file nsDocShellEnumerator.cpp.

{
  NS_ENSURE_ARG_POINTER(aEnumerationRootItem);
  *aEnumerationRootItem = mRootItem;
  NS_IF_ADDREF(*aEnumerationRootItem);
  return NS_OK;
}
nsISupports nsISimpleEnumerator::getNext ( ) [inherited]

Called to retrieve the next element in the enumerator.

The "next" element is the first element upon the first call. Must be pre-ceeded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator.

See also:
hasMoreElements()
Returns:
NS_OK if the call succeeded in returning a non-null value through the out parameter. NS_ERROR_FAILURE if there are no more elements to enumerate.
the next element in the enumeration.

Here is the caller graph for this function:

Called to determine whether or not the enumerator has any elements that can be returned via getNext().

This method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getNext() calls. Does not affect internal state of enumerator.

See also:
getNext()
Returns:
PR_TRUE if there are remaining elements in the enumerator. PR_FALSE if there are no more elements in the enumerator.

Here is the caller graph for this function:

Definition at line 119 of file nsDocShellEnumerator.cpp.

{
  mDocShellType = aEnumerationItemType;
  ClearState();
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 105 of file nsDocShellEnumerator.cpp.

{
  mRootItem = aEnumerationRootItem;
  ClearState();
  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 109 of file nsDocShellEnumerator.h.

Definition at line 111 of file nsDocShellEnumerator.h.

Definition at line 113 of file nsDocShellEnumerator.h.

Definition at line 108 of file nsDocShellEnumerator.h.

Definition at line 106 of file nsDocShellEnumerator.h.


The documentation for this class was generated from the following files: