mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp
branchRCL_3
changeset 16 e00582ce7ecd
parent 15 52d61119153d
child 18 fbb813aef148
equal deleted inserted replaced
15:52d61119153d 16:e00582ce7ecd
  2966     if( IsPhoneOfflineL() )
  2966     if( IsPhoneOfflineL() )
  2967         {
  2967         {
  2968         resourceId = R_QTN_WAIT_MSG_SAVED_OUTBOX;
  2968         resourceId = R_QTN_WAIT_MSG_SAVED_OUTBOX;
  2969         }
  2969         }
  2970 
  2970 
  2971     iSendOperation = CUniEditorSendOperation::NewL( *this,
  2971     if (IsObjectsPathValidL())
  2972                                                     *Document(),
  2972         {
  2973                                                     *iHeader,
  2973     	iSendOperation = CUniEditorSendOperation::NewL( *this,
  2974                                                     *plugin,
  2974                                                     	*Document(),
  2975                                                     *iView,
  2975                                                     	*iHeader,
  2976                                                     FsSession() );
  2976                                                     	*plugin,
  2977     ActivateInputBlockerL( iSendOperation );
  2977                                                     	*iView,
  2978     
  2978                                                     	FsSession() );
  2979     ShowWaitNoteL( resourceId ); 
  2979         ActivateInputBlockerL(iSendOperation);
  2980 
  2980 
  2981     iEditorFlags |= EEditorClosing;
  2981         ShowWaitNoteL(resourceId);
  2982 
  2982 
  2983     iSendOperation->Send();
  2983         iEditorFlags |= EEditorClosing;
       
  2984 
       
  2985         iSendOperation->Send();
       
  2986         }
       
  2987     else
       
  2988         {
       
  2989         if (ShowConfirmationQueryL(R_UNIEDITOR_QUEST_CLOSE_OOD))
       
  2990             {
       
  2991             // Exit without saving.
       
  2992             Exit(EAknSoftkeyClose);
       
  2993             }
       
  2994         //else nothing.
       
  2995         }
  2984     }
  2996     }
  2985 
  2997 
  2986 
  2998 
  2987 // ---------------------------------------------------------
  2999 // ---------------------------------------------------------
  2988 // CUniEditorAppUi::DoMsgSaveExitL
  3000 // CUniEditorAppUi::DoMsgSaveExitL
  3015         {
  3027         {
  3016         DeleteCurrentEntryL();
  3028         DeleteCurrentEntryL();
  3017         }
  3029         }
  3018     else if ( ( Document()->Modified() || 
  3030     else if ( ( Document()->Modified() || 
  3019                 Document()->PrevSaveType() < EClosingSave ) && 
  3031                 Document()->PrevSaveType() < EClosingSave ) && 
  3020               CanSaveMessageL() )
  3032               CanSaveMessageL())
  3021         {
  3033         {
  3022         // Needs saving
  3034         // Needs saving
  3023         if ( IsForeground() )
  3035         if ( IsForeground() )
  3024             {
  3036             {
  3025             TInt resId = Document()->Saved() ? R_QTN_UNI_WAIT_SAVING_MESSAGE : 
  3037             TInt resId = Document()->Saved() ? R_QTN_UNI_WAIT_SAVING_MESSAGE : 
  3058         
  3070         
  3059     if ( CAknEnv::AppWithShutterRunning() )
  3071     if ( CAknEnv::AppWithShutterRunning() )
  3060         {
  3072         {
  3061         iEditorFlags |= ERunAppShutterAtExit;
  3073         iEditorFlags |= ERunAppShutterAtExit;
  3062         }
  3074         }
  3063         
  3075     if (IsObjectsPathValidL())
  3064     if ( iEditorFlags & ELaunchSuccessful &&  
  3076         {
  3065          Document()->MediaAvailable() )
  3077         if (iEditorFlags & ELaunchSuccessful && Document()->MediaAvailable())
  3066         {
  3078             {
  3067         DoMsgSaveExitL();
  3079             DoMsgSaveExitL();
  3068         }
  3080             }
  3069         
  3081 
  3070     Exit(); 
  3082         Exit();
       
  3083         }
       
  3084     else
       
  3085         {
       
  3086         if (ShowConfirmationQueryL(R_UNIEDITOR_QUEST_CLOSE_OOD))
       
  3087             {
       
  3088             // Exit without saving.
       
  3089             Exit(EAknSoftkeyClose);
       
  3090             }
       
  3091         }
       
  3092     
  3071     }
  3093     }
  3072 
  3094 
  3073 // ---------------------------------------------------------
  3095 // ---------------------------------------------------------
  3074 // CUniEditorAppUi::DoBackSaveL
  3096 // CUniEditorAppUi::DoBackSaveL
  3075 // Back button implementation
  3097 // Back button implementation
  3100         else // closeVal == EMsgCloseSave
  3122         else // closeVal == EMsgCloseSave
  3101             {
  3123             {
  3102             // Message has data
  3124             // Message has data
  3103             if ( Document()->Modified() || Document()->PrevSaveType() < EClosingSave )
  3125             if ( Document()->Modified() || Document()->PrevSaveType() < EClosingSave )
  3104                 {
  3126                 {
  3105                 if ( CanSaveMessageL() )
  3127                 if ( CanSaveMessageL() && IsObjectsPathValidL())                    
  3106                     {
  3128                     {
  3107                     TInt resId = Document()->Saved() ? R_QTN_UNI_WAIT_SAVING_MESSAGE : 
  3129                     TInt resId = Document()->Saved() ? R_QTN_UNI_WAIT_SAVING_MESSAGE : 
  3108                                                        R_QTN_UNI_WAIT_SAVING_MESSAGE_NEW;
  3130                                                        R_QTN_UNI_WAIT_SAVING_MESSAGE_NEW;
  3109                     DoSaveL( EClosingSave );
  3131                     DoSaveL( EClosingSave );
  3110                     iEditorFlags |= EEditorClosing;
  3132                     iEditorFlags |= EEditorClosing;
  9855             iEmbeddedObjectStylusPopup->SetPosition(aPenEventLocation);
  9877             iEmbeddedObjectStylusPopup->SetPosition(aPenEventLocation);
  9856             iEmbeddedObjectStylusPopup->ShowMenu();
  9878             iEmbeddedObjectStylusPopup->ShowMenu();
  9857             iTapConsumed = ETrue;
  9879             iTapConsumed = ETrue;
  9858             }
  9880             }
  9859         }   
  9881         }   
  9860     }  
  9882     }
       
  9883 
       
  9884 // ---------------------------------------------------------
       
  9885 // CUniEditorAppUi::IsObjectPathValidL
       
  9886 // Checks whether all inserted object's path are valid
       
  9887 // message.
       
  9888 // ---------------------------------------------------------
       
  9889 //
       
  9890 TBool CUniEditorAppUi::IsObjectsPathValidL() const
       
  9891     {
       
  9892     TBool bCanSave = ETrue;  
       
  9893     if ( Document()->DataModel()->SmilType() == EMmsSmil )
       
  9894         {
       
  9895         bCanSave = Document()->DataModel()->ObjectList().IsListValid();
       
  9896         
       
  9897         if(bCanSave)
       
  9898             {
       
  9899             bCanSave = Document()->DataModel()->AttachmentList().IsListValid();
       
  9900             }
       
  9901         }      
       
  9902     return bCanSave;
       
  9903     }
       
  9904 
  9861 // End of file
  9905 // End of file
  9862 
  9906