Back to index

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSISIMPLEENUMERATOR 
nsMsgOfflineOpEnumerator (nsMailDatabase *db)
virtual ~nsMsgOfflineOpEnumerator ()
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

nsresult GetRowCursor ()
nsresult PrefetchNext ()

Protected Attributes

nsMailDatabasemDB
nsIMdbTableRowCursormRowCursor
nsCOMPtr
< nsIMsgOfflineImapOperation
mResultOp
PRBool mDone
PRBool mNextPrefetched

Detailed Description

Definition at line 775 of file nsMailDatabase.cpp.


Constructor & Destructor Documentation

Definition at line 795 of file nsMailDatabase.cpp.

Here is the call graph for this function:

Definition at line 802 of file nsMailDatabase.cpp.


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 810 of file nsMailDatabase.cpp.

{
  nsresult rv = 0;
  mDone = PR_FALSE;

  if (!mDB || !mDB->m_mdbAllOfflineOpsTable)
    return NS_ERROR_NULL_POINTER;

  rv = mDB->m_mdbAllOfflineOpsTable->GetTableRowCursor(mDB->GetEnv(), -1, &mRowCursor);
  return rv;
}

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 841 of file nsMailDatabase.cpp.

{
  nsresult rv = NS_OK;
  nsIMdbRow* offlineOpRow;
  mdb_pos rowPos;

  if (!mRowCursor)
  {
    rv = GetRowCursor();
    if (NS_FAILED(rv))
      return rv;
  }

  rv = mRowCursor->NextRow(mDB->GetEnv(), &offlineOpRow, &rowPos);
  if (!offlineOpRow) 
  {
    mDone = PR_TRUE;
    return NS_ERROR_FAILURE;
  }
  if (NS_FAILED(rv)) 
  {
    mDone = PR_TRUE;
    return rv;
  }
       //Get key from row
  mdbOid outOid;
  nsMsgKey key=0;
  if (offlineOpRow->GetOid(mDB->GetEnv(), &outOid) == NS_OK)
    key = outOid.mOid_Id;

  nsIMsgOfflineImapOperation *op = new nsMsgOfflineImapOperation(mDB, offlineOpRow);
  mResultOp = op;
  if (!op)
    return NS_ERROR_OUT_OF_MEMORY;

  if (mResultOp) 
  {
    mNextPrefetched = PR_TRUE;
    return NS_OK;
  }
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 788 of file nsMailDatabase.cpp.

Definition at line 791 of file nsMailDatabase.cpp.

Definition at line 792 of file nsMailDatabase.cpp.

Definition at line 790 of file nsMailDatabase.cpp.

Definition at line 789 of file nsMailDatabase.cpp.


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