messagingappbase/mce/src/mceui.cpp
branchRCL_3
changeset 54 fa1df4b99609
parent 53 696bfeff199e
equal deleted inserted replaced
53:696bfeff199e 54:fa1df4b99609
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <bldvariant.hrh>
    23 #include <bldvariant.hrh>
    24 #include <featmgr.h>
    24 #include <featmgr.h>
       
    25 #include <mtmuidef.hrh> 
    25 
    26 
    26 #include <messagingvariant.hrh>
    27 #include <messagingvariant.hrh>
    27 #include <centralrepository.h>
    28 #include <centralrepository.h>
    28 #include <messaginginternalcrkeys.h>
    29 #include <messaginginternalcrkeys.h>
    29 #include <CoreApplicationUIsSDKCRKeys.h>
    30 #include <CoreApplicationUIsSDKCRKeys.h>
   202 #define KUidMsgTypeFsMtmVal               0x2001F406
   203 #define KUidMsgTypeFsMtmVal               0x2001F406
   203 //CR:422-271
   204 //CR:422-271
   204 _LIT( KMmsMessageDumpDirectory, "C:\\Private\\1000484b\\mmsvar");
   205 _LIT( KMmsMessageDumpDirectory, "C:\\Private\\1000484b\\mmsvar");
   205 _LIT( KRootPath, "C:\\" );
   206 _LIT( KRootPath, "C:\\" );
   206 const TInt KMmsCodecClientChunkSize = 1024;
   207 const TInt KMmsCodecClientChunkSize = 1024;
   207 
   208 #define KMtmUiFunctionSimDialog  ( KMtmFirstFreeMtmUiFunctionId + 1 )
   208 // LOCAL FUNCTION PROTOTYPES
   209 // LOCAL FUNCTION PROTOTYPES
   209 
   210 
   210 //  ==================== LOCAL FUNCTIONS ====================
   211 //  ==================== LOCAL FUNCTIONS ====================
   211 //
   212 //
   212 
   213 
   230     iMoveOrCopyMailOperation(-1),
   231     iMoveOrCopyMailOperation(-1),
   231     iHandleNewMsgToInbox ( EFalse ),
   232     iHandleNewMsgToInbox ( EFalse ),
   232     iAnchorId( NULL ),
   233     iAnchorId( NULL ),
   233     iEmailClientIntegration(EFalse),
   234     iEmailClientIntegration(EFalse),
   234     iSelectableEmail(EFalse),
   235     iSelectableEmail(EFalse),
   235     iEmailFramework(EFalse)
   236     iEmailFramework(EFalse),
       
   237     iSimDialogOpen(EFalse)
   236     {
   238     {
   237     iMceUiFlags.SetMceFlag( EMceUiFlagsExitOnMsvMediaAvailableEvent );
   239     iMceUiFlags.SetMceFlag( EMceUiFlagsExitOnMsvMediaAvailableEvent );
   238     }
   240     }
   239 
   241 
   240 CMceUi::~CMceUi()
   242 CMceUi::~CMceUi()
   829         }
   831         }
   830 
   832 
   831     switch (aCommand)
   833     switch (aCommand)
   832         {
   834         {
   833         case EEikCmdExit:
   835         case EEikCmdExit:
       
   836             iSimDialogOpen = EFalse;
   834             Exit();
   837             Exit();
   835             break;
   838             break;
   836         case EMceCmdExit:
   839         case EMceCmdExit:
   837             CloseConnectionsBeforeExitL();
   840             CloseConnectionsBeforeExitL();
   838             if ( iMceUiFlags.MceFlag( EMceUiFlagsWantToExit ) )
   841             if ( iMceUiFlags.MceFlag( EMceUiFlagsWantToExit ) )
  2554     CBaseMtmUiData* uiData=NULL;
  2557     CBaseMtmUiData* uiData=NULL;
  2555     TUid uid;
  2558     TUid uid;
  2556     const TInt numAccounts=sel->Count();
  2559     const TInt numAccounts=sel->Count();
  2557     for (TInt cc=0; cc<numAccounts; cc++)
  2560     for (TInt cc=0; cc<numAccounts; cc++)
  2558         {
  2561         {
  2559         uid.iUid=sel->At(cc);
  2562          uid.iUid=sel->At(cc);
  2560         const TMsvEntry& tentry=iRootEntry->ChildDataL(uid.iUid);
  2563          const TMsvEntry& tentry=iRootEntry->ChildDataL(uid.iUid);
  2561 
  2564          // if cmail  feature is enabled, no need to add cmail account in connectedAccounts.
  2562         TRAPD(error, ( uiData=GetMtmUiDataL(tentry.iMtm) ) );
  2565          if ( !( iEmailFramework && 
  2563         if (error==KErrNone && uiData)
  2566                ( tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid ||
  2564             {
  2567                  tentry.iMtm.iUid == KUidMsgTypeFsMtmVal )))
  2565             TInt rid;
  2568              {
  2566             if (uiData->QueryCapability(connectCapability, rid)==KErrNone)
  2569               TRAPD(error, ( uiData=GetMtmUiDataL(tentry.iMtm) ) );
  2567                 {
  2570               if (error==KErrNone && uiData)
  2568                 if (tentry.Connected())
  2571                  {
  2569                     {
  2572                   TInt rid;
  2570                     connectedAccounts->AppendL( sel->At(cc) );
  2573                   if (uiData->QueryCapability(connectCapability, rid)==KErrNone)
  2571                     }
  2574                      {
  2572                 }
  2575                       if (tentry.Connected())
  2573             }
  2576                          {
       
  2577                           connectedAccounts->AppendL( sel->At(cc) );
       
  2578                          }
       
  2579                      }
       
  2580                  }
       
  2581              }  
  2574         }
  2582         }
  2575     CleanupStack::PopAndDestroy( sel );
  2583     CleanupStack::PopAndDestroy( sel );
  2576     MCELOGGER_LEAVEFN("ConnectedServicesLC()");
  2584     MCELOGGER_LEAVEFN("ConnectedServicesLC()");
  2577     return connectedAccounts;
  2585     return connectedAccounts;
  2578     }
  2586     }
  4482         }
  4490         }
  4483 
  4491 
  4484     TBuf8<1> buf;
  4492     TBuf8<1> buf;
  4485     if (!(aFunction.iFlags&EMtudAsynchronous))
  4493     if (!(aFunction.iFlags&EMtudAsynchronous))
  4486         {
  4494         {
       
  4495         if(aFunction.iFuncId == KMtmUiFunctionSimDialog)
       
  4496             {
       
  4497             iSimDialogOpen = ETrue;
       
  4498             }
  4487         mtmUi.InvokeSyncFunctionL(aFunction.iFuncId, *sel, buf);
  4499         mtmUi.InvokeSyncFunctionL(aFunction.iFuncId, *sel, buf);
  4488         }
  4500         }
  4489     else
  4501     else
  4490         {
  4502         {
  4491         CMsvSingleOpWatcher* singleOpWatcher = CMsvSingleOpWatcher::NewL( *this );
  4503         CMsvSingleOpWatcher* singleOpWatcher = CMsvSingleOpWatcher::NewL( *this );
  6647 // ----------------------------------------------------
  6659 // ----------------------------------------------------
  6648 // CMceUi::ResetAndHide
  6660 // CMceUi::ResetAndHide
  6649 // ----------------------------------------------------
  6661 // ----------------------------------------------------
  6650 void CMceUi::ResetAndHide()
  6662 void CMceUi::ResetAndHide()
  6651     {
  6663     {
  6652 	if (!MceViewActive( EMceMainViewActive ))
  6664     // To close embedded MsgEditor
       
  6665     if ( IsEditorOpen() )
       
  6666         {
       
  6667         CloseEditorApp();
       
  6668         }
       
  6669     // Messaging was not exiting properly when "exit" is pressed from settings dialog.
       
  6670     // iMceUiFlags.MceFlag( EMceUiFlagsSettingsDialogOpen ) will be true 
       
  6671     // when we exit from any of the settings Dialog. 
       
  6672     // Closing of Settings dialogs will be taken care by AVKON. 
       
  6673 	if (!(MceViewActive( EMceMainViewActive) && IsForeground()) || 
       
  6674 	      iMceUiFlags.MceFlag( EMceUiFlagsSettingsDialogOpen ) || iSimDialogOpen )
  6653         {
  6675         {
  6654         SetCustomControl(1);    // Disable bring-to-foreground on view activation
  6676         SetCustomControl(1);    // Disable bring-to-foreground on view activation
  6655         TRAP_IGNORE( CAknViewAppUi::CreateActivateViewEventL( \
  6677         TRAP_IGNORE( CAknViewAppUi::CreateActivateViewEventL( \
  6656             KMessagingCentreMainViewUid, \
  6678             KMessagingCentreMainViewUid, \
  6657             TUid::Uid(KMceHideInBackground), \
  6679             TUid::Uid(KMceHideInBackground), \
  6658             KNullDesC8 ) ) ;
  6680             KNullDesC8 ) ) ;
       
  6681         iSimDialogOpen = EFalse;
  6659         }
  6682         }
  6660     else
  6683     else
  6661         {
  6684         {
  6662         SetCustomControl(0); // Enable bring-to-foreground on view activation
  6685         SetCustomControl(0); // Enable bring-to-foreground on view activation
  6663         }
  6686         }