emailuis/emailui/src/ncscomposeview.cpp
branchRCL_3
changeset 26 968773a0b6ef
parent 25 3533d4323edc
equal deleted inserted replaced
25:3533d4323edc 26:968773a0b6ef
    85     : CFsEmailUiViewBase( aSendAttachmentControlGroup, aAppUi ),
    85     : CFsEmailUiViewBase( aSendAttachmentControlGroup, aAppUi ),
    86      iMailClient( aMailClient ), iOrigMessage( NULL ), iNewMessage( NULL ),
    86      iMailClient( aMailClient ), iOrigMessage( NULL ), iNewMessage( NULL ),
    87      iMsvSession( aMsvSession ), iEnv( aEnv ),
    87      iMsvSession( aMsvSession ), iEnv( aEnv ),
    88      iFakeSyncGoingOn(EFalse), iFetchDialogCancelled(EFalse),
    88      iFakeSyncGoingOn(EFalse), iFetchDialogCancelled(EFalse),
    89      iExecutingDoExitL( EFalse ),
    89      iExecutingDoExitL( EFalse ),
    90      iMessageTextPartModified( EFalse ), iMessageModified( EFalse )
    90      iMessageTextPartModified( EFalse ), iMessageModified( EFalse ), 
    91     {
    91      iIncludeMessageTextAsync( EFalse ), iChildActivationState( EChildActivationDeactivated )
    92     FUNC_LOG;
    92     {
       
    93     FUNC_LOG; 
    93 
    94 
    94     iAttachmentListSaveDraft = EFalse;
    95     iAttachmentListSaveDraft = EFalse;
    95 
    96 
    96     }
    97     }
    97 
    98 
   287 //
   288 //
   288 void CNcsComposeView::ChildDoActivateL( const TVwsViewId& aPrevViewId,
   289 void CNcsComposeView::ChildDoActivateL( const TVwsViewId& aPrevViewId,
   289     TUid aCustomMessageId, const TDesC8& aCustomMessage )
   290     TUid aCustomMessageId, const TDesC8& aCustomMessage )
   290     {
   291     {
   291     FUNC_LOG;
   292     FUNC_LOG;
   292     
   293     iChildActivationState = EChildActivationStarted;
   293     // needed when "Opening" (replying/forwarding)note is shown and 
   294     // needed when "Opening" (replying/forwarding)note is shown and 
   294     // we receive incoming call- Email application goes to background.
   295     // we receive incoming call- Email application goes to background.
   295     // When coming back to application the view is activated and reseted.
   296     // When coming back to application the view is activated and reseted.
   296     // That's why we prevent activation and the same is done in ChildDoDeactivate
   297     // That's why we prevent activation and the same is done in ChildDoDeactivate
   297     if ( iIncludeMessageTextAsync )
   298     if ( iIncludeMessageTextAsync )
   433         iContainer->SetMskL();
   434         iContainer->SetMskL();
   434         iViewReady = ETrue;
   435         iViewReady = ETrue;
   435         Toolbar()->SetDimmed( EFalse );
   436         Toolbar()->SetDimmed( EFalse );
   436         RefreshToolbar();
   437         RefreshToolbar();
   437         iContainer->ActivateL();
   438         iContainer->ActivateL();
   438         }
   439 
   439         
   440         
   440     // if there is a embedded app in FSEmail.
   441     // if there is a embedded app in FSEmail.
   441     if( iAppUi.EmbeddedApp() )
   442     if( iAppUi.EmbeddedApp() )
   442         {
   443             {
   443         // Set email editor started from embedded app flag to true 
   444             // Set email editor started from embedded app flag to true 
   444         // so that we can switch view correct when sent email.
   445             // so that we can switch view correct when sent email.
   445         iAppUi.SetEditorStartedFromEmbeddedApp( ETrue );
   446             iAppUi.SetEditorStartedFromEmbeddedApp( ETrue );
   446         
   447         
   447         RWsSession rwsSession;
   448         RWsSession rwsSession;
   448         User::LeaveIfError( rwsSession.Connect() );
   449             User::LeaveIfError( rwsSession.Connect() );
   449         CleanupClosePushL( rwsSession );
   450             CleanupClosePushL( rwsSession );
   450         
   451         
   451         // Simulate a back key to exit embedded app 
   452         // Simulate a back key to exit embedded app 
   452         // so that email editor could show on the top level.
   453             // so that email editor could show on the top level.
   453         TKeyEvent KeyEvent = TKeyEvent();
   454             TKeyEvent KeyEvent = TKeyEvent();
   454         // this is neccesary for photogalery image viewer (don't remove)
   455             // this is neccesary for photogalery image viewer (don't remove)
   455         KeyEvent.iScanCode = EStdKeyUpArrow;
   456             KeyEvent.iScanCode = EStdKeyUpArrow;
   456         rwsSession.SimulateKeyEvent( KeyEvent );
   457             rwsSession.SimulateKeyEvent( KeyEvent );
   457         KeyEvent.iCode = EKeyCBA2;
   458             KeyEvent.iCode = EKeyCBA2;
   458         rwsSession.SimulateKeyEvent( KeyEvent );
   459             rwsSession.SimulateKeyEvent( KeyEvent );
   459 
   460 
   460         rwsSession.Close();
   461         rwsSession.Close();
   461         CleanupStack::PopAndDestroy( &rwsSession );
   462             CleanupStack::PopAndDestroy( &rwsSession );
   462         }
   463             }
   463     
   464     
   464     if ( iIncludeMessageTextAsync )
   465     if ( iIncludeMessageTextAsync )
   465     	{
   466             {
   466 		// including message body in async way
   467             // including message body in async way
   467 		IncludeMessageTextAsyncL( ETrue );
   468             IncludeMessageTextAsyncL( ETrue );
   468     	}
   469             }
   469     
   470 
   470     iViewFullyActivated = ETrue;
   471         iViewFullyActivated = ETrue;
       
   472         iChildActivationState = EChildActivationProcessed;
   471         
   473         
   472     TIMESTAMP( "Editor launched" );
   474     TIMESTAMP( "Editor launched" );
       
   475         return; // ok
       
   476         }
       
   477 // problems with init close the view asynchronously
       
   478     iViewFullyActivated = EFalse;
       
   479     iChildActivationState = EChildActivationExitRequired;
       
   480 //    iFakeSyncGoingOn = EFalse; iExecutingDoExitL = EFalse;
       
   481     iActiveHelper->Start(); // calls AsyncExit()
       
   482     TIMESTAMP( "Editor NOT launched" );
       
   483     return;
   473     }
   484     }
   474 
   485 
   475 // -----------------------------------------------------------------------------
   486 // -----------------------------------------------------------------------------
   476 // Initialises toolbar items.
   487 // Initialises toolbar items.
   477 // -----------------------------------------------------------------------------
   488 // -----------------------------------------------------------------------------
   794     // is deactivated.
   805     // is deactivated.
   795     if ( !iAppUi.AppUiExitOngoing() )
   806     if ( !iAppUi.AppUiExitOngoing() )
   796         {
   807         {
   797         SaveAndCleanPreviousMessage();
   808         SaveAndCleanPreviousMessage();
   798         }
   809         }
   799 
   810     
       
   811     iChildActivationState = EChildActivationDeactivated ;
       
   812     
   800     }
   813     }
   801 
   814 
   802 // -----------------------------------------------------------------------------
   815 // -----------------------------------------------------------------------------
   803 // CNcsComposeView::DynInitMenuPaneL()
   816 // CNcsComposeView::DynInitMenuPaneL()
   804 // -----------------------------------------------------------------------------
   817 // -----------------------------------------------------------------------------
   940 
   953 
   941         switch( aCommand )
   954         switch( aCommand )
   942             {
   955             {
   943             case ENcsCmdSend:
   956             case ENcsCmdSend:
   944                 {
   957                 {
       
   958                 // Set focus on body of message need for correct 
       
   959                 // MSK setting for CAknConfirmationNote dialog. 
       
   960                 iContainer->SetFocusToMessageFieldL();
       
   961                 
   945                 // Show query if the Subject field is empty
   962                 // Show query if the Subject field is empty
   946                 if ( iContainer->IsSubjectFieldEmpty() )
   963                 if ( iContainer->IsSubjectFieldEmpty() )
   947                     {
   964                     {
   948                     TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL(
   965                     TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL(
   949                             R_FREESTYLE_EMAIL_QUERY_NO_SUBJECT );
   966                             R_FREESTYLE_EMAIL_QUERY_NO_SUBJECT );
  1058            	 	SetAttachmentLabelContentL();
  1075            	 	SetAttachmentLabelContentL();
  1059             	}
  1076             	}
  1060                 break;
  1077                 break;
  1061             case ENcsCmdPriorityHigh:
  1078             case ENcsCmdPriorityHigh:
  1062             	{
  1079             	{
  1063             	iNewMessage->ResetFlag( EFSMsgFlag_Low );
  1080             	if ( iNewMessage )
  1064             	iNewMessage->SetFlag( EFSMsgFlag_Important );
  1081             	    {
  1065             	iNewMessage->SaveMessageL();
  1082                     iNewMessage->ResetFlag( EFSMsgFlag_Low );
  1066                 iMessageModified = EFalse;
  1083                     iNewMessage->SetFlag( EFSMsgFlag_Important );
  1067             	iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityHigh );
  1084                     iNewMessage->SaveMessageL();
       
  1085                     iMessageModified = EFalse;
       
  1086                     iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityHigh );
       
  1087             	    }
  1068             	}
  1088             	}
  1069                 break;
  1089                 break;
  1070         	case ENcsCmdPriorityNormal:
  1090         	case ENcsCmdPriorityNormal:
  1071     	    	{
  1091     	    	{
  1072             	iNewMessage->ResetFlag( EFSMsgFlag_Low );
  1092     	    	if ( iNewMessage )
  1073             	iNewMessage->ResetFlag( EFSMsgFlag_Important );
  1093     	    	    {
  1074             	iNewMessage->SaveMessageL();
  1094                     iNewMessage->ResetFlag( EFSMsgFlag_Low );
  1075                 iMessageModified = EFalse;
  1095                     iNewMessage->ResetFlag( EFSMsgFlag_Important );
  1076             	iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityNormal );
  1096                     iNewMessage->SaveMessageL();
       
  1097                     iMessageModified = EFalse;
       
  1098                     iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityNormal );
       
  1099     	    	    }
  1077     	    	}
  1100     	    	}
  1078                 break;
  1101                 break;
  1079         	case ENcsCmdPriorityLow:
  1102         	case ENcsCmdPriorityLow:
  1080     	    	{
  1103     	    	{
  1081             	iNewMessage->ResetFlag( EFSMsgFlag_Important );
  1104     	    	if ( iNewMessage )
  1082             	iNewMessage->SetFlag( EFSMsgFlag_Low );
  1105     	    	    {
  1083             	iNewMessage->SaveMessageL();
  1106                     iNewMessage->ResetFlag( EFSMsgFlag_Important );
  1084                 iMessageModified = EFalse;
  1107                     iNewMessage->SetFlag( EFSMsgFlag_Low );
  1085             	iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityLow );
  1108                     iNewMessage->SaveMessageL();
       
  1109                     iMessageModified = EFalse;
       
  1110                     iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityLow );
       
  1111     	    	    }
  1086     	    	}
  1112     	    	}
  1087                 break;
  1113                 break;
  1088             case ENcsCmdShowCc:
  1114             case ENcsCmdShowCc:
  1089                 {
  1115                 {
  1090                 iContainer->SetCcFieldVisibleL( ETrue );
  1116                 iContainer->SetCcFieldVisibleL( ETrue );
  1167     	 		iContainer->ClosePopupContactListL();
  1193     	 		iContainer->ClosePopupContactListL();
  1168                 }
  1194                 }
  1169                 break;
  1195                 break;
  1170             case EAknSoftkeyClose:
  1196             case EAknSoftkeyClose:
  1171                 {
  1197                 {
  1172                 DoSafeExit();
  1198                 if ( !iAddingAttachmentDialogOpened )
       
  1199                     DoSafeExit();
  1173                 }
  1200                 }
  1174                 break;
  1201                 break;
  1175             case ENcsCmdExit:
  1202             case ENcsCmdExit:
  1176                 {
  1203                 {
  1177                 TIMESTAMP( "Exit selected from editor" );
  1204                 TIMESTAMP( "Exit selected from editor" );
  1202     if ( iContainer->AreAddressFieldsEmpty() )
  1229     if ( iContainer->AreAddressFieldsEmpty() )
  1203         {
  1230         {
  1204         User::Leave( KErrNotFound );
  1231         User::Leave( KErrNotFound );
  1205         }
  1232         }
  1206 
  1233 
  1207     CommitL( ETrue, EAllFields, ETrue );
  1234     TRAPD( commitErr, CommitL( ETrue, EAllFields, ETrue ) );
       
  1235     if ( KErrNone != commitErr )
       
  1236         {
       
  1237         iMailSendFailed = ETrue;
       
  1238         User::Leave( commitErr );
       
  1239         }
  1208 
  1240 
  1209     TRAPD(r, iMailBox->SendMessageL( *iNewMessage ) );
  1241     TRAPD(r, iMailBox->SendMessageL( *iNewMessage ) );
  1210     if ( KErrNone != r )
  1242     if ( KErrNone != r )
  1211         {
  1243         {
  1212         iMailSendFailed = ETrue;
  1244         iMailSendFailed = ETrue;
  1778 void CNcsComposeView::HandleDynamicVariantSwitchL(
  1810 void CNcsComposeView::HandleDynamicVariantSwitchL(
  1779     CFsEmailUiViewBase::TDynamicSwitchType aType )
  1811     CFsEmailUiViewBase::TDynamicSwitchType aType )
  1780 	{
  1812 	{
  1781     FUNC_LOG;
  1813     FUNC_LOG;
  1782 
  1814 
  1783     if ( iFirstStartCompleted && iContainer )
  1815     if ( iFirstStartCompleted && iContainer && !iExecutingDoExitL )
  1784         {
  1816         {
  1785         if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
  1817         if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
  1786             {
  1818             {
  1787             iContainer->HandleLayoutChangeL();
  1819             iContainer->HandleLayoutChangeL();
  1788             }
  1820             }
  2242             break;
  2274             break;
  2243         default:
  2275         default:
  2244             break;
  2276             break;
  2245         }
  2277         }
  2246 
  2278 
  2247     if ( commitToField )
  2279 	if ( iNewMessage )
  2248         {
       
  2249         RPointerArray<CFSMailAddress>& recipients = 
       
  2250             iNewMessage->GetToRecipients();
       
  2251         recipients.ResetAndDestroy();
       
  2252         NcsUtility::ConvertAddressArrayL(
       
  2253             iContainer->GetToFieldAddressesL( aParseAddresses ), recipients );
       
  2254         }
       
  2255 
       
  2256     if ( commitCcField )
       
  2257         {
       
  2258         RPointerArray<CFSMailAddress>& recipients = 
       
  2259             iNewMessage->GetCCRecipients();
       
  2260         recipients.ResetAndDestroy();
       
  2261         NcsUtility::ConvertAddressArrayL( 
       
  2262             iContainer->GetCcFieldAddressesL( aParseAddresses ), recipients );
       
  2263         }
       
  2264 
       
  2265     if ( commitBccField )
       
  2266         {
       
  2267         RPointerArray<CFSMailAddress>& recipients = 
       
  2268             iNewMessage->GetBCCRecipients();
       
  2269         recipients.ResetAndDestroy();
       
  2270         NcsUtility::ConvertAddressArrayL( 
       
  2271             iContainer->GetBccFieldAddressesL( aParseAddresses ), recipients );
       
  2272         }
       
  2273 
       
  2274 	if ( commitSubjectField )
       
  2275 	    {
  2280 	    {
  2276 	    // get subject from UI to MSG object
  2281         if ( commitToField )
  2277 	    HBufC* subject = iContainer->GetSubjectLC();
  2282             {
  2278 	    TPtr ptr = subject->Des();
  2283             RPointerArray<CFSMailAddress>& recipients = 
  2279 		// replace new line characters with spaces as Subject is normally
  2284                 iNewMessage->GetToRecipients();
  2280 	    // one line only
  2285             recipients.ResetAndDestroy();
  2281 	    AknTextUtils::ReplaceCharacters( 
  2286             NcsUtility::ConvertAddressArrayL(
  2282 	            ptr, KLineSeparators, KReplacementChar );
  2287                 iContainer->GetToFieldAddressesL( aParseAddresses ), recipients );
  2283 	    iNewMessage->SetSubject( *subject );
  2288             }
  2284 	    CleanupStack::PopAndDestroy( subject );
  2289     
       
  2290         if ( commitCcField )
       
  2291             {
       
  2292             RPointerArray<CFSMailAddress>& recipients = 
       
  2293                 iNewMessage->GetCCRecipients();
       
  2294             recipients.ResetAndDestroy();
       
  2295             NcsUtility::ConvertAddressArrayL( 
       
  2296                 iContainer->GetCcFieldAddressesL( aParseAddresses ), recipients );
       
  2297             }
       
  2298     
       
  2299         if ( commitBccField )
       
  2300             {
       
  2301             RPointerArray<CFSMailAddress>& recipients = 
       
  2302                 iNewMessage->GetBCCRecipients();
       
  2303             recipients.ResetAndDestroy();
       
  2304             NcsUtility::ConvertAddressArrayL( 
       
  2305                 iContainer->GetBccFieldAddressesL( aParseAddresses ), recipients );
       
  2306             }
       
  2307 
       
  2308         if ( commitSubjectField )
       
  2309             {
       
  2310             // get subject from UI to MSG object
       
  2311             HBufC* subject = iContainer->GetSubjectLC();
       
  2312             TPtr ptr = subject->Des();
       
  2313             // replace new line characters with spaces as Subject is normally
       
  2314             // one line only
       
  2315             AknTextUtils::ReplaceCharacters( 
       
  2316                     ptr, KLineSeparators, KReplacementChar );
       
  2317             iNewMessage->SetSubject( *subject );
       
  2318             CleanupStack::PopAndDestroy( subject );
       
  2319             }
       
  2320         }
       
  2321     else // iNewMessage is still NULL
       
  2322         {
       
  2323         User::Leave( KErrNotFound );
       
  2324         }
       
  2325 	
       
  2326 	if ( iNewMessageTextPart )
       
  2327 	    {
       
  2328         if ( commitBodyField )
       
  2329             {
       
  2330             HBufC* body = iContainer->GetBodyContentLC();
       
  2331             TPtr bodyPtr = body->Des(); // this TPtr is needed only because of
       
  2332             // incorrect argument type in FW API, can be removed when API fixed
       
  2333             iNewMessageTextPart->SetContent( bodyPtr );
       
  2334             CleanupStack::PopAndDestroy( body );
       
  2335             iMessageTextPartModified = ETrue;
       
  2336             }
  2285 	    }
  2337 	    }
  2286 
  2338 	else // iNewMessageTextPart is still NULL
  2287     if ( commitBodyField )
  2339 	    {
  2288         {
  2340         User::Leave( KErrNotFound );
  2289         HBufC* body = iContainer->GetBodyContentLC();
  2341 	    }
  2290         TPtr bodyPtr = body->Des(); // this TPtr is needed only because of
  2342         
  2291         // incorrect argument type in FW API, can be removed when API fixed
       
  2292         iNewMessageTextPart->SetContent( bodyPtr );
       
  2293         CleanupStack::PopAndDestroy( body );
       
  2294         iMessageTextPartModified = ETrue;
       
  2295         }
       
  2296 
       
  2297     iMessageModified = ETrue;
  2343     iMessageModified = ETrue;
  2298     RefreshToolbar();
  2344     RefreshToolbar();
  2299 
  2345 
  2300     if ( aSaveNow )
  2346     if ( aSaveNow )
  2301         {
  2347         {
  2870         iNewMessage->SaveMessageL();
  2916         iNewMessage->SaveMessageL();
  2871         iMessageModified = EFalse;
  2917         iMessageModified = EFalse;
  2872         }
  2918         }
  2873 
  2919 
  2874     TFsEmailUiUtility::CreatePlainTextPartL( *iNewMessage, iNewMessageTextPart );
  2920     TFsEmailUiUtility::CreatePlainTextPartL( *iNewMessage, iNewMessageTextPart );
       
  2921     if (NULL == iNewMessageTextPart) // problems with creating 
       
  2922         {
       
  2923         User::Leave( KErrUnknown );
       
  2924         }
  2875     }
  2925     }
  2876 
  2926 
  2877 // -----------------------------------------------------------------------------
  2927 // -----------------------------------------------------------------------------
  2878 // CNcsComposeView::GenerateForwardMessageL
  2928 // CNcsComposeView::GenerateForwardMessageL
  2879 // -----------------------------------------------------------------------------
  2929 // -----------------------------------------------------------------------------
  2921         iNewMessage->SaveMessageL();
  2971         iNewMessage->SaveMessageL();
  2922 	    }
  2972 	    }
  2923     
  2973     
  2924 	TFsEmailUiUtility::CreatePlainTextPartL( 
  2974 	TFsEmailUiUtility::CreatePlainTextPartL( 
  2925 	        *iNewMessage, iNewMessageTextPart );
  2975 	        *iNewMessage, iNewMessageTextPart );
  2926 
  2976     if (NULL == iNewMessageTextPart) // problems with creating 
       
  2977         {
       
  2978         User::Leave( KErrUnknown );
       
  2979         }
  2927     }
  2980     }
  2928 
  2981 
  2929 // -----------------------------------------------------------------------------
  2982 // -----------------------------------------------------------------------------
  2930 // CNcsComposeView::InitReplyUiL
  2983 // CNcsComposeView::InitReplyUiL
  2931 // -----------------------------------------------------------------------------
  2984 // -----------------------------------------------------------------------------
  3147     TBool result = EFalse;
  3200     TBool result = EFalse;
  3148     if ( iFirstStartCompleted ) // Safety
  3201     if ( iFirstStartCompleted ) // Safety
  3149         {
  3202         {
  3150         if ( !aError )
  3203         if ( !aError )
  3151             {
  3204             {
       
  3205             // may leave if unable to create new message part
  3152             TRAP( aError, InitReplyOrForwardUiL() );
  3206             TRAP( aError, InitReplyOrForwardUiL() );
       
  3207             }
       
  3208         if ( !aError )
       
  3209             {
  3153             iAutoSaver->Enable( ETrue );
  3210             iAutoSaver->Enable( ETrue );
  3154             }
  3211             }
  3155         else
  3212         else
  3156             {
  3213             {
  3157             // something went wrong
  3214             // something went wrong
  3197 //
  3254 //
  3198 void CNcsComposeView::ExitComposer()
  3255 void CNcsComposeView::ExitComposer()
  3199     {
  3256     {
  3200     FUNC_LOG;
  3257     FUNC_LOG;
  3201 
  3258 
       
  3259     // dont exit while in child activation 
       
  3260     if ( EChildActivationStarted == iChildActivationState )
       
  3261         {
       
  3262         iChildActivationState = EChildActivationError;
       
  3263         }
       
  3264     if ( EChildActivationError == iChildActivationState )
       
  3265         {
       
  3266         return; 
       
  3267         }
       
  3268     
  3202     if ( iStatusPaneIndicators )
  3269     if ( iStatusPaneIndicators )
  3203         {
  3270         {
  3204         iStatusPaneIndicators->HideStatusPaneIndicators();
  3271         iStatusPaneIndicators->HideStatusPaneIndicators();
  3205         }
  3272         }
  3206     
  3273     
  3266         {
  3333         {
  3267         AppUi()->RemoveFromStack( iContainer );
  3334         AppUi()->RemoveFromStack( iContainer );
  3268         delete iContainer;
  3335         delete iContainer;
  3269         iContainer = NULL;
  3336         iContainer = NULL;
  3270         }
  3337         }
  3271 
  3338     iIncludeMessageTextAsync = EFalse;
  3272     }
  3339     }
  3273 
  3340 
  3274 // -----------------------------------------------------------------------------
  3341 // -----------------------------------------------------------------------------
  3275 // CNcsComposeView::SaveAndCleanPreviousMessage
  3342 // CNcsComposeView::SaveAndCleanPreviousMessage
  3276 // -----------------------------------------------------------------------------
  3343 // -----------------------------------------------------------------------------
  3324 // -----------------------------------------------------------------------------
  3391 // -----------------------------------------------------------------------------
  3325 //
  3392 //
  3326 void CNcsComposeView::AsyncExitL()
  3393 void CNcsComposeView::AsyncExitL()
  3327     {
  3394     {
  3328     FUNC_LOG;
  3395     FUNC_LOG;
  3329     if ( iFakeSyncGoingOn || iExecutingDoExitL )
  3396     if ( EChildActivationExitRequired == iChildActivationState )
       
  3397         {
       
  3398         ExitComposer();
       
  3399         }
       
  3400     else if ( iFakeSyncGoingOn || iExecutingDoExitL )
  3330         {
  3401         {
  3331         // if some sync method is still going on, we continue waiting
  3402         // if some sync method is still going on, we continue waiting
  3332         iActiveHelper->Cancel();
  3403         iActiveHelper->Cancel();
  3333         iActiveHelper->Start();
  3404         iActiveHelper->Start();
  3334         }
  3405         }
  3491 // ---------------------------------------------------------------------------
  3562 // ---------------------------------------------------------------------------
  3492 //
  3563 //
  3493 void CActiveHelper::RunL()
  3564 void CActiveHelper::RunL()
  3494     {
  3565     {
  3495     if( iComposeView )
  3566     if( iComposeView )
       
  3567         {
  3496         iComposeView->AsyncExitL();
  3568         iComposeView->AsyncExitL();
       
  3569         }
  3497     }
  3570     }
  3498 
  3571 
  3499 // ---------------------------------------------------------------------------
  3572 // ---------------------------------------------------------------------------
  3500 // CActiveHelper::DoCancel()
  3573 // CActiveHelper::DoCancel()
  3501 // ---------------------------------------------------------------------------
  3574 // ---------------------------------------------------------------------------