ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp
changeset 76 38bf5461e270
parent 56 15bc1d5d6267
equal deleted inserted replaced
74:6c59112cfd31 76:38bf5461e270
    27 // CIpsPlgImap4ConnectOp::NewL()
    27 // CIpsPlgImap4ConnectOp::NewL()
    28 // ----------------------------------------------------------------------------
    28 // ----------------------------------------------------------------------------
    29 // <qmail> priority parameter has been removed
    29 // <qmail> priority parameter has been removed
    30 // <qmail> MFSMailRequestObserver& changed it to pointer
    30 // <qmail> MFSMailRequestObserver& changed it to pointer
    31 // <qmail> aSignallingAllowed parameter has been removed
    31 // <qmail> aSignallingAllowed parameter has been removed
       
    32 // <qmail> silent connection parameter added
    32 CIpsPlgImap4ConnectOp* CIpsPlgImap4ConnectOp::NewL(
    33 CIpsPlgImap4ConnectOp* CIpsPlgImap4ConnectOp::NewL(
    33     CMsvSession& aMsvSession,
    34     CMsvSession& aMsvSession,
    34     TRequestStatus& aObserverRequestStatus,
    35     TRequestStatus& aObserverRequestStatus,
    35     TMsvId aService,
    36     TMsvId aService,
    36     CIpsPlgTimerOperation& aActivityTimer,
    37     CIpsPlgTimerOperation& aActivityTimer,
    37     TFSMailMsgId aFSMailBoxId,
    38     TFSMailMsgId aFSMailBoxId,
    38     MFSMailRequestObserver* aFSOperationObserver,
    39     MFSMailRequestObserver* aFSOperationObserver,
    39     TInt aFSRequestId,
    40     TInt aFSRequestId,
    40     CIpsPlgEventHandler* aEventHandler,
    41     CIpsPlgEventHandler* aEventHandler,
    41     TBool aDoPlainConnect )
    42     TBool aDoPlainConnect,
       
    43     TBool aSilentConnection)
    42     {
    44     {
    43     FUNC_LOG;
    45     FUNC_LOG;
    44     CIpsPlgImap4ConnectOp* self = new (ELeave) CIpsPlgImap4ConnectOp(
    46     CIpsPlgImap4ConnectOp* self = new (ELeave) CIpsPlgImap4ConnectOp(
    45         aMsvSession, 
    47         aMsvSession, 
    46         aObserverRequestStatus,
    48         aObserverRequestStatus,
    48         aActivityTimer,
    50         aActivityTimer,
    49         aFSMailBoxId, 
    51         aFSMailBoxId, 
    50         aFSOperationObserver,
    52         aFSOperationObserver,
    51         aFSRequestId,
    53         aFSRequestId,
    52         aDoPlainConnect,
    54         aDoPlainConnect,
    53         aEventHandler );
    55         aEventHandler,
       
    56         aSilentConnection);
    54         
    57         
    55     CleanupStack::PushL( self );
    58     CleanupStack::PushL( self );
    56     self->ConstructL();
    59     self->ConstructL();
    57     CleanupStack::Pop( self );
    60     CleanupStack::Pop( self );
    58     return self;
    61     return self;
    62 // CIpsPlgImap4ConnectOp::CIpsPlgImap4ConnectOp()
    65 // CIpsPlgImap4ConnectOp::CIpsPlgImap4ConnectOp()
    63 // ----------------------------------------------------------------------------
    66 // ----------------------------------------------------------------------------
    64 // <qmail> priority parameter has been removed
    67 // <qmail> priority parameter has been removed
    65 // <qmail> MFSMailRequestObserver& changed it to pointer
    68 // <qmail> MFSMailRequestObserver& changed it to pointer
    66 // <qmail> aSignallingAllowed parameter has been removed
    69 // <qmail> aSignallingAllowed parameter has been removed
       
    70 // <qmail> silent connection parameter added
    67 CIpsPlgImap4ConnectOp::CIpsPlgImap4ConnectOp(
    71 CIpsPlgImap4ConnectOp::CIpsPlgImap4ConnectOp(
    68     CMsvSession& aMsvSession,
    72     CMsvSession& aMsvSession,
    69     TRequestStatus& aObserverRequestStatus,
    73     TRequestStatus& aObserverRequestStatus,
    70     TMsvId aService,
    74     TMsvId aService,
    71     CIpsPlgTimerOperation& aActivityTimer,
    75     CIpsPlgTimerOperation& aActivityTimer,
    72     TFSMailMsgId aFSMailBoxId,
    76     TFSMailMsgId aFSMailBoxId,
    73     MFSMailRequestObserver* aFSOperationObserver,
    77     MFSMailRequestObserver* aFSOperationObserver,
    74     TInt aFSRequestId,
    78     TInt aFSRequestId,
    75     TBool aDoPlainConnect,
    79     TBool aDoPlainConnect,
    76     CIpsPlgEventHandler* aEventHandler)
    80     CIpsPlgEventHandler* aEventHandler,
       
    81     TBool aSilentConnection)
    77     :
    82     :
    78     CIpsPlgOnlineOperation(
    83     CIpsPlgOnlineOperation(
    79 	    aMsvSession,
    84 	    aMsvSession,
    80 	    aObserverRequestStatus,
    85 	    aObserverRequestStatus,
    81 	    aActivityTimer,
    86 	    aActivityTimer,
    84 	    aFSRequestId ),
    89 	    aFSRequestId ),
    85     iState( EStateIdle ),
    90     iState( EStateIdle ),
    86     iSelection( NULL ),
    91     iSelection( NULL ),
    87     iDoPlainConnect( aDoPlainConnect ),
    92     iDoPlainConnect( aDoPlainConnect ),
    88     iEventHandler( aEventHandler ),
    93     iEventHandler( aEventHandler ),
    89     iIsSyncStartedSignaled( EFalse )
    94     iIsSyncStartedSignaled( EFalse ),
       
    95     iSilentConnection( aSilentConnection )
    90     {
    96     {
    91     FUNC_LOG;
    97     FUNC_LOG;
    92     iService = aService;
    98     iService = aService;
    93     }
    99     }
    94 
   100 
   339     if ( iDoPlainConnect && !Connected() )
   345     if ( iDoPlainConnect && !Connected() )
   340         {
   346         {
   341         TBuf8<1> parameter;
   347         TBuf8<1> parameter;
   342         NM_COMMENT("CIpsPlgImap4ConnectOp: do plain connect");
   348         NM_COMMENT("CIpsPlgImap4ConnectOp: do plain connect");
   343         // connect and synchronise starts background sync or idle
   349         // connect and synchronise starts background sync or idle
       
   350         // select connection type based on iSilentConnection
       
   351         // NOTE: Cannot be implemented yet, because MTM support is not released yet
   344         iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
   352         iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
   345             KIMAP4MTMConnect, *iSelection, parameter, iStatus);
   353             KIMAP4MTMConnect, *iSelection, parameter, iStatus);
   346         }
   354         }
   347     else if ( Connected() )
   355     else if ( Connected() )
   348         {
   356         {
   356     else
   364     else
   357         {
   365         {
   358         // the used command requires an observer to be given even though we're not using it
   366         // the used command requires an observer to be given even though we're not using it
   359         NM_COMMENT("CIpsPlgImap4ConnectOp: connect and sync");
   367         NM_COMMENT("CIpsPlgImap4ConnectOp: connect and sync");
   360         TPckg<MMsvImapConnectionObserver*> parameter( NULL );
   368         TPckg<MMsvImapConnectionObserver*> parameter( NULL );
       
   369         // select connection type based on iSilentConnection
       
   370         // NOTE: Cannot be implemented yet, because MTM support is not released yet
   361         iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
   371         iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
   362             KIMAP4MTMConnectAndSyncCompleteAfterFullSync, 
   372             KIMAP4MTMConnectAndSyncCompleteAfterFullSync, 
   363             *iSelection, parameter, iStatus );
   373             *iSelection, parameter, iStatus );
   364         }
   374         }
   365     SignalSyncStarted();
   375     SignalSyncStarted();