CImPOP3GetMail Class Reference

class CImPOP3GetMail : public CMsvOperation

Encapsulates an operation to copy/move POP3 emails from the remote inbox to any local folder.

Functionality is provided to:

1. copy/move any new emails

2. copy/move a selection of emails

3. copy/move all emails

4. in the Remote Inbox to a local folder.

There are three cases for copying/moving the emails from the Remote Inbox:

1. the user is connected to the account so just copy/move the emails

2. the user is not connected to the account so connect, copy/move the emails, and then disconnect

3. the user is not connected to the account so connect, copy/move the emails, and then stay online

Objects of this type are returned from CPop3ClientMtm::InvokeAsyncFunctionL() when a suitable get command is requested.

Inherits from

Public Member Functions
~CImPOP3GetMail()
voidDoCancel()
IMPORT_C const TDesC8 &FinalProgress()
IMPORT_C CMsvOperation *GetMailL(CPop3ClientMtm &, TRequestStatus &, const CMsvEntrySelection &, TDes8 &, TImPOP3GetMailType)
const TDesC8 &ProgressL()
voidRunL()
Private Member Functions
CImPOP3GetMail(CMsvSession &, TRequestStatus &, CPop3ClientMtm &, TImPOP3GetMailType)
voidChangeStateL()
voidComplete()
voidConnectToMailboxL()
voidConstructL(const CMsvEntrySelection &, TDes8 &)
voidCopyMoveAllMessagesL(TBool)
voidCopyMoveMessageSelectionL(TBool)
voidCopyMoveNewMessagesL(TBool)
voidDisconnectFromMailboxL()
voidRequestComplete(TInt)
voidResetProgress()
voidSelectAndChangeToNextStateL()
voidSelectNextStateL()
voidStoreProgressL()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CMsvOperation::CMsvOperation(CMsvSession &,TInt,TRequestStatus &)
CMsvOperation::Extension_(TUint,TAny *&,TAny *)
CMsvOperation::Id()const
CMsvOperation::Mtm()const
CMsvOperation::Service()const
CMsvOperation::SystemProgress(TMsvSystemProgress &)
CMsvOperation::~CMsvOperation()
Public Member Enumerations
enumTImPOP3GetMailType {
EConnectAndCopyNewMailAndStayOnline, EConnectAndCopyNewMailAndDisconnect, EConnectAndMoveNewMailAndStayOnline, EConnectAndMoveNewMailAndDisconnect, EConnectAndCopyMailSelectionAndStayOnline, EConnectAndCopyMailSelectionAndDisconnect, EConnectAndMoveMailSelectionAndStayOnline, EConnectAndMoveMailSelectionAndDisconnect, EConnectAndCopyAllMailAndStayOnline, EConnectAndCopyAllMailAndDisconnect, EConnectAndMoveAllMailAndStayOnline, EConnectAndMoveAllMailAndDisconnect
}
Private Member Enumerations
enumTImPOP3GetMailState {
EConnectToMailbox, ECopyNewMessages, EMoveNewMessages, ECopyMessageSelection, EMoveMessageSelection, ECopyAllMessages, EMoveAllMessages, EDisconnectFromMailbox, EFinished
}
Inherited Enumerations
CActive:TPriority
Private Attributes
TPop3Progress iErrorProgress
CMsvEntrySelection *iMsvEntrySelection
CMsvOperation *iMsvOperation
TImPOP3GetMailType iPOP3GetMailType
CPop3ClientMtm &iPop3ClientMtm
TPckgBuf< TImPop3GetMailInfo >iPop3GetMailInfo
TPop3Progress iProgress
TPckgBuf< TPop3Progress >iProgressBuf
TImPOP3GetMailState iState
Inherited Attributes
CActive::iStatus
CMsvOperation::iMsvSession
CMsvOperation::iMtm
CMsvOperation::iObserverRequestStatus
CMsvOperation::iService

Constructor & Destructor Documentation

CImPOP3GetMail(CMsvSession &, TRequestStatus &, CPop3ClientMtm &, TImPOP3GetMailType)

CImPOP3GetMail(CMsvSession &aMsvSession,
TRequestStatus &aObserverRequestStatus,
CPop3ClientMtm &aPop3ClientMtm,
TImPOP3GetMailTypeaPOP3GetMailType
)[private]

Parameters

CMsvSession & aMsvSession
TRequestStatus & aObserverRequestStatus
CPop3ClientMtm & aPop3ClientMtm
TImPOP3GetMailType aPOP3GetMailType

~CImPOP3GetMail()

IMPORT_C~CImPOP3GetMail()

Member Functions Documentation

ChangeStateL()

voidChangeStateL()[private]

Complete()

voidComplete()[private]

ConnectToMailboxL()

voidConnectToMailboxL()[private]

ConstructL(const CMsvEntrySelection &, TDes8 &)

voidConstructL(const CMsvEntrySelection &aMsvEntrySelection,
TDes8 &aPop3GetMailInfo
)[private]

Parameters

const CMsvEntrySelection & aMsvEntrySelection
TDes8 & aPop3GetMailInfo

CopyMoveAllMessagesL(TBool)

voidCopyMoveAllMessagesL(TBoolaCopy)[private]

Parameters

TBool aCopy

CopyMoveMessageSelectionL(TBool)

voidCopyMoveMessageSelectionL(TBoolaCopy)[private]

Parameters

TBool aCopy

CopyMoveNewMessagesL(TBool)

voidCopyMoveNewMessagesL(TBoolaCopy)[private]

Parameters

TBool aCopy

DisconnectFromMailboxL()

voidDisconnectFromMailboxL()[private]

DoCancel()

voidDoCancel()[virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

CActive::Cancel

FinalProgress()

IMPORT_C const TDesC8 &FinalProgress()[virtual]

GetMailL(CPop3ClientMtm &, TRequestStatus &, const CMsvEntrySelection &, TDes8 &, TImPOP3GetMailType)

IMPORT_C CMsvOperation *GetMailL(CPop3ClientMtm &aPop3ClientMtm,
TRequestStatus &aObserverRequestStatus,
const CMsvEntrySelection &aMsvEntrySelection,
TDes8 &aPop3GetMailInfo,
TImPOP3GetMailTypeaPOP3GetMailType
)

Parameters

CPop3ClientMtm & aPop3ClientMtm
TRequestStatus & aObserverRequestStatus
const CMsvEntrySelection & aMsvEntrySelection
TDes8 & aPop3GetMailInfo
TImPOP3GetMailType aPOP3GetMailType

ProgressL()

const TDesC8 &ProgressL()[virtual]

Gets information on the progress of the operation.

All operations on local entries share the same progress information format, which defined by TMsvLocalOperationProgress.

For MTM-specific operations, progress information can be extracted by calling CBaseUiMtm::GetProgress() or displayed by CBaseUiMtm::DisplayProgressSummary() on the appropriate User Interface MTM.

Requirements:

Derived classes should implement this function so that the client can check on the progress of the operation. The function should share an understanding of the format of the buffer with the implementations of CBaseUiMtm::GetProgress() and CBaseUiMtm::DisplayProgressSummary() in the User Interface MTM. The arguments of CBaseUiMtm::GetProgress() show some information that should be included where appropriate.

leave

KErrNotReady The operation has not yet been started: it has been queued for execution in the Message Server

Descriptor holding progress information. The maximum buffer size should be KMsvProgressBufferLength (defined in msvipc.h).

RequestComplete(TInt)

voidRequestComplete(TIntaError)[private]

Parameters

TInt aError

ResetProgress()

voidResetProgress()[private]

RunL()

voidRunL()[virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start

CActiveScheduler::Error

CActiveScheduler::WaitForAnyRequest

TRAPD

SelectAndChangeToNextStateL()

voidSelectAndChangeToNextStateL()[private]

SelectNextStateL()

voidSelectNextStateL()[private]

StoreProgressL()

voidStoreProgressL()[private]

Member Enumerations Documentation

Enum TImPOP3GetMailState

Enumerators

EConnectToMailbox
ECopyNewMessages
EMoveNewMessages
ECopyMessageSelection
EMoveMessageSelection
ECopyAllMessages
EMoveAllMessages
EDisconnectFromMailbox
EFinished

Enum TImPOP3GetMailType

Defines types of get mail operation.

Enumerators

EConnectAndCopyNewMailAndStayOnline

Connect and copy new mail and stay online.

EConnectAndCopyNewMailAndDisconnect

Connect and copy new mail and disconnect.

EConnectAndMoveNewMailAndStayOnline

Connect and move new mail and stay online.

EConnectAndMoveNewMailAndDisconnect

Connect and move new mail and disconnect.

EConnectAndCopyMailSelectionAndStayOnline

Connect and copy mail selection and stay online.

EConnectAndCopyMailSelectionAndDisconnect

Connect and copy mail selection and disconnect.

EConnectAndMoveMailSelectionAndStayOnline

Connect and move mail selection and stay online.

EConnectAndMoveMailSelectionAndDisconnect

Connect and move mail selection and disconnect.

EConnectAndCopyAllMailAndStayOnline

Connect and copy all mail and stay online.

EConnectAndCopyAllMailAndDisconnect

Connect and copy all mail and disconnect.

EConnectAndMoveAllMailAndStayOnline

Connect and move all mail and stay online.

EConnectAndMoveAllMailAndDisconnect

Connect and move all mail and disconnect.

Member Data Documentation

TPop3Progress iErrorProgress

TPop3Progress iErrorProgress[private]

CMsvEntrySelection * iMsvEntrySelection

CMsvEntrySelection *iMsvEntrySelection[private]

CMsvOperation * iMsvOperation

CMsvOperation *iMsvOperation[private]

TImPOP3GetMailType iPOP3GetMailType

TImPOP3GetMailType iPOP3GetMailType[private]

CPop3ClientMtm & iPop3ClientMtm

CPop3ClientMtm &iPop3ClientMtm[private]

TPckgBuf< TImPop3GetMailInfo > iPop3GetMailInfo

TPckgBuf< TImPop3GetMailInfo >iPop3GetMailInfo[private]

TPop3Progress iProgress

TPop3Progress iProgress[private]

TPckgBuf< TPop3Progress > iProgressBuf

TPckgBuf< TPop3Progress >iProgressBuf[private]

TImPOP3GetMailState iState

TImPOP3GetMailState iState[private]