ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h
changeset 0 8466d47a6819
child 3 a4d6f1ea0416
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  POP connect operation
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef IPSPLGPOP3CONNECTOP_H
       
    19 #define IPSPLGPOP3CONNECTOP_H
       
    20 
       
    21 
       
    22 #include "ipsplgonlineoperation.h"
       
    23 class CIpsPlgEventHandler;
       
    24 
       
    25 /**
       
    26 * Connect operation.
       
    27 * Encapsulates connection validation.
       
    28 */
       
    29 class CIpsPlgPop3ConnectOp :
       
    30     public CIpsPlgOnlineOperation,
       
    31     public MIpsPlgConnectOpCallback
       
    32     {
       
    33 public://from MIpsPlgConnectOpCallback
       
    34     
       
    35     void CredientialsSetL( TInt aEvent );
       
    36     public:
       
    37 
       
    38         /**
       
    39         *
       
    40         */
       
    41         static CIpsPlgPop3ConnectOp* NewL(
       
    42             CMsvSession& aMsvSession,
       
    43             TRequestStatus& aObserverRequestStatus,
       
    44             TMsvId aService,
       
    45             TBool aForcePopulate,
       
    46             CIpsPlgTimerOperation& aActivityTimer,
       
    47             TFSMailMsgId aFSMailBoxId,
       
    48             MFSMailRequestObserver& aFSOperationObserver,
       
    49             TInt aFSRequestId,
       
    50             CIpsPlgEventHandler* aEventHandler=NULL,
       
    51             TBool aSignallingAllowed=ETrue );
       
    52 
       
    53         /**
       
    54         *
       
    55         */
       
    56         virtual ~CIpsPlgPop3ConnectOp();
       
    57 
       
    58         /**
       
    59         *
       
    60         */
       
    61         const TDesC8& GetErrorProgressL(TInt aError);
       
    62         
       
    63         /**
       
    64         *
       
    65         */
       
    66         TFSProgress GetFSProgressL() const;
       
    67 
       
    68         /**
       
    69         *
       
    70         */
       
    71         TBool Connected() const;
       
    72         
       
    73         /**
       
    74         *
       
    75         */
       
    76         virtual TInt IpsOpType() const;
       
    77 
       
    78     protected:
       
    79 
       
    80         /**
       
    81         * 
       
    82         */
       
    83         const TDesC8& ProgressL();
       
    84         
       
    85         /**
       
    86          * 
       
    87          */
       
    88         void DoCancel();
       
    89 
       
    90         /**
       
    91         * From CActive
       
    92         */
       
    93         void DoRunL();
       
    94         
       
    95         /**
       
    96         * 
       
    97         */
       
    98         TInt GetOperationErrorCodeL( );
       
    99         
       
   100     private:
       
   101 
       
   102         /**
       
   103         *
       
   104         */
       
   105         CIpsPlgPop3ConnectOp(
       
   106             CMsvSession& aMsvSession,
       
   107             TRequestStatus& aObserverRequestStatus,
       
   108             TMsvId aServiceId,
       
   109             TBool aForcePopulate,
       
   110             CIpsPlgTimerOperation& aActivityTimer,
       
   111             TFSMailMsgId aFSMailBoxId,
       
   112             MFSMailRequestObserver& aFSOperationObserver,
       
   113             TInt aFSRequestId,
       
   114             CIpsPlgEventHandler* aEventHandler,
       
   115             TBool aSignallingAllowed );
       
   116 
       
   117         /**
       
   118         *
       
   119         */
       
   120         void ConstructL();
       
   121 
       
   122         /**
       
   123         *
       
   124         */
       
   125         void DoConnectL();
       
   126 
       
   127         /**
       
   128         *
       
   129         *
       
   130         */
       
   131         void DoPopulateL();
       
   132         /**
       
   133         *
       
   134         */
       
   135         TBool ValidateL();
       
   136 
       
   137         /**
       
   138         *
       
   139         */
       
   140         void QueryUsrPassL();
       
   141         
       
   142          
       
   143         /**
       
   144         *
       
   145         */
       
   146         inline void SetFlag(TUint32 aFlag);
       
   147 
       
   148         /**
       
   149         *
       
   150         */
       
   151         inline void UnsetFlag(TUint32 aFlag);
       
   152 
       
   153         /**
       
   154         *
       
   155         */
       
   156         inline TBool FlagIsSet(TUint32 aFlag) const;
       
   157 
       
   158     private: // Data
       
   159     
       
   160         enum TPopConnectStates 
       
   161             {
       
   162             EStartConnect,
       
   163             EConnected,
       
   164             EPopulate,
       
   165             EQueryingDetails,
       
   166             EErrInvalidDetails,
       
   167             EIdle
       
   168             };
       
   169 
       
   170         TInt                                            iState;
       
   171         CMsvEntry*                                      iEntry;        
       
   172         TPckgBuf<TPop3Progress>                         iProgress;
       
   173         TInt                                            iPopulateLimit;
       
   174         TBool                                           iForcePopulate;
       
   175         CMsvEntrySelection*                             iSelection;
       
   176         // not owned
       
   177         CIpsPlgEventHandler*                            iEventHandler;
       
   178     };
       
   179 
       
   180 #endif