Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
CopyListener Class Reference

#include <nsMsgCopy.h>

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

List of all members.

Public Member Functions

 CopyListener (void)
virtual ~CopyListener (void)
NS_DECL_ISUPPORTS NS_IMETHOD OnStartCopy ()
 Notify the observer that the message has started to be copied.
NS_IMETHOD OnProgress (PRUint32 aProgress, PRUint32 aProgressMax)
NS_IMETHOD SetMessageKey (PRUint32 aMessageKey)
NS_IMETHOD GetMessageId (nsCString *aMessageId)
NS_IMETHOD OnStopCopy (nsresult aStatus)
NS_IMETHOD SetMsgComposeAndSendObject (nsIMsgSend *obj)
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.

Public Attributes

nsCOMPtr< nsISupports > mCopyObject
PRBool mCopyInProgress

Private Attributes

nsCOMPtr< nsIMsgSendmComposeAndSend

Detailed Description

Definition at line 61 of file nsMsgCopy.h.


Constructor & Destructor Documentation

Definition at line 79 of file nsMsgCopy.cpp.

Definition at line 85 of file nsMsgCopy.cpp.

{
}

Member Function Documentation

Definition at line 123 of file nsMsgCopy.cpp.

{
  if (mComposeAndSend)
      mComposeAndSend->GetMessageId(aMessageId);
  return NS_OK;
}

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 -.

nsresult CopyListener::OnProgress ( PRUint32  aProgress,
PRUint32  aProgressMax 
)

Definition at line 102 of file nsMsgCopy.cpp.

{
#ifdef NS_DEBUG
  printf("CopyListener::OnProgress() %d of %d\n", aProgress, aProgressMax);
#endif

  if (mComposeAndSend)
    mComposeAndSend->NotifyListenerOnProgressCopy(aProgress, aProgressMax);

  return NS_OK;
}

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

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

Implements nsIMsgCopyServiceListener.

Definition at line 90 of file nsMsgCopy.cpp.

{
#ifdef NS_DEBUG
  printf("CopyListener::OnStartCopy()\n");
#endif

  if (mComposeAndSend)
    mComposeAndSend->NotifyListenerOnStartCopy();
  return NS_OK;
}

Definition at line 131 of file nsMsgCopy.cpp.

{
  if (NS_SUCCEEDED(aStatus))
  {
#ifdef NS_DEBUG
    printf("CopyListener: SUCCESSFUL ON THE COPY OPERATION!\n");
#endif
  }
  else
  {
#ifdef NS_DEBUG
    printf("CopyListener: COPY OPERATION FAILED!\n");
#endif
  }

  if (mCopyObject)
  {
      PR_CEnterMonitor(mCopyObject);
      PR_CNotifyAll(mCopyObject);
      mCopyInProgress = PR_FALSE;
      PR_CExitMonitor(mCopyObject);
  }
  if (mComposeAndSend)
    mComposeAndSend->NotifyListenerOnStopCopy(aStatus);

  return NS_OK;
}

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

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 115 of file nsMsgCopy.cpp.

{
  if (mComposeAndSend)
      mComposeAndSend->SetMessageKey(aMessageKey);
  return NS_OK;
}

Definition at line 160 of file nsMsgCopy.cpp.

{
  if (obj)
    mComposeAndSend = obj;

  return NS_OK;
}

Member Data Documentation

Definition at line 86 of file nsMsgCopy.h.

Definition at line 83 of file nsMsgCopy.h.

Definition at line 82 of file nsMsgCopy.h.


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