mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp
branchRCL_3
changeset 28 fc3320e39880
parent 27 7fdbb852d323
equal deleted inserted replaced
27:7fdbb852d323 28:fc3320e39880
   269     iNextFocus( EMsgComponentIdNull ),
   269     iNextFocus( EMsgComponentIdNull ),
   270     iPopupChangedMmsBuffer(NULL),
   270     iPopupChangedMmsBuffer(NULL),
   271     iPopupChangedSmsBuffer(NULL),
   271     iPopupChangedSmsBuffer(NULL),
   272     iEditorFlags( EShowInfoPopups ),
   272     iEditorFlags( EShowInfoPopups ),
   273     iMskResId( R_UNIEDITOR_OPTIONS_CLOSE ),
   273     iMskResId( R_UNIEDITOR_OPTIONS_CLOSE ),
   274     iOptimizedFlow(EFalse),
   274     iOptimizedFlow(EFalse)
   275     iSingleJpegImageProcessing(EFalse)
       
   276     {
   275     {
   277     }
   276     }
   278     
   277     
   279 // ---------------------------------------------------------
   278 // ---------------------------------------------------------
   280 // CUniEditorAppUi::ConstructL
   279 // CUniEditorAppUi::ConstructL
   477 //
   476 //
   478 CUniEditorAppUi::~CUniEditorAppUi()
   477 CUniEditorAppUi::~CUniEditorAppUi()
   479     {
   478     {
   480     iEditorFlags |= EEditorExiting;
   479     iEditorFlags |= EEditorExiting;
   481     
   480     
   482 	//sendui+jepg optimization changes
   481 	
   483     if(iLaunchOperation)
       
   484         {
       
   485         // check Is iLaunchOperation still attached to 
       
   486         // iSlideLoader / iHeader
       
   487         // Set the CUniEditorAppUi
       
   488         // instance to NULL, to avoid crash.
       
   489         if(iLaunchOperation->GetHeader())
       
   490             {
       
   491             iHeader = NULL;            
       
   492             }
       
   493         if(iLaunchOperation->GetSlideLoader())
       
   494             {
       
   495             iSlideLoader = NULL;            
       
   496             }
       
   497         }
       
   498     if ( iView )
   482     if ( iView )
   499         {
   483         {
   500         // To prevent focus changes caused by input blocker deletion & toolbar extension
   484         // To prevent focus changes caused by input blocker deletion & toolbar extension
   501         // closing.
   485         // closing.
   502         iEikonEnv->EikAppUi()->RemoveFromStack( iView );
   486         iEikonEnv->EikAppUi()->RemoveFromStack( iView );
   697 // Performs all the last actions before editor launch ends.
   681 // Performs all the last actions before editor launch ends.
   698 // ---------------------------------------------------------
   682 // ---------------------------------------------------------
   699 //
   683 //
   700 void CUniEditorAppUi::FinalizeLaunchL()
   684 void CUniEditorAppUi::FinalizeLaunchL()
   701     {
   685     {
   702 	// In all normal cases other then Sendui+Jepeg
       
   703 	// iOptimizedFlow will be false and flow should be 
       
   704 	// same as the normal launch
       
   705     if(iOptimizedFlow)
       
   706         {
       
   707 		//if iOptimizedFlow is True, it means
       
   708 		//sendui+Jepg and this is partial complete call
       
   709         iSingleJpegImageProcessing = ETrue;
       
   710         }
       
   711 		
       
   712     iFinalizeLaunchL = ETrue;
   686     iFinalizeLaunchL = ETrue;
   713     iSmilModel = &Document()->DataModel()->SmilModel();
   687     iSmilModel = &Document()->DataModel()->SmilModel();
   714 	
   688     iHeader = iLaunchOperation->DetachHeader();
   715     if(!iOptimizedFlow)
   689     iSlideLoader = iLaunchOperation->DetachSlideLoader();
   716         {
       
   717 		//detach the iHeader and iSlideLoader
       
   718         iHeader = iLaunchOperation->DetachHeader();
       
   719         iSlideLoader = iLaunchOperation->DetachSlideLoader();
       
   720         }
       
   721     else
       
   722         {
       
   723 		// get reference to complete partial lauch operation
       
   724         iHeader = iLaunchOperation->GetHeader();
       
   725         iSlideLoader = iLaunchOperation->GetSlideLoader();
       
   726         }
       
   727     
   690     
   728     SetMessageTypeLockingL();
   691     SetMessageTypeLockingL();
   729     
   692     
   730     TInt headersVariation = iHeader->AddHeadersVariation();
   693     TInt headersVariation = iHeader->AddHeadersVariation();
   731 
   694 
   819     
   782     
   820     // Enable task swapper to options menu after launch has been completed.
   783     // Enable task swapper to options menu after launch has been completed.
   821     MenuBar()->SetMenuType( CEikMenuBar::EMenuOptions );
   784     MenuBar()->SetMenuType( CEikMenuBar::EMenuOptions );
   822     
   785     
   823     UpdateToolbarL();
   786     UpdateToolbarL();
   824 
   787     
   825 	// partial launch need to call execute to make
   788     iEditorFlags |= ELaunchSuccessful;
   826 	//the editor visible
   789 	
   827     if(iOptimizedFlow)
   790     iView->ExecuteL( ClientRect(), focusedControlId );
   828         {
       
   829         iView->ExecuteL( ClientRect(), focusedControlId );
       
   830         }
       
   831     else// not optmized Flow, common flow
       
   832         {
       
   833         // partial launch, dont set the flag
       
   834         iEditorFlags |= ELaunchSuccessful;
       
   835         
       
   836 		// in case of sendui+jepg , again finalize launch will be called 
       
   837 		//after image processing, no need to call iView->ExecuteL
       
   838 		// slide will be loaded already by slide loader.
       
   839         if(!iSingleJpegImageProcessing)
       
   840             {
       
   841 			//normal flow
       
   842             iView->ExecuteL( ClientRect(), focusedControlId );
       
   843             }
       
   844         
       
   845         //after the lauch complete for sendui+jepg
       
   846         //rest it.
       
   847         iSingleJpegImageProcessing = EFalse;        
       
   848         }
       
   849     
       
   850     delete iScreenClearer;
   791     delete iScreenClearer;
   851     iScreenClearer = NULL;
   792     iScreenClearer = NULL;
   852    
       
   853     // show note inserting 
       
   854     if(iOptimizedFlow)
       
   855         {
       
   856         ShowWaitNoteL( R_QTN_UNI_WAIT_INSERTING );
       
   857         }
       
   858  
       
   859 	
   793 	
   860     }
   794     }
   861     
   795     
   862 // ---------------------------------------------------------
   796 // ---------------------------------------------------------
   863 // CUniEditorAppUi::ShowLaunchNotesL
   797 // CUniEditorAppUi::ShowLaunchNotesL
  1467             charsLeft =  msgsParts;                        
  1401             charsLeft =  msgsParts;                        
  1468             }      
  1402             }      
  1469         }
  1403         }
  1470     }
  1404     }
  1471     
  1405     
       
  1406 // ---------------------------------------------------------
       
  1407 // CUniEditorAppUi::ProcessCommandL
       
  1408 // ---------------------------------------------------------
       
  1409 //
       
  1410 void CUniEditorAppUi::ProcessCommandL(TInt aCommand)
       
  1411     {
       
  1412     switch(aCommand)
       
  1413         {
       
  1414         case EAknCmdExit:
       
  1415             {
       
  1416             /*
       
  1417             Exit command is handle handled here since handling the same in HandleCommandL is too late for
       
  1418             themes effect to shown when application is exiting while progress note is shown.
       
  1419             BeginFullScreen is called after ProcessCommandL and before HandleCommandL,  progress note is 
       
  1420             shown in ProcessCommandL ie before BeginFullScreen is made.  
       
  1421             */
       
  1422             
       
  1423             //Only after processing the command, option menu is removed
       
  1424             //ProcessCommandL is called with some false command id which is unique and not used in any other place
       
  1425             const TInt KRandomCommand(8975462);
       
  1426             CAknAppUi::ProcessCommandL( KRandomCommand );
       
  1427             RemoveWaitNote();
       
  1428             ExitAndSaveL();
       
  1429             break;
       
  1430             }
       
  1431         default:
       
  1432             break;
       
  1433         }
       
  1434     
       
  1435     CAknAppUi::ProcessCommandL( aCommand );
       
  1436     
       
  1437     }
       
  1438 
  1472 
  1439 
  1473 // ---------------------------------------------------------
  1440 // ---------------------------------------------------------
  1474 // CUniEditorAppUi::HandleCommandL
  1441 // CUniEditorAppUi::HandleCommandL
  1475 // ---------------------------------------------------------
  1442 // ---------------------------------------------------------
  1476 //
  1443 //
  1689             HandleLocalZoomChangeL( (TMsgCommonCommands)aCommand );
  1656             HandleLocalZoomChangeL( (TMsgCommonCommands)aCommand );
  1690             break;
  1657             break;
  1691             }
  1658             }
  1692         case EEikCmdExit:
  1659         case EEikCmdExit:
  1693             {
  1660             {
       
  1661             //Save message when unieditor is closed though FSW
       
  1662 			//We won't get here when option->exit is selscted since while handling CAknCmdExit in overriden
       
  1663 			//ProcessCommandL we call Exit() 
  1694             RemoveWaitNote();
  1664             RemoveWaitNote();
  1695             ExitAndSaveL();
  1665             ExitAndSaveL();
  1696             break;
  1666             break;
  1697             }
  1667             }
  1698         case EAknSoftkeyClose:
  1668         case EAknSoftkeyClose:
  6510                                             TUniEditorOperationEvent aEvent )
  6480                                             TUniEditorOperationEvent aEvent )
  6511     {
  6481     {
  6512     if ( iEditorFlags & EEditorExiting )
  6482     if ( iEditorFlags & EEditorExiting )
  6513         {
  6483         {
  6514         // Do not handle any event if we are exiting from editor.
  6484         // Do not handle any event if we are exiting from editor.
  6515 		// rest values.
  6485 		// rest values. 
  6516         iOptimizedFlow = EFalse;
  6486         iOptimizedFlow = EFalse;
  6517         iSingleJpegImageProcessing = EFalse;
       
  6518         return;
  6487         return;
  6519         }
  6488         }
  6520     
  6489     
  6521     if ( aEvent == EUniEditorOperationComplete ||  
  6490     if ( aEvent == EUniEditorOperationComplete ||  
  6522          aEvent == EUniEditorOperationError ||
  6491          aEvent == EUniEditorOperationError ||
  6526         if( aOperation == EUniEditorOperationLaunch)
  6495         if( aOperation == EUniEditorOperationLaunch)
  6527             {
  6496             {
  6528             if(iLaunchOperation)
  6497             if(iLaunchOperation)
  6529                 {
  6498                 {
  6530                 iOptimizedFlow = iLaunchOperation->IsOptimizedFlagSet();
  6499                 iOptimizedFlow = iLaunchOperation->IsOptimizedFlagSet();
  6531                 }
  6500                 if(iOptimizedFlow )
  6532             }
  6501                     {
  6533 		// sendui+jepg-> this required after image processing 
  6502                     TRAP_IGNORE(ShowWaitNoteL( R_QTN_UNI_WAIT_INSERTING ));
  6534         if(!iOptimizedFlow)
  6503                     iOptimizedFlow = EFalse;
  6535             {
  6504                     return;
  6536             DeactivateInputBlocker();
  6505                     }
  6537             iEditorFlags &= ~EMsgEditInProgress;   
  6506                 }
  6538             }
  6507             }
       
  6508         
       
  6509         DeactivateInputBlocker();
       
  6510         iEditorFlags &= ~EMsgEditInProgress;   
       
  6511         
  6539         if ( aEvent == EUniEditorOperationCancel &&
  6512         if ( aEvent == EUniEditorOperationCancel &&
  6540              aOperation != EUniEditorOperationSend )
  6513              aOperation != EUniEditorOperationSend )
  6541             {
  6514             {
  6542             // Operation by operation should be considered what is proper action 
  6515             // Operation by operation should be considered what is proper action 
  6543             // in Cancel situation. Send operation handles the removing of wait note
  6516             // in Cancel situation. Send operation handles the removing of wait note
  6552         }
  6525         }
  6553         
  6526         
  6554     TRAPD( error, DoEditorOperationEventL( aOperation, aEvent ) );
  6527     TRAPD( error, DoEditorOperationEventL( aOperation, aEvent ) );
  6555     if ( error != KErrNone )
  6528     if ( error != KErrNone )
  6556         {
  6529         {
  6557 		// error handling
       
  6558         if(iOptimizedFlow)
       
  6559             {
       
  6560             DeactivateInputBlocker();
       
  6561             iEditorFlags &= ~EMsgEditInProgress;   
       
  6562             }
       
  6563         iOptimizedFlow = EFalse;
       
  6564         iSingleJpegImageProcessing = EFalse;
       
  6565         
       
  6566         // Handle operation handling error.
  6530         // Handle operation handling error.
  6567         if ( error == KLeaveExit )
  6531         if ( error == KLeaveExit )
  6568             {
  6532             {
  6569             // Leaving with KLeaveExit does not make function leavable. See Exit()
  6533             // Leaving with KLeaveExit does not make function leavable. See Exit()
  6570             User::Leave( error );
  6534             User::Leave( error );
  6577                 {
  6541                 {
  6578                 Exit( EAknSoftkeyClose );
  6542                 Exit( EAknSoftkeyClose );
  6579                 }
  6543                 }
  6580             }
  6544             }
  6581         }
  6545         }
  6582     //sendui+jepg-> after first call to finallizelauch,rest
       
  6583 	// it, so that next call will cover the code finallizelaunch
       
  6584 	//as happened for other launch cases.
       
  6585     iOptimizedFlow = EFalse;
       
  6586     }
  6546     }
  6587 
  6547 
  6588 // ---------------------------------------------------------
  6548 // ---------------------------------------------------------
  6589 // CUniEditorAppUi::DoEditorOperationEventL
  6549 // CUniEditorAppUi::DoEditorOperationEventL
  6590 // ---------------------------------------------------------
  6550 // ---------------------------------------------------------
  6733 // related processing is done at the FinalizeLaunch function.
  6693 // related processing is done at the FinalizeLaunch function.
  6734 // ---------------------------------------------------------
  6694 // ---------------------------------------------------------
  6735 //
  6695 //
  6736 void CUniEditorAppUi::DoLaunchCompleteL()
  6696 void CUniEditorAppUi::DoLaunchCompleteL()
  6737     {
  6697     {
  6738 	//sendui+jepg -> this required after image processing 
  6698     // Does no harm to call this even if no wait note is set.
  6739     if(!iOptimizedFlow)
  6699     RemoveWaitNote();        
  6740         {
  6700 
  6741         // Does no harm to call this even if no wait note is set.
       
  6742         RemoveWaitNote();        
       
  6743         }
       
  6744 		
       
  6745     TBool shutDown( EFalse );
  6701     TBool shutDown( EFalse );
  6746 	// sendui+jepg-> this required after image processing 
  6702     ShowLaunchNotesL( shutDown );
  6747     if(!iOptimizedFlow)
       
  6748 		{
       
  6749         ShowLaunchNotesL( shutDown );
       
  6750 		}
       
  6751     
  6703     
  6752     if ( shutDown )
  6704     if ( shutDown )
  6753         {
  6705         {
  6754         // Avoid direct Exit(). It causes actually leaving with -1003. 
  6706         // Avoid direct Exit(). It causes actually leaving with -1003. 
  6755         // If non-conformant object is sent from sendui and user is not
  6707         // If non-conformant object is sent from sendui and user is not