--- a/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp Tue Aug 31 15:04:17 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp Wed Sep 01 12:28:57 2010 +0100
@@ -17,66 +17,66 @@
*/
-// <qmail> aknmessagequerydialog include removed
+#include <aknmessagequerydialog.h>
#include "emailtrace.h"
#include "ipsplgheaders.h"
-// <qmail> ipssossettings rsg removed
-// <qmail> fsmailserver rsg removed
+#include <ipssossettings.rsg>
+#include <fsmailserver.rsg> // For R_FS_MSERVER_*
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-// <qmail> priority parameter removed, aSelection moved from ConstructL -> constructor
-// <qmail> MFSMailRequestObserver& changed to pointer
-// <qmail> renamed selection parameter
-CIpsPlgConnectAndRefreshFolderList* CIpsPlgConnectAndRefreshFolderList::NewL(
- CMsvSession& aSession,
- TRequestStatus& aObserverRequestStatus,
- TMsvId aService,
- TFSMailMsgId& aMailboxId,
- CMsvEntrySelection* aSelection,
- MFSMailRequestObserver* aFSObserver,
- CIpsPlgTimerOperation& aTimer )
+EXPORT_C CIpsPlgConnectAndRefreshFolderList*
+ CIpsPlgConnectAndRefreshFolderList::NewL(
+ CMsvSession& aSession,
+ TInt aPriority,
+ TRequestStatus& aObserverRequestStatus,
+ TMsvId aService,
+ TFSMailMsgId& aMailboxId,
+ CMsvEntrySelection& aMsvEntry,
+ MFSMailRequestObserver& aFSObserver,
+ CIpsPlgTimerOperation& aTimer )
{
FUNC_LOG;
- CIpsPlgConnectAndRefreshFolderList* self = new (ELeave) CIpsPlgConnectAndRefreshFolderList(
- aSession,
- aObserverRequestStatus,
- aService,
- aMailboxId,
- aSelection,
- aFSObserver,
- aTimer );
+ CIpsPlgConnectAndRefreshFolderList* self=
+ new (ELeave) CIpsPlgConnectAndRefreshFolderList(
+ aSession,
+ aPriority,
+ aObserverRequestStatus,
+ aService,
+ aMailboxId,
+ aFSObserver,
+ aTimer );
CleanupStack::PushL( self );
- self->ConstructL();
+ self->ConstructL( aMsvEntry );
CleanupStack::Pop( self );
return self;
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-// <qmail> priority parameter removed, aSelection moved from ConstructL -> constructor
-// <qmail> MFSMailRequestObserver& changed to pointer
-// <qmail> renamed selection parameter
CIpsPlgConnectAndRefreshFolderList::CIpsPlgConnectAndRefreshFolderList(
CMsvSession& aSession,
+ TInt aPriority,
TRequestStatus& aObserverRequestStatus,
TMsvId aService,
TFSMailMsgId& aMailboxId,
- CMsvEntrySelection* aSelection,
- MFSMailRequestObserver* aFSObserver,
+ MFSMailRequestObserver& aFSObserver,
CIpsPlgTimerOperation& aTimer )
- :
- CIpsPlgOnlineOperation(
- aSession,
- aObserverRequestStatus,
- aTimer,
- aMailboxId,
- aFSObserver,
- 0 ), // requestId
- iState( EIdle ),
- iSelection( aSelection )
+ :
+ CIpsPlgOnlineOperation(
+ aSession,
+ aPriority,
+ aObserverRequestStatus,
+ aTimer,
+ aMailboxId,
+ aFSObserver,
+ 0, // FSRequestId
+ EFalse), // SignallingAllowed
+ iState( EIdle ),
+ iTimer( NULL ),
+ iMsvEntry( NULL )
{
FUNC_LOG;
iService = aService;
@@ -84,11 +84,12 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-// <qmail> aMsvEntry removed
-void CIpsPlgConnectAndRefreshFolderList::ConstructL()
+void CIpsPlgConnectAndRefreshFolderList::ConstructL(
+ CMsvEntrySelection& aMsvEntry )
{
FUNC_LOG;
BaseConstructL( KSenduiMtmImap4Uid );
+ iMsvEntry = aMsvEntry.CopyL();
iState = EStartConnect;
DoRunL();
}
@@ -99,10 +100,38 @@
{
FUNC_LOG;
Cancel();
- delete iSelection;
+ delete iMsvEntry;
+ }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgConnectAndRefreshFolderList::StepL()
+ {
+ FUNC_LOG;
}
-// <qmail> removed 3 functions from MAknBackgroundProcess
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TBool CIpsPlgConnectAndRefreshFolderList::IsProcessDone() const
+ {
+ FUNC_LOG;
+ TBool ret = EFalse;
+ if ( iState == ECompleted )
+ {
+ ret = ETrue;
+ }
+ return ret;
+ }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgConnectAndRefreshFolderList::DialogDismissedL(TInt /*aButtonId*/)
+ {
+ FUNC_LOG;
+ }
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
@@ -114,7 +143,8 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-const TDesC8& CIpsPlgConnectAndRefreshFolderList::GetErrorProgressL( TInt aError )
+const TDesC8& CIpsPlgConnectAndRefreshFolderList::GetErrorProgressL(
+ TInt aError )
{
FUNC_LOG;
TImap4CompoundProgress& prog = iProgressBuf();
@@ -136,95 +166,120 @@
void CIpsPlgConnectAndRefreshFolderList::DoRunL()
{
FUNC_LOG;
+ MFSMailRequestObserver* observer = NULL;
+ int err = iStatus.Int();
- if( iStatus.Int() != KErrNone )
-// </qmail>
+ if ( err != KErrNone )
{
iState = ECompleted;
-// <qmail> DisplayLoginFailedDialogL removed
- CompleteObserver();
+ if( err == KErrImapBadLogon )
+ {
+ DisplayLoginFailedDialogL();
+ RunError(err);
+ }
+ else
+ {
+ CompleteObserver();
+ }
return;
- }
+ }
- switch(iState)
+ TBuf8<1> dummyParam;
+ switch( iState )
{
case EStartConnect:
- delete iSubOperation;
- iSubOperation = NULL;
- // <qmail> priority parameter has been removed
- iSubOperation = CIpsPlgImap4ConnectOp::NewL(
- iMsvSession,
- iStatus,
- iService,
- *iActivityTimer,
- iFSMailboxId,
- NULL, // no observer for suboperations
- 0, // no requestId needed
- NULL, // Event handler
- ETrue ); // Plain connect
+ delete iOperation;
+ iOperation = NULL;
+ InvokeClientMtmAsyncFunctionL(
+ KIMAP4MTMConnect,
+ *iMsvEntry,
+ iService,
+ dummyParam );
iState = EConnecting;
SetActive();
break;
- case EConnecting:
- {
- // We have successfully completed connecting
- TBuf8<1> dummyParam;
- delete iSubOperation;
- iSubOperation = NULL;
- InvokeClientMtmAsyncFunctionL( KIMAP4MTMSyncTree, *iSelection, dummyParam ); // <qmail> 1 param removed
- iState = ERefreshing;
- SetActive();
- }
- break;
- case ERefreshing:
- // We have successfully completed refreshing the folder list
- delete iSubOperation;
- iSubOperation = NULL;
- iSubOperation = CIpsPlgDisconnectOp::NewL(
- iMsvSession,
- iStatus,
- iService,
- *iActivityTimer,
- iFSMailboxId,
- NULL, // no observer for suboperations
- 0 ); // no requestId needed
- iState = EDisconnecting;
- SetActive();
- break;
- case EDisconnecting:
- iState = ECompleted;
- CompleteObserver();
- break;
- default:
- User::Panic( KIpsPlgPanicCategory, EIpsPlgNoParameters );
- break;
+ case EConnecting:
+ {
+ // We have successfully completed connecting
+
+ delete iOperation;
+ iOperation = NULL;
+ InvokeClientMtmAsyncFunctionL(
+ KIMAP4MTMSyncTree,
+ *iMsvEntry,
+ iService,
+ dummyParam );
+ iState = ERefreshing;
+ SetActive();
+ }
+ break;
+ case ERefreshing:
+ // We have successfully completed refreshing the folder list
+ delete iOperation;
+ iOperation = NULL;
+ iOperation = CIpsPlgDisconnectOp::NewL(
+ iMsvSession,
+ iStatus,
+ iService,
+ *iTimer,
+ iFSMailboxId,
+ *observer,
+ NULL );
+ iState = EDisconnecting;
+ SetActive();
+ break;
+ case EDisconnecting:
+ iState = ECompleted;
+ CompleteObserver();
+ break;
+ default:
+ User::Panic( KIpsPlgPanicCategory, EIpsPlgNoParameters );
+ break;
}
}
// ----------------------------------------------------------------------------
+// CIpsPlgOnlineOperation::DoCancel()
// ----------------------------------------------------------------------------
//
void CIpsPlgConnectAndRefreshFolderList::DoCancel()
{
FUNC_LOG;
- if( iSubOperation )
+ if( iOperation )
{
- iSubOperation->Cancel();
+ iOperation->Cancel();
}
CompleteObserver( KErrCancel );
iState = ECompleted;
}
-
-// <qmail> removed in Qmail
-//void CIpsPlgConnectAndRefreshFolderList::DisplayLoginFailedDialogL()
-// </qmail>
-
-// <qmail> new func to this op
+// ----------------------------------------------------------------------------
+// CIpsPlgConnectAndRefreshFolderList::DisplayLoginFailedDialogL()
// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-TIpsOpType CIpsPlgConnectAndRefreshFolderList::IpsOpType() const
+//
+void CIpsPlgConnectAndRefreshFolderList::DisplayLoginFailedDialogL()
{
- FUNC_LOG;
- return EIpsOpTypeConnectAndRefreshFolderListOp;
+ // Get the TMsvEntry for the mailbox, which we use to get its name.
+ TMsvId serviceId;
+ TMsvEntry mailboxServiceEntry;
+ User::LeaveIfError( iMsvSession.GetEntry( iFSMailboxId.Id(), serviceId, mailboxServiceEntry ) );
+
+ // Load/construct the strings for the dialog.
+ HBufC* headerText( NULL );
+ headerText = StringLoader::LoadLC( R_FS_MSERVER_MAILBOX_NAME, mailboxServiceEntry.iDetails );
+ HBufC* text( NULL );
+ text = StringLoader::LoadLC( R_FS_MSERVER_TEXT_LOGIN_FAILED );
+
+ // Create and display the dialog.
+ CAknMessageQueryDialog *dlg = new (ELeave) CAknMessageQueryDialog;
+ dlg->PrepareLC( R_FS_MSERVER_DIALOG_MESSAGE_QUERY );
+ dlg->SetHeaderTextL( headerText->Des() );
+ dlg->SetMessageTextL( text->Des() );
+ dlg->RunLD();
+
+ CleanupStack::PopAndDestroy( text );
+ CleanupStack::PopAndDestroy( headerText );
}
+
+// End of File
+