ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:23:15 +0300
changeset 20 ecc8def7944a
parent 18 578830873419
child 23 2dc6caa42ec3
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  POP connect operation
*
*/

#ifndef IPSPLGPOP3CONNECTOP_H
#define IPSPLGPOP3CONNECTOP_H


#include "ipsplgonlineoperation.h"
class CIpsPlgEventHandler;

/**
* Connect operation.
* Encapsulates connection validation.
*/
NONSHARABLE_CLASS ( CIpsPlgPop3ConnectOp ) :
    public CIpsPlgOnlineOperation
    // public MIpsPlgConnectOpCallback <qmail> not used any more
    {
    // <qmail> MIpsPlgConnectOpCallback not used any more
public:

        /**
        *
        */
        static CIpsPlgPop3ConnectOp* NewL(
            CMsvSession& aMsvSession,
            TRequestStatus& aObserverRequestStatus,
            TMsvId aService,
            TBool aForcePopulate,
            CIpsPlgTimerOperation& aActivityTimer,
            TFSMailMsgId aFSMailBoxId,
            MFSMailRequestObserver* aFSOperationObserver,
            TInt aFSRequestId,
            CIpsPlgEventHandler* aEventHandler=NULL );

        /**
        *
        */
        virtual ~CIpsPlgPop3ConnectOp();

        /**
        *
        */
        const TDesC8& GetErrorProgressL(TInt aError);
        
        /**
        *
        */
        TFSProgress GetFSProgressL() const;

// <qmail> Connected() used from baseclass
        
        // <qmail> change ret val type
        /**
         * Returns operation type
         */
        TIpsOpType IpsOpType() const;

    protected:

        /**
        * 
        */
        const TDesC8& ProgressL();
        
        /**
         * 
         */
        void DoCancel();

        /**
        * From CActive
        */
        void DoRunL();
        
        /**
        * 
        */
        TInt GetOperationErrorCodeL( );
        
    private:

        /**
        *
        */
        CIpsPlgPop3ConnectOp(
            CMsvSession& aMsvSession,
            TRequestStatus& aObserverRequestStatus,
            TMsvId aServiceId,
            TBool aForcePopulate,
            CIpsPlgTimerOperation& aActivityTimer,
            TFSMailMsgId aFSMailBoxId,
            MFSMailRequestObserver* aFSOperationObserver,
            TInt aFSRequestId,
            CIpsPlgEventHandler* aEventHandler );

        /**
        *
        */
        void ConstructL();

        // <qmail>
        /**
         * Do.. functions handle certain state of this operation
         */
        void DoConnectL();
        void DoPopulateL();
// <qmail> TBool ValidateL() removed (did nothing)
// <qmail> void DoQueryPasswordL() not used any more
        void DoDisconnect();
        // </qmail>
        
        // <qmail> removed flag methods as they were not used or even defined anywhere
        
    private: // Data
    
        enum TPopConnectStates 
            {
            EStartConnect,
            EConnected,
            EPopulate,
            // <qmail> new EDisconnecting state, removed querydetails state
            EDisconnecting,
            // </qmail>
            EErrInvalidDetails,
            EIdle
            };

        TInt                                            iState;
        CMsvEntry*                                      iEntry;        
        TPckgBuf<TPop3Progress>                         iProgress;
        TInt                                            iPopulateLimit;
        TBool                                           iForcePopulate;
        CMsvEntrySelection*                             iSelection;
        CIpsPlgEventHandler*                            iEventHandler; // not owned
    };

#endif