ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h
branchRCL_3
changeset 64 3533d4323edc
parent 63 d189ee25cf9d
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
    24 
    24 
    25 /**
    25 /**
    26 * Connect operation.
    26 * Connect operation.
    27 * Encapsulates connection validation.
    27 * Encapsulates connection validation.
    28 */
    28 */
    29 NONSHARABLE_CLASS ( CIpsPlgPop3ConnectOp ) :
    29 class CIpsPlgPop3ConnectOp :
    30     public CIpsPlgOnlineOperation
    30     public CIpsPlgOnlineOperation,
    31     // public MIpsPlgConnectOpCallback <qmail> not used any more
    31     public MIpsPlgConnectOpCallback
    32     {
    32     {
    33     // <qmail> MIpsPlgConnectOpCallback not used any more
    33 public://from MIpsPlgConnectOpCallback
    34 public:
    34     
       
    35     void CredientialsSetL( TInt aEvent );
       
    36     public:
    35 
    37 
    36 	    /**
    38         /**
    37 	    * NewL
    39         *
    38 	    * @param aMsvSession client/server session to MsvServer
    40         */
    39 	    * @param aObserverRequestStatus client status
       
    40 	    * @param aService serviceId of the mailbox
       
    41 	    * @param aForcePopulate whether to populate fetched messages
       
    42 	    * @param aActivityTimer mailbox specific activity timer
       
    43 	    * @param aFSMailBoxId specifies mailbox
       
    44 	    * @param aFSOperationObserver observer callback pointer
       
    45 	    * @param aFSRequestId client assigned identifier for the request instance
       
    46 	    * @param aEventHandler event handler for sending sync events
       
    47 	    * @param aSignallingAllowed for asynchronous request response message
       
    48 	    * @param aFetchWillFollow used when connection must be kept open
       
    49 	    * @return new instance of the class
       
    50 	    */
       
    51 		// <qmail> MFSMailRequestObserver& changed to pointer
       
    52 		// <qmail> aSignallingAllowed parameter added
       
    53         // <qmail> aFetchWillFollow parameter added
       
    54         static CIpsPlgPop3ConnectOp* NewL(
    41         static CIpsPlgPop3ConnectOp* NewL(
    55             CMsvSession& aMsvSession,
    42             CMsvSession& aMsvSession,
    56             TRequestStatus& aObserverRequestStatus,
    43             TRequestStatus& aObserverRequestStatus,
    57             TMsvId aService,
    44             TMsvId aService,
    58             TBool aForcePopulate,
    45             TBool aForcePopulate,
    59             CIpsPlgTimerOperation& aActivityTimer,
    46             CIpsPlgTimerOperation& aActivityTimer,
    60             TFSMailMsgId aFSMailBoxId,
    47             TFSMailMsgId aFSMailBoxId,
    61             MFSMailRequestObserver* aFSOperationObserver,
    48             MFSMailRequestObserver& aFSOperationObserver,
    62             TInt aFSRequestId,
    49             TInt aFSRequestId,
    63             CIpsPlgEventHandler* aEventHandler,
    50             CIpsPlgEventHandler* aEventHandler=NULL,
    64             TBool aSignallingAllowed=ETrue,
    51             TBool aSignallingAllowed=ETrue );
    65             TBool aFetchWillFollow=EFalse );
       
    66 
    52 
    67         /**
    53         /**
    68         *
    54         *
    69         */
    55         */
    70         virtual ~CIpsPlgPop3ConnectOp();
    56         virtual ~CIpsPlgPop3ConnectOp();
    71 
    57 
    72         /**
    58         /**
    73 	    * From CIpsPlgBaseOperation
    59         *
    74 	    * For reporting if DoRunL leaves
       
    75         */
    60         */
    76         const TDesC8& GetErrorProgressL(TInt aError);
    61         const TDesC8& GetErrorProgressL(TInt aError);
    77         
    62         
    78         /**
    63         /**
    79         *
    64         *
    80         */
    65         */
    81         TFSProgress GetFSProgressL() const;
    66         TFSProgress GetFSProgressL() const;
    82 
    67 
    83 	    /**
    68         /**
    84 	    * From MsvOperation
    69         *
    85 	    * Gets information on the progress of the operation
    70         */
    86 	    * (see MsvOperation header)
    71         TBool Connected() const;
    87 	    */
       
    88 	    // <qmail> moved to 'public:'as defined so in base class
       
    89 	    const TDesC8& ProgressL();
       
    90 // <qmail> Connected() used from baseclass
       
    91         
    72         
    92 // <qmail> change ret val type
       
    93         /**
    73         /**
    94          * Returns operation type
    74         *
    95          */
    75         */
    96         TIpsOpType IpsOpType() const;
    76         virtual TInt IpsOpType() const;
    97 // </qmail>
       
    98 
    77 
    99         TInt GetOperationErrorCodeL( );
       
   100         
       
   101     protected:
    78     protected:
   102 
    79 
       
    80         /**
       
    81         * 
       
    82         */
       
    83         const TDesC8& ProgressL();
       
    84         
   103         /**
    85         /**
   104          * 
    86          * 
   105          */
    87          */
   106         void DoCancel();
    88         void DoCancel();
   107 
    89 
   108         /**
    90         /**
   109         * From CActive
    91         * From CActive
   110         */
    92         */
   111         void DoRunL();
    93         void DoRunL();
   112         
    94         
       
    95         /**
       
    96         * 
       
    97         */
       
    98         TInt GetOperationErrorCodeL( );
       
    99         
   113     private:
   100     private:
   114 
   101 
   115         /**
   102         /**
   116         *
   103         *
   117         */
   104         */
   118 		// <qmail> MFSMailRequestObserver& changed to pointer
       
   119 		// <qmail> aSignallingAllowed parameter added
       
   120         // <qmail> aFetchWillFollow parameter added
       
   121         CIpsPlgPop3ConnectOp(
   105         CIpsPlgPop3ConnectOp(
   122             CMsvSession& aMsvSession,
   106             CMsvSession& aMsvSession,
   123             TRequestStatus& aObserverRequestStatus,
   107             TRequestStatus& aObserverRequestStatus,
   124             TMsvId aServiceId,
   108             TMsvId aServiceId,
   125             TBool aForcePopulate,
   109             TBool aForcePopulate,
   126             CIpsPlgTimerOperation& aActivityTimer,
   110             CIpsPlgTimerOperation& aActivityTimer,
   127             TFSMailMsgId aFSMailBoxId,
   111             TFSMailMsgId aFSMailBoxId,
   128             MFSMailRequestObserver* aFSOperationObserver,
   112             MFSMailRequestObserver& aFSOperationObserver,
   129             TInt aFSRequestId,
   113             TInt aFSRequestId,
   130             CIpsPlgEventHandler* aEventHandler,
   114             CIpsPlgEventHandler* aEventHandler,
   131             TBool aSignallingAllowed,
   115             TBool aSignallingAllowed );
   132             TBool aFetchWillFollow );
       
   133 
   116 
   134         /**
   117         /**
   135         *
   118         *
   136         */
   119         */
   137         void ConstructL();
   120         void ConstructL();
   138 
   121 
   139         // <qmail>
       
   140         /**
   122         /**
   141          * Do.. functions handle certain state of this operation
   123         *
       
   124         */
       
   125         void DoConnectL();
       
   126 
       
   127         /**
       
   128         *
       
   129         *
       
   130         */
       
   131         void DoPopulateL();
       
   132         /**
       
   133         *
       
   134         */
       
   135         TBool ValidateL();
       
   136 
       
   137         /**
       
   138          * Send user password query request to CIpsPlgEventHandler
       
   139          * @return ETrue - if query send
   142          */
   140          */
   143         void DoConnectL();
   141         TBool QueryUserPassL();
   144         void DoPopulateL();
       
   145 	    // <qmail> removed TBool ValidateL() (did nothing)
       
   146 	    // <qmail> removed void DoQueryPasswordL() not used any more
       
   147         // <qmail> DoDisconnect -> DoDisconnectL
       
   148         void DoDisconnectL();
       
   149 		// </qmail>
       
   150         
   142         
   151         // <qmail> removed flag methods as they were not used or even defined anywhere
   143          
   152         
   144         /**
   153 	    // <qmail> new function
   145         *
   154 	    /**
   146         */
   155 	     * Reads populate limit from account's settings and converts it to member variable
   147         inline void SetFlag(TUint32 aFlag);
   156 	     */
   148 
   157 	    TInt GetPopulateLimitFromSettingsL();
   149         /**
       
   150         *
       
   151         */
       
   152         inline void UnsetFlag(TUint32 aFlag);
       
   153 
       
   154         /**
       
   155         *
       
   156         */
       
   157         inline TBool FlagIsSet(TUint32 aFlag) const;
       
   158 
   158     private: // Data
   159     private: // Data
   159     
   160     
   160     	enum TOperationState 
   161         enum TPopConnectStates 
   161             {
   162             {
   162             EStartConnect,
   163             EStartConnect,
   163             EConnected,
   164             EConnected,
   164             EPopulate,
   165             EPopulate,
   165             // <qmail> removed EQueryingDetails/EQueryingDetailsBusy state
   166             EQueryingDetails,
   166         	// <qmail> new EDisconnecting state
   167             EQueryingDetailsBusy,
   167             EDisconnecting,
       
   168         	// <qmail> removed EErrInvalidDetails,
       
   169             EIdle
   168             EIdle
   170             };
   169             };
   171 
   170 
   172 	    TOperationState                                 iState;
   171         TInt                                            iState;
   173 	    // <qmail> removed iEntry;
   172         CMsvEntry*                                      iEntry;        
   174 	    TPckgBuf<TPop3Progress>                         iProgress;
   173         TPckgBuf<TPop3Progress>                         iProgress;
   175 	    // <qmail> removed iPopulateLimit;
   174         TInt                                            iPopulateLimit;
   176 	    TBool                                           iForcePopulate;
   175         TBool                                           iForcePopulate;
   177 	    // <qmail> removed iSelection;
   176         CMsvEntrySelection*                             iSelection;
   178 	    CIpsPlgEventHandler*                            iEventHandler; // not owned
   177         // not owned
   179 	    // <qmail> iAlreadyConnected removed
   178         CIpsPlgEventHandler*                            iEventHandler;
   180         // <qmail>
   179         // set to true if connection is already exists
   181         TBool                                           iFetchWillFollow;
   180         TBool iAlreadyConnected;
   182         // </qmail>
       
   183     };
   181     };
   184 
   182 
   185 #endif
   183 #endif