Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
nsMsgDBThreadEnumerator Class Reference
Inheritance diagram for nsMsgDBThreadEnumerator:
Inheritance graph
[legend]
Collaboration diagram for nsMsgDBThreadEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsMsgDBThreadEnumerator (nsMsgDatabase *db, nsMsgDBThreadEnumeratorFilter filter)
virtual ~nsMsgDBThreadEnumerator ()
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.
void onHdrChange (in nsIMsgDBHdr aHdrChanged, in unsigned long aOldFlags, in unsigned long aNewFlags, in nsIDBChangeListener aInstigator)
void onHdrDeleted (in nsIMsgDBHdr aHdrChanged, in nsMsgKey aParentKey, in long aFlags, in nsIDBChangeListener aInstigator)
void onHdrAdded (in nsIMsgDBHdr aHdrChanged, in nsMsgKey aParentKey, in long aFlags, in nsIDBChangeListener aInstigator)
void onParentChanged (in nsMsgKey aKeyChanged, in nsMsgKey oldParent, in nsMsgKey newParent, in nsIDBChangeListener aInstigator)
void onAnnouncerGoingAway (in nsIDBChangeAnnouncer instigator)
void onReadChanged (in nsIDBChangeListener aInstigator)
void onJunkScoreChanged (in nsIDBChangeListener aInstigator)

Public Attributes

NS_DECL_ISUPPORTS
NS_DECL_NSISIMPLEENUMERATOR
NS_DECL_NSIDBCHANGELISTENER
typedef nsresult(* 
nsMsgDBThreadEnumeratorFilter )(nsIMsgThread *thread)

Protected Member Functions

nsresult GetTableCursor (void)
nsresult PrefetchNext ()

Protected Attributes

nsMsgDatabasemDB
nsCOMPtr< nsIMdbPortTableCursormTableCursor
nsIMsgThreadmResultThread
PRBool mDone
PRBool mNextPrefetched
nsMsgDBThreadEnumeratorFilter mFilter

Detailed Description

Definition at line 2811 of file nsMsgDatabase.cpp.


Constructor & Destructor Documentation

Definition at line 2838 of file nsMsgDatabase.cpp.

Here is the call graph for this function:

Definition at line 2847 of file nsMsgDatabase.cpp.

Here is the call graph for this function:


Member Function Documentation

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:

Definition at line 2904 of file nsMsgDatabase.cpp.

Here is the call graph for this function:

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:

void nsIDBChangeListener::onHdrAdded ( in nsIMsgDBHdr  aHdrChanged,
in nsMsgKey  aParentKey,
in long  aFlags,
in nsIDBChangeListener  aInstigator 
) [inherited]
void nsIDBChangeListener::onHdrChange ( in nsIMsgDBHdr  aHdrChanged,
in unsigned long  aOldFlags,
in unsigned long  aNewFlags,
in nsIDBChangeListener  aInstigator 
) [inherited]
void nsIDBChangeListener::onHdrDeleted ( in nsIMsgDBHdr  aHdrChanged,
in nsMsgKey  aParentKey,
in long  aFlags,
in nsIDBChangeListener  aInstigator 
) [inherited]
void nsIDBChangeListener::onParentChanged ( in nsMsgKey  aKeyChanged,
in nsMsgKey  oldParent,
in nsMsgKey  newParent,
in nsIDBChangeListener  aInstigator 
) [inherited]

Definition at line 2940 of file nsMsgDatabase.cpp.

{
  nsresult rv;
  nsIMdbTable *table = nsnull;

  if (!mDB)
    return NS_ERROR_NULL_POINTER;

  if (!mTableCursor)
  {
    rv = GetTableCursor();
    if (NS_FAILED(rv))
      return rv;
  }
  while (PR_TRUE) 
  {
    NS_IF_RELEASE(mResultThread);
    mResultThread = nsnull;
    rv = mTableCursor->NextTable(mDB->GetEnv(), &table);
    if (!table) 
    {
      mDone = PR_TRUE;
      return NS_ERROR_FAILURE;
    }
    if (NS_FAILED(rv)) 
    {
      mDone = PR_TRUE;
      return rv;
    }
    
    if (NS_FAILED(rv)) 
      return rv;
    
    mResultThread = new nsMsgThread(mDB, table);
    if(mResultThread)
    {
      PRUint32 numChildren = 0;
      NS_ADDREF(mResultThread);
      mResultThread->GetNumChildren(&numChildren);
      // we've got empty thread; don't tell caller about it.
      if (numChildren == 0)
        continue;
    }
    if (mFilter && NS_FAILED(mFilter(mResultThread)))
      continue;
    else
      break;
  }
  if (mResultThread) 
  {
    mNextPrefetched = PR_TRUE;
    return NS_OK;
  }
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 2830 of file nsMsgDatabase.cpp.

Definition at line 2833 of file nsMsgDatabase.cpp.

Definition at line 2835 of file nsMsgDatabase.cpp.

Definition at line 2834 of file nsMsgDatabase.cpp.

Definition at line 2832 of file nsMsgDatabase.cpp.

Definition at line 2831 of file nsMsgDatabase.cpp.

NS_DECL_ISUPPORTS NS_DECL_NSISIMPLEENUMERATOR NS_DECL_NSIDBCHANGELISTENER typedef nsresult(* nsMsgDBThreadEnumerator::nsMsgDBThreadEnumeratorFilter)(nsIMsgThread *thread)

Definition at line 2822 of file nsMsgDatabase.cpp.


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