ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h
branchRCL_3
changeset 64 3533d4323edc
parent 63 d189ee25cf9d
--- 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;
 
-// <qmail> KIpsAutoPopulateByteLimit not used
+const TInt KIpsAutoPopulateByteLimit = KMaxTInt32;
 
 /**
 * class CIpsPlgImap4ConnectionOp
-* 
+*
 */
-NONSHARABLE_CLASS ( CIpsPlgImap4ConnectOp ) :
+    
+class CIpsPlgImap4ConnectOp :
     public CIpsPlgOnlineOperation,
-    // <qmail> public MMsvImapConnectionObserver, not used any more
-    // <qmail> public MIpsPlgConnectOpCallback not used any more
+    public MMsvImapConnectionObserver,
+    public MIpsPlgConnectOpCallback,
     public MFSMailRequestObserver
     {
-// <qmail> 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
-    */
-    // <qmail> priority parameter has been removed
-	// <qmail> MFSMailRequestObserver& changed it to pointer
-	// <qmail> 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 );
-        
-    // <qmail> 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;
-    
-    // <qmail> change ret val type
-    /**
-     * Returns operation type
-     */
-    TIpsOpType IpsOpType() const;
-    
-    //<qmail> 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 );
-    //</qmail>
+		/**
+        *
+        */
+        virtual const TDesC8& GetErrorProgressL( TInt aError );
+        
+        /**
+        * 
+        */
+        virtual TFSProgress GetFSProgressL() const;
+        
         
-    // <qmail> 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 );
         
-// <qmail> Connected() used from baseclass
+public:
 
-protected: // From CActive
-    void DoRunL();
-    void DoCancel();
-    
-private:
-    enum TImapConnectionState 
-        { 
-        EStateStartConnect,
-        // <qmail> removing EStateQueryingDetails, EStateQueryingDetailsBusy
-        EStateConnectAndSync,
-        EStatePopulateAllCompleted,
-        EStateCompleted,
-        EStateIdle 
-        };
-    
-	// <qmail> priority parameter has been removed
-	// <qmail> MFSMailRequestObserver& changed it to pointer
-	// <qmail> 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();
-    
-    // <qmail> remove void StartL();
-    
-    /**
-    * Handles one internal state 
-    */       
-    void DoPopulateAllL();
-    
-    // <qmail> removed QueryUserPwdL();
-    
-    /**
-     * initiates sync state changed event
-     */
-    void SignalSyncStarted();
-    
-    /**
-     * initiates sync state changed event
-     * @param aError specifies completion status
-     */
-    void SignalSyncCompleted( TInt aError );
-    
-    // <qmail> 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();
-    
-    // </qmail>
-    
-private: //Data
-    // internal state of this operation
-    TImapConnectionState                iState;
-    TPckgBuf<TImap4CompoundProgress>    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;
-	
-	// <qmail> 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<TImap4CompoundProgress>    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