mobilemessaging/unieditor/application/src/UniEditorLaunchOperation.cpp
branchRCL_3
changeset 53 696bfeff199e
parent 0 72b543305e3a
equal deleted inserted replaced
42:1367103c24e2 53:696bfeff199e
   113         CMsgEditorAppUi& aAppUi,
   113         CMsgEditorAppUi& aAppUi,
   114         RFs& aFs ) :
   114         RFs& aFs ) :
   115     CUniEditorOperation( aOperationObserver, aDocument, aFs, EUniEditorOperationLaunch ),
   115     CUniEditorOperation( aOperationObserver, aDocument, aFs, EUniEditorOperationLaunch ),
   116     iControlObserver( aControlObserver ),
   116     iControlObserver( aControlObserver ),
   117     iView( aView ),
   117     iView( aView ),
   118     iAppUi( aAppUi )
   118     iAppUi( aAppUi ),
       
   119     iOptimizedFlow(EFalse)
   119     {
   120     {
   120     }
   121     }
   121 
   122 
   122 // ---------------------------------------------------------
   123 // ---------------------------------------------------------
   123 // CUniEditorLaunchOperation::ConstructL
   124 // CUniEditorLaunchOperation::ConstructL
   399 // CUniEditorLaunchOperation::DoPrepareHeaderL
   400 // CUniEditorLaunchOperation::DoPrepareHeaderL
   400 // ---------------------------------------------------------
   401 // ---------------------------------------------------------
   401 //
   402 //
   402 void CUniEditorLaunchOperation::DoPrepareHeaderL()
   403 void CUniEditorLaunchOperation::DoPrepareHeaderL()
   403     {
   404     {
   404     // Header is always drawn and populated
   405     if(!iHeader)
   405     iHeader = CUniEditorHeader::NewL( iDocument.Mtm(), iDocument, iView, iFs );
   406         {
   406     CompleteSelf( KErrNone );
   407 	    // Header is always drawn and populated
       
   408 	    iHeader = CUniEditorHeader::NewL( iDocument.Mtm(), iDocument, iView, iFs );
       
   409         }
       
   410     if(!iOptimizedFlow)
       
   411         CompleteSelf( KErrNone );
   407     }
   412     }
   408 
   413 
   409 // ---------------------------------------------------------
   414 // ---------------------------------------------------------
   410 // CUniEditorLaunchOperation::DoPrepareBodyL
   415 // CUniEditorLaunchOperation::DoPrepareBodyL
   411 // ---------------------------------------------------------
   416 // ---------------------------------------------------------
   412 //
   417 //
   413 void CUniEditorLaunchOperation::DoPrepareBodyL()
   418 void CUniEditorLaunchOperation::DoPrepareBodyL()
   414     {
   419     {
   415     iSlideLoader = CUniSlideLoader::NewL(
   420     if(!iSlideLoader)
   416         iControlObserver,
   421         {
   417         *iDocument.DataModel(),
   422      	iSlideLoader = CUniSlideLoader::NewL(
   418         iView,
   423 	        iControlObserver,
   419         EUniControlEditorMode );
   424 	        *iDocument.DataModel(),
       
   425 	        iView,
       
   426 	        EUniControlEditorMode );
       
   427         }
       
   428     
       
   429     if ( iDocument.DataModel()->SmilType() == EMmsSmil )
       
   430         {
       
   431         if(!iOptimizedFlow)
       
   432             {
       
   433 	        if ( !iDocument.DataModel()->SmilModel().SlideCount() )
       
   434 	            {
       
   435 	            iDocument.DataModel()->SmilModel().AddSlideL();
       
   436 	            }
       
   437             
       
   438 	        iSlideLoader->LoadSlideL( *this, 0 );       
   420         
   439         
   421     if ( iDocument.DataModel()->SmilType() == EMmsSmil )
   440 	        SetPending();
   422         {
   441             }
   423         if ( !iDocument.DataModel()->SmilModel().SlideCount() )
       
   424             {
       
   425             iDocument.DataModel()->SmilModel().AddSlideL();
       
   426             }
       
   427             
       
   428         iSlideLoader->LoadSlideL( *this, 0 );
       
   429         SetPending();
       
   430         }
   442         }
   431     else
   443     else
   432         {
   444         {
   433         // All unsupported files should be in
   445         // All unsupported files should be in
   434         // attachment list! 
   446         // attachment list! 
   606 // ---------------------------------------------------------
   618 // ---------------------------------------------------------
   607 // CUniEditorLaunchOperation::HandleOperationEvent
   619 // CUniEditorLaunchOperation::HandleOperationEvent
   608 // ---------------------------------------------------------
   620 // ---------------------------------------------------------
   609 //
   621 //
   610 void CUniEditorLaunchOperation::HandleOperationEvent( TUniEditorOperationType aOperation,
   622 void CUniEditorLaunchOperation::HandleOperationEvent( TUniEditorOperationType aOperation,
   611                                                       TUniEditorOperationEvent /*aEvent*/ )
   623                                                       TUniEditorOperationEvent aEvent )
   612     {
   624     {
   613     if ( aOperation == EUniEditorOperationSendUi )
   625     if ( aOperation == EUniEditorOperationSendUi )
   614         {
   626         {
       
   627         iOptimizedFlow = EFalse;
       
   628         if(aEvent == EUniEditorOperationPartialComplete)
       
   629             {
       
   630             iOptimizedFlow = iSendUiOperation->IsOptimizedFlagSet();
       
   631             if(iOptimizedFlow)
       
   632                 {
       
   633                 DoPrepareHeaderL();
       
   634                 DoPrepareBodyL();
       
   635                 iObserver.EditorOperationEvent(
       
   636                             EUniEditorOperationLaunch,
       
   637                             EUniEditorOperationComplete ); 
       
   638                 iOptimizedFlow = EFalse;
       
   639                 }
       
   640             return;
       
   641             }
   615         CArrayFixFlat<TInt>* errors = iSendUiOperation->GetErrors();
   642         CArrayFixFlat<TInt>* errors = iSendUiOperation->GetErrors();
   616         for ( TInt i = 0; i < errors->Count(); i++ )
   643         for ( TInt i = 0; i < errors->Count(); i++ )
   617             {
   644             {
   618             if ( errors->At( i ) == EUniProcessImgUserAbort )
   645             if ( errors->At( i ) == EUniProcessImgUserAbort )
   619                 {
   646                 {
   652     TInt parseResult = iDocument.UpdatedNonConformantCount();
   679     TInt parseResult = iDocument.UpdatedNonConformantCount();
   653     parseResult += iParseResultTemp;
   680     parseResult += iParseResultTemp;
   654     
   681     
   655     return parseResult;
   682     return parseResult;
   656     }
   683     }
   657 
   684 	
       
   685 // ---------------------------------------------------------
       
   686 // CUniEditorLaunchOperation::IsOptimizedFlagSet
       
   687 // ---------------------------------------------------------
       
   688 //
       
   689 TBool CUniEditorLaunchOperation::IsOptimizedFlagSet()
       
   690     {
       
   691     return iOptimizedFlow; 
       
   692     }
   658 
   693 
   659 // EOF
   694 // EOF