Back to index

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

List of all members.

Public Member Functions

 nsImapFolderCopyState (nsIMsgFolder *destParent, nsIMsgFolder *srcFolder, PRBool isMoveFolder, nsIMsgWindow *msgWindow, nsIMsgCopyServiceListener *listener)
 ~nsImapFolderCopyState ()
NS_DECL_ISUPPORTS
NS_DECL_NSIURLLISTENER
NS_DECL_NSIMSGCOPYSERVICELISTENER
nsresult 
StartNextCopy ()
nsresult AdvanceToNextFolder (nsresult aStatus)
void OnStartRunningUrl (in nsIURI url)
void OnStopRunningUrl (in nsIURI url, in nsresult aExitCode)
void OnStartCopy ()
 Notify the observer that the message has started to be copied.
void OnProgress (in PRUint32 aProgress, in PRUint32 aProgressMax)
 Notify the observer that progress as occurred for the message copy aProgress - aProgressMax -.
void SetMessageKey (in PRUint32 aKey)
 Setting newly created message key.
void GetMessageId (in nsCString aMessageId)
 Getting the file message message ID.
void OnStopCopy (in nsresult aStatus)
 Notify the observer that the message copied operation has completed.

Protected Attributes

nsCOMPtr< nsIMsgFolderm_destParent
nsCOMPtr< nsIMsgFolderm_srcFolder
PRBool m_isMoveFolder
nsCOMPtr
< nsIMsgCopyServiceListener
m_copySrvcListener
nsCOMPtr< nsIMsgWindowm_msgWindow
PRInt32 m_childIndex
nsCOMPtr< nsISupportsArraym_srcChildFolders
nsCOMPtr< nsISupportsArraym_destParents

Detailed Description

Definition at line 7023 of file nsImapMailFolder.cpp.


Constructor & Destructor Documentation

nsImapFolderCopyState::nsImapFolderCopyState ( nsIMsgFolder destParent,
nsIMsgFolder srcFolder,
PRBool  isMoveFolder,
nsIMsgWindow msgWindow,
nsIMsgCopyServiceListener listener 
)

Definition at line 7050 of file nsImapMailFolder.cpp.

Here is the call graph for this function:

Definition at line 7063 of file nsImapMailFolder.cpp.

{
}

Member Function Documentation

Definition at line 7094 of file nsImapMailFolder.cpp.

{
  nsresult rv = NS_OK;

  m_childIndex++;
  PRUint32 childCount = 0;
  if (m_srcChildFolders)
    m_srcChildFolders->Count(&childCount);

  if (m_childIndex >= childCount)
  {
    if (m_copySrvcListener)
      rv = m_copySrvcListener->OnStopCopy(aStatus);
    Release();
  }
  else
  {
    m_destParent = do_QueryElementAt(m_destParents, m_childIndex, &rv);
    m_srcFolder = do_QueryElementAt(m_srcChildFolders, m_childIndex, &rv);
    rv = StartNextCopy();
  }
  return rv;
}

Here is the call graph for this function:

Getting the file message message ID.

This method is taylored specifically for nsIMsgCopyService::CopyFileMessage() when saving Drafts/Templates. In order to work with imap server which doesn't support uidplus we have to use search comman to retrieve the key of newly created message. Message ID generated by the compose gurantee its uniqueness. aMessageId -

void nsIMsgCopyServiceListener::OnProgress ( in PRUint32  aProgress,
in PRUint32  aProgressMax 
) [inherited]

Notify the observer that progress as occurred for the message copy aProgress - aProgressMax -.

Notify the observer that the message has started to be copied.

This method is called only once, at the beginning of a message copyoperation.

Implemented in CopyListener.

Here is the caller graph for this function:

Notify the observer that the message copied operation has completed.

This method is called regardless of whether the the operation was successful. aStatus - indicate whether the operation was succeeded

void nsIUrlListener::OnStopRunningUrl ( in nsIURI  url,
in nsresult  aExitCode 
) [inherited]

Here is the caller graph for this function:

Setting newly created message key.

This method is taylored specifically for nsIMsgCopyService::CopyFileMessage() when saveing Drafts/Templates. We need to have a way to inform the client what's the key of the newly created message. aKey -

Definition at line 7068 of file nsImapMailFolder.cpp.

{
  nsresult rv;


  // first make sure dest folder exists.
  nsCOMPtr <nsIImapService> imapService = do_GetService (NS_IMAPSERVICE_CONTRACTID, &rv);
  if (NS_SUCCEEDED(rv))
  {
    nsXPIDLString folderName;
    m_srcFolder->GetName(getter_Copies(folderName));

    nsCOMPtr<nsIEventQueueService> pEventQService = 
      do_GetService(kEventQueueServiceCID, &rv); 
    nsCOMPtr <nsIEventQueue> eventQueue;
    if (NS_SUCCEEDED(rv) && pEventQService)
      pEventQService->GetThreadEventQueue(NS_CURRENT_THREAD,
      getter_AddRefs(eventQueue));

    rv = imapService->EnsureFolderExists(eventQueue, m_destParent,
                            folderName.get(), 
                            this, nsnull);
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 7042 of file nsImapMailFolder.cpp.

Definition at line 7040 of file nsImapMailFolder.cpp.

Definition at line 7037 of file nsImapMailFolder.cpp.

Definition at line 7044 of file nsImapMailFolder.cpp.

Definition at line 7039 of file nsImapMailFolder.cpp.

Definition at line 7041 of file nsImapMailFolder.cpp.

Definition at line 7043 of file nsImapMailFolder.cpp.

Definition at line 7038 of file nsImapMailFolder.cpp.


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