Pop3Mail.h
上传用户:sempras
上传日期:2007-03-04
资源大小:821k
文件大小:2k
- #ifndef __POP3MAIL_H__
- #define __POP3MAIL_H__
- #include <e32base.h>
- #include <msvapi.h>
- #include <pop3set.h>
- #include <ckncancl.h>
- class CPop3ClientMtm;
- class CMsvEmailUtils;
- /*
- * ============================================================================
- * Name : CPop3Mail from Pop3Mail.h
- * Part of : EmailExample
- * Created : 09/11/2003 by Forum Nokia
- * Implementation notes:
- * Engine class that wraps some Pop3 functionality.
- * Implemented as statemachine.
- *
- * Version : 1.0
- * Copyright: Nokia Corporation
- * ============================================================================
- */
- class CPop3Mail : public CActive, public MMsvSessionObserver,public MCknCancellableOperation
- {
- public:
- // creational
- static CPop3Mail* NewL(TRequestStatus& aStatus,CMsvSession& aMsvSession);
- ~CPop3Mail();
- // interface
- /*
- * FetchRemoteMailL(TMsvId aMailId=NULL)
- *
- * only interface method which initiates multiple state process which
- * connects to remote mailbox and downloads all message headers from
- * remote server.
- *
- * Params:
- * (1) TMsvId aMailId initial entry id
- *
- */
- void FetchRemoteMailL(TMsvId aMailId=NULL);
- // private functions
- private:
- CPop3Mail(TRequestStatus& aStatus,CMsvSession& aMsvSession);
- void ConstructL();
- void ExecuteConnectL();
- void ExecuteFetchMailL();
- void ExecuteDisconnetL();
- void MailCommandL(TInt aCommand,TDes8& aParams);
- void LoadMtmL();
- void Queue();
- // from CActive
- void RunL();
- void DoCancel();
- TInt RunError(TInt aError);
- // from MCknCancellableOperation
- void CancelOperation();
- // from MMsvSessionObserver
- void HandleSessionEventL(TMsvSessionEvent aEvent,TAny* aArg1,TAny* aArg2,TAny* aArg3);
- // private state values for the state machine
- private:
- enum TInternalState
- {
- EInitialising,
- EReady,
- EConnecting,
- EGetRemote,
- EDisconnectRemote,
- EDisconnecting,
- ECanceling
- } ;
- // private data
- private:
- CMsvEmailUtils* iPop3Utils;
- TRequestStatus& iObserverStatus;
- CMsvSession& iMsvSession;
- CPop3ClientMtm* iPop3Mtm;
- TMsvId iServiceId;
- CMsvOperation* iOperation;
- CCknCancelDialog* iDialog;
- TInternalState iState;
- CMsvEntrySelection* iMsvSelection;
- TMsvId iMailId;
- };
- #endif //__POP3MAIL_H__