diff -r d189ee25cf9d -r 3533d4323edc ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h --- a/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h Tue Aug 31 15:04:17 2010 +0300 +++ b/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h Wed Sep 01 12:28:57 2010 +0100 @@ -15,189 +15,212 @@ * */ -#ifndef IPSPLGIMAP4CONNECTOP_H -#define IPSPLGIMAP4CONNECTOP_H +#ifndef __IPSPLGIMAP4CONNECTOP_H__ +#define __IPSPLGIMAP4CONNECTOP_H__ + #include "ipsplgonlineoperation.h" #include "imapconnectionobserver.h" class CIpsPlgEventHandler; -// KIpsAutoPopulateByteLimit not used +const TInt KIpsAutoPopulateByteLimit = KMaxTInt32; /** * class CIpsPlgImap4ConnectionOp -* +* */ -NONSHARABLE_CLASS ( CIpsPlgImap4ConnectOp ) : + +class CIpsPlgImap4ConnectOp : public CIpsPlgOnlineOperation, - // public MMsvImapConnectionObserver, not used any more - // public MIpsPlgConnectOpCallback not used any more + public MMsvImapConnectionObserver, + public MIpsPlgConnectOpCallback, public MFSMailRequestObserver { -// MIpsPlgConnectOpCallback not used any more -public: + +public://from MIpsPlgConnectOpCallback + + void CredientialsSetL( TInt aEvent ); + + public: - /** - * NewL() - * @param aMsvSession reference to client/server session to MsvServer - * @param aObserverRequestStatus client's status - * @param aService service (mailbox) id - * @param aActivityTimer mailbox specific activity timer - * @param aFSMailBoxId specifies mailbox - * @param aFSOperationObserver observer of this operation - * @param aFSRequestId request identifier of this op (assigned by caller, and used when calling - * back aFSOperationObserver - * @param aEventHandler used for signalling synchronisation statuses - * @param aDoPlainConnect whether just connect to mailbox, or synch messages also - * @return CIpsPlgImap4ConnectionOp* self pointer - */ - // priority parameter has been removed - // MFSMailRequestObserver& changed it to pointer - // aSignallingAllowed parameter has been removed - static CIpsPlgImap4ConnectOp* NewL( - CMsvSession& aMsvSession, - TRequestStatus& aObserverRequestStatus, - TMsvId aService, - CIpsPlgTimerOperation& aActivityTimer, - TFSMailMsgId aFSMailBoxId, - MFSMailRequestObserver* aFSOperationObserver, - TInt aFSRequestId, - CIpsPlgEventHandler* aEventHandler, - TBool aDoPlainConnect=EFalse ); - - // make destructor virtual - virtual ~CIpsPlgImap4ConnectOp(); + /** + * NewL() + * Basic factory function - creates dialog with standard title resource + * @param CMsvSession& CMsvSession reference + * @param TInt priority + * @param TRequestStatus& request status + * @param TMsvId service (mailbox) id + * @param TImapConnectionType connection type + * @param + * @param + * @return CIpsPlgImap4ConnectionOp* self pointer + */ + static CIpsPlgImap4ConnectOp* NewL( + CMsvSession& aMsvSession, + TInt aPriority, + TRequestStatus& aObserverRequestStatus, + TMsvId aService, + CIpsPlgTimerOperation& aActivityTimer, + TFSMailMsgId aFSMailBoxId, + MFSMailRequestObserver& aFSOperationObserver, + TInt aFSRequestId, + CIpsPlgEventHandler* aEventHandler, + TBool aDoPlainConnect=EFalse, + TBool aSignallingAllowed=ETrue ); + + /** + * ~CIpsPlgImap4ConnectionOp() + * destructor + */ + ~CIpsPlgImap4ConnectOp(); public: // from CIpsPlgBaseOperation - /** - * From MsvOperation - * Gets information on the progress of the operation - * (see MsvOperation header) - */ - virtual const TDesC8& ProgressL(); + virtual const TDesC8& ProgressL(); - /** - * From CIpsPlgBaseOperation - * For reporting if DoRunL leaves - */ - virtual const TDesC8& GetErrorProgressL( TInt aError ); - - virtual TFSProgress GetFSProgressL() const; - - // change ret val type - /** - * Returns operation type - */ - TIpsOpType IpsOpType() const; - - // moved from private to public and changed to static - /** - * - * @param aInfo is filled correctly in this function - * @param aImap4Settings info is filled partly based on settings - */ - static void ConstructImapPartialFetchInfo( - TImImap4GetPartialMailInfo& aInfo, - const CImImap4Settings& aImap4Settings ); - // + /** + * + */ + virtual const TDesC8& GetErrorProgressL( TInt aError ); + + /** + * + */ + virtual TFSProgress GetFSProgressL() const; + - // HandleImapConnectionEvent() not used any more - + /** + * + */ + virtual TInt IpsOpType() const; + +public: // from MMsvImapConnectionObserver + + /** + * HandleImapConnectionEvent() + * From MMsvImapConnectionObserver + * @param TImapConnectionEvent, imap connection event + */ + void HandleImapConnectionEvent( + TImapConnectionEvent aConnectionEvent); + + public: // from MFSMailRequestObserver - void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); + void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); -// Connected() used from baseclass +public: -protected: // From CActive - void DoRunL(); - void DoCancel(); - -private: - enum TImapConnectionState - { - EStateStartConnect, - // removing EStateQueryingDetails, EStateQueryingDetailsBusy - EStateConnectAndSync, - EStatePopulateAllCompleted, - EStateCompleted, - EStateIdle - }; - - // priority parameter has been removed - // MFSMailRequestObserver& changed it to pointer - // aSignallingAllowed parameter has been removed - CIpsPlgImap4ConnectOp( - CMsvSession& aMsvSession, - TRequestStatus& aObserverRequestStatus, - TMsvId aService, - CIpsPlgTimerOperation& aActivityTimer, - TFSMailMsgId aFSMailBoxId, - MFSMailRequestObserver* aFSOperationObserver, - TInt aFSRequestId, - TBool aDoPlainConnect, - CIpsPlgEventHandler* aEventHandler ); + /** + * + */ + TBool Connected() const; + +protected: - void ConstructL(); - - /** - * Handles one internal state - */ - void DoConnectOpL(); - - // remove void StartL(); - - /** - * Handles one internal state - */ - void DoPopulateAllL(); - - // removed QueryUserPwdL(); - - /** - * initiates sync state changed event - */ - void SignalSyncStarted(); - - /** - * initiates sync state changed event - * @param aError specifies completion status - */ - void SignalSyncCompleted( TInt aError ); - - // moved to public + /** + * From CActive + */ + void DoRunL(); + + /** + * + */ + void DoCancel(); + + /** + * From CIpsPlgOnlineoperation + */ + //TInt GetOperationErrorCodeL( ); + + private: + + enum TImapConnectionState + { + EStateStartConnect, + EStateQueryingDetails, + EStateQueryingDetailsBusy, + EStateConnectAndSync, + EStatePopulateAllCompleted, + EStateCompleted, + EStateIdle }; + + /** + * CIpsPlgImap4ConnectionOp() + * @param CMsvSession&, CMsvSession reference + * @param TInt, priority + * @param TRequestStatus&, request status + * @param TMsvId, service ( mailbox ) id + * @param MMsvProgressReporter&, prog. reporter + * @param TImapConnectionType, connection type + */ + CIpsPlgImap4ConnectOp( + CMsvSession& aMsvSession, + TInt aPriority, + TRequestStatus& aObserverRequestStatus, + TMsvId aService, + CIpsPlgTimerOperation& aActivityTimer, + TFSMailMsgId aFSMailBoxId, + MFSMailRequestObserver& aFSOperationObserver, + TInt aFSRequestId, + TBool aDoPlainConnect, + TBool aSignallingAllowed, + CIpsPlgEventHandler* aEventHandler ); - /** - * GetImapSettingsLC() - * constructs imap settings object with this account's settings (based on iService member) - * @return CImImap4Settings object as a pointer. Object is placed into CleanupStack. - */ - CImImap4Settings* GetImapSettingsLC(); - - /** - * Updates iSelection member to contain the message entries from inbox folder - * NOTE: all prior contents of iSelection will be deleted - * NOTE: takes care of only direct Inbox folder - */ - void CreateInboxMessagesSelectionL(); - - // - -private: //Data - // internal state of this operation - TImapConnectionState iState; - TPckgBuf iProgressBuf; - CMsvEntrySelection* iSelection; - // whether caller instantiated this op to do only connect or not - TBool iDoPlainConnect; - // pointer to event handler in order to signal sync status to client - CIpsPlgEventHandler* iEventHandler; // not owned - // prevents signalling sync started for more than once - TBool iIsSyncStartedSignaled; - - // iAlreadyConnected removed + /** + * ConstructL() + */ + void ConstructL(); + + /** + * + */ + void DoConnectOpL(); + + /** + * + */ + void StartL(); + + /** + * + */ + void DoPopulateAllL(); + + /** + * Send user password query request to CIpsPlgEventHandler + * @return ETrue - if query send + */ + TBool QueryUserPassL(); + + + /** + * + */ + void SignalSyncStarted(); + + /** + * + */ + void SignalSyncCompleted( TInt aError ); + + + private: //Data + + TImapConnectionState iState; + TPckgBuf iProgressBuf; + CMsvEntrySelection* iSelection; + TBool iDoPlainConnect; + + + + // not owned + CIpsPlgEventHandler* iEventHandler; + TBool iIsSyncStartedSignaled; + + // set to true if connection is already exists + TBool iAlreadyConnected; }; -#endif // IPSPLGIMAP4CONNECT_H +#endif