Back to index

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

#include <nsAppShellWindowEnumerator.h>

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

List of all members.

Public Member Functions

 nsASXULWindowEarlyToLateEnumerator (const PRUnichar *aTypeString, nsWindowMediator &inMediator)
virtual ~nsASXULWindowEarlyToLateEnumerator ()
NS_IMETHOD GetNext (nsISupports **retval)
NS_IMETHOD HasMoreElements (PRBool *retval)
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 Member Functions

virtual nsWindowInfoFindNext ()
void AdjustInitialPosition ()
void WindowRemoved (nsWindowInfo *inInfo)

Protected Attributes

nsWindowMediatormWindowMediator
nsString mType
nsWindowInfomCurrentPosition

Detailed Description

Definition at line 136 of file nsAppShellWindowEnumerator.h.


Constructor & Destructor Documentation

Definition at line 349 of file nsAppShellWindowEnumerator.cpp.

                                 :

  nsASXULWindowEnumerator(aTypeString, aMediator) {

  mCurrentPosition = aMediator.mOldestWindow;
  AdjustInitialPosition();
}

Here is the call graph for this function:

Definition at line 359 of file nsAppShellWindowEnumerator.cpp.

                                                                        {
}

Member Function Documentation

Definition at line 226 of file nsAppShellWindowEnumerator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsAppShellWindowEnumerator.

Definition at line 362 of file nsAppShellWindowEnumerator.cpp.

                                                           {

  nsWindowInfo *info,
               *listEnd;
  PRBool        allWindows = mType.IsEmpty();

  /* mCurrentPosition null is assumed to mean that the enumerator has run
     its course and is now basically useless. It could also be interpreted
     to mean that it was created at a time when there were no windows. In
     that case it would probably be more appropriate to check to see whether
     windows have subsequently been added. But it's not guaranteed that we'll
     pick up newly added windows anyway (if they occurred previous to our
     current position) so we just don't worry about that. */
  if (!mCurrentPosition)
    return 0;

  info = mCurrentPosition->mYounger;
  listEnd = mWindowMediator->mOldestWindow;

  while (info != listEnd) {
    if (allWindows || info->TypeEquals(mType))
      return info;
    info = info->mYounger;
  }

  return 0;
}

Here is the call graph for this function:

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:

NS_IMETHODIMP nsASXULWindowEnumerator::GetNext ( nsISupports **  retval) [virtual, inherited]

Implements nsAppShellWindowEnumerator.

Definition at line 293 of file nsAppShellWindowEnumerator.cpp.

Here is the call 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 232 of file nsAppShellWindowEnumerator.cpp.

void nsAppShellWindowEnumerator::WindowRemoved ( nsWindowInfo inInfo) [protected, inherited]

Definition at line 242 of file nsAppShellWindowEnumerator.cpp.

                                                                   {

  if (mCurrentPosition == inInfo)
    mCurrentPosition = FindNext();
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 98 of file nsAppShellWindowEnumerator.h.

Definition at line 97 of file nsAppShellWindowEnumerator.h.

Definition at line 96 of file nsAppShellWindowEnumerator.h.


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