Revision: 201025 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 18:34:37 +0300
branchRCL_3
changeset 24 696bfeff199e
parent 22 1367103c24e2
child 25 fa1df4b99609
Revision: 201025 Kit: 2010127
email/imap4mtm/imapsession/src/cimapsession.cpp
email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp
email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP
messagingappbase/mce/inc/MceMessageListView.h
messagingappbase/mce/inc/mceui.h
messagingappbase/mce/src/MceMessageListContainer.cpp
messagingappbase/mce/src/MceMessageListView.cpp
messagingappbase/mce/src/MceMessageListboxItemDrawer.cpp
messagingappbase/mce/src/mceui.cpp
messagingappbase/msgavkon/muiu_domain/messageiterator/src/MuiuMessageIterator.cpp
messagingappbase/msgavkon/muiu_internal/inc/MessagingInternalPSKeys.h
messagingappbase/msgeditor/appui/WINSU.DEF
messagingappbase/msgeditor/appuisrc/MsgEditorAppUi.cpp
messagingappbase/msgeditor/appuisrc/MsgNaviPaneControl.cpp
messagingappbase/msgeditor/eabi/msgeditorappuiU.def
messagingappbase/msgeditor/viewsrc/MsgAddressControlEditor.cpp
messagingappbase/msgeditor/viewsrc/MsgBodyControlEditor.cpp
messagingappbase/msgeditor/viewsrc/MsgExpandableControlEditor.cpp
mobilemessaging/audiomsg/inc/audiomessageappui.h
mobilemessaging/audiomsg/src/audiomessageappui.cpp
mobilemessaging/mmsui/notviewersrc/NotViewerAppUi.cpp
mobilemessaging/mmsui/viewersrc/UniMmsViewerAppUi.cpp
mobilemessaging/smilui/playersrc/SmilPlayerIndicatorController.cpp
mobilemessaging/smsmtm/servermtm/group/SMSS.rss
mobilemessaging/smsmtm/servermtm/src/SMSSOUTB.CPP
mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp
mobilemessaging/unieditor/application/inc/UniEditorAppUi.h
mobilemessaging/unieditor/application/inc/UniEditorLaunchOperation.h
mobilemessaging/unieditor/application/inc/UniEditorLaunchOperation.inl
mobilemessaging/unieditor/application/inc/UniEditorOperation.h
mobilemessaging/unieditor/application/inc/UniEditorProcessImageOperation.h
mobilemessaging/unieditor/application/inc/UniEditorSendUiOperation.h
mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp
mobilemessaging/unieditor/application/src/UniEditorLaunchOperation.cpp
mobilemessaging/unieditor/application/src/UniEditorProcessImageOperation.cpp
mobilemessaging/unieditor/application/src/UniEditorSendUiOperation.cpp
msg_plat/messaging_editor_api/inc/MsgExpandableControlEditor.h
msg_plat/messaging_editor_api/inc/MsgNaviPaneControl.h
msg_pub/messaging_editor_constants_api/inc/MsgEditor.hrh
--- a/email/imap4mtm/imapsession/src/cimapsession.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/email/imap4mtm/imapsession/src/cimapsession.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -1412,21 +1412,14 @@
 				
 			if (err != KErrNone)
 				{
-                if(err == KErrImapCorrupt)
-                    {
-                    continueReadingData = ETrue;
-                    }
-                else
-                    {
-                    // As well as completing, destroy the command to help free up resources.
-                    CompleteAndDestroyCommand(err, ETrue);
+				// As well as completing, destroy the command to help free up resources.
+				CompleteAndDestroyCommand(err, ETrue);
 
-                    // Don't allow the session to be called again.
-                    SetSessionState(ESessionUnrecoverable);
-                    
-                    return;
-                    }
-				}// end of  if (err != KErrNone)
+				// Don't allow the session to be called again.
+				SetSessionState(ESessionUnrecoverable);
+				
+				return;
+				}
 				
 			// If a literal block is expected next, then find out how big it is expected to be.
 			switch (commandParseState)
--- a/email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/email/imap4mtm/imapsyncmanager/src/cimapfolder.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -96,6 +96,12 @@
 	iMatchingMessageIds.Reset();
 	iDeletedMessageIds.Reset();
 	iMissingMessageIds.Reset();
+	
+	if(iCachedEntryData)
+		{
+	    iCachedEntryData->Close();
+		}
+		
 	delete iSelection;
 	iFolderIndex->Reset();
 	iMessageFlagInfoArray.Reset();
@@ -1121,9 +1127,12 @@
 	SetEntryL(aFolder);
 	GetChildrenL(*aChildren);
 
+	if(iCachedEntryData)
+	    {
+        iCachedEntryData->Close();
+	    }
 	delete iCachedEntryData;
 	iCachedEntryData = NULL;
-
 	iCachedEntryData = new(ELeave) RArray<TMsvCacheData>(5);
 
 	// Go through them, checking to see if they're messages and removing ones that aren't
--- a/email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP	Mon Jun 21 15:36:19 2010 +0300
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP	Thu Jul 15 18:34:37 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -793,11 +793,10 @@
 	{
     // sending of all the emails has completed, no need listen for Mobility Manager
 	delete iMobilityManager;
-    iMobilityManager=NULL;
+	iMobilityManager=NULL;
 	
 	delete iSession;
 	iSession = NULL;
-	
 	delete iSessionManager;
 	iSessionManager = NULL;
 
--- a/messagingappbase/mce/inc/MceMessageListView.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/mce/inc/MceMessageListView.h	Thu Jul 15 18:34:37 2010 +0300
@@ -627,6 +627,12 @@
         * Since 3.2
         */
         void SetMarkReadUnread( TBool aValue );
+		
+        /**
+         *  This function sets aClearer to iLocalScreenClearer which contains Inbox view
+         *  screen. aClearer is used in CMceUi::HandleGainingForeground() when returning from viewers.
+         */
+        void  GetLocalScreenClearer( CAknLocalScreenClearer** &aClearer );
             
     private:    // Data
 
--- a/messagingappbase/mce/inc/mceui.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/mce/inc/mceui.h	Thu Jul 15 18:34:37 2010 +0300
@@ -1081,8 +1081,7 @@
         CMceBitmapResolver*             iBitmapResolver;
 
         CMceConnectMailboxTimer*        iConnectMailboxTimer;
-        CMessageIterator*               iMessageIterator;
-
+   
         CMceLogEngine*                  iMceLogEngine;
         CAknNavigationControlContainer* iNaviPane;
         CAknNavigationDecorator*        iDecoratedTabGroup;
--- a/messagingappbase/mce/src/MceMessageListContainer.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/mce/src/MceMessageListContainer.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -667,7 +667,7 @@
                 return EKeyWasNotConsumed;
                 }
 
-            if ( aKeyEvent.iCode == EKeyBackspace )
+            if ( iOwningView.MenuBar()->ItemSpecificCommandsEnabled() && aKeyEvent.iCode == EKeyBackspace )
                 {
                 MarkItemSelectionL();
                 SetAnchorItemIdL( 
--- a/messagingappbase/mce/src/MceMessageListView.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/mce/src/MceMessageListView.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -434,7 +434,20 @@
 
 
     iMceUi->SetMceViewActive( EMceMessageViewActive );
-
+    if ( editorLaunched &&
+         ( msgMtmUid!=KSenduiMtmIrUidValue ) &&
+         ( msgMtmUid!=KSenduiMtmBtUidValue ) &&
+         ( msgMtmUid!=KSenduiMtmSmtpUidValue ) &&
+         ( msgMtmUid!=KSenduiMtmImap4UidValue ) &&
+         ( msgMtmUid!=KSenduiMtmPop3UidValue ))
+        {
+        // This is added to remove Inbox view flicker when new message is opened from home screen and 
+        // forwarded
+        delete iLocalScreenClearer;
+        iLocalScreenClearer = NULL;
+        iLocalScreenClearer = CAknLocalScreenClearer::NewL( EFalse ); 
+        }
+    
     if ( activateConnQueryTimer )
         {
         if ( entry.iMtm == KSenduiMtmImap4Uid || 
@@ -4226,5 +4239,13 @@
     {
     iContextCommand = aContextCommandFlag;
     }
-	  
+
+// ----------------------------------------------------
+// CMceMessageListView::GetLocalScreenClearer( CAknLocalScreenClearer** &aClearer )
+// ---------------------------------------------------- 
+void CMceMessageListView::GetLocalScreenClearer( CAknLocalScreenClearer** &aClearer )        
+    {
+    aClearer = &iLocalScreenClearer;
+    }
+
 //  End of File
--- a/messagingappbase/mce/src/MceMessageListboxItemDrawer.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/mce/src/MceMessageListboxItemDrawer.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -57,9 +57,7 @@
     {
     TListItemProperties properties;
     properties.SetColor( iTextColor );
-    properties.SetHiddenSelection( iMessageListContainer.IsOutboxOpened() ||
-        iMessageListContainer.IsItemFolder( aItemIndex )  ||
-        iMessageListContainer.SyncMlOutboxOpened() );
+
     return properties;
     }
 
--- a/messagingappbase/mce/src/mceui.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/mce/src/mceui.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -39,7 +39,7 @@
 #include <msvids.h>
 #include <msvuids.h>
 #include <mtud.hrh>         // EMtudCommandTransferSend, EMtudCommandTransferSend, EMtudCommandTransferReceive
-#include <MuiuMessageIterator.h>// cmessageiterator
+
 #include <MuiuMsgEmbeddedEditorWatchingOperation.h> // tmsgexitmode
 #include <MuiuOperationWait.h>  // cmuiuoperationwait
 #include <muiumsvuiserviceutilitiesinternal.h> // msvuiserviceutilitiesinternal
@@ -271,7 +271,7 @@
         // must not delete iSession, session holder takes care of that
         }
     delete iMceLogEngine;
-    delete iMessageIterator;
+
     delete iFolderIndicator;
     delete iTabsArray;
     delete iMMSNotifications;
@@ -305,6 +305,7 @@
 
     // delete KPSUidMuiu property
     RProperty::Delete( KPSUidMuiu, KMuiuKeyCurrentMsg );
+    RProperty::Delete( KPSUidMuiu, KMuiuKeyNextMsg );
     if ( iFeatureMgrEnabled ) // CR : 401-1806
         {
     FeatureManager::UnInitializeLib();
@@ -1177,57 +1178,56 @@
 // ----------------------------------------------------
 // CMceUi::HandleOpenNextPreviousL
 // ----------------------------------------------------
-void CMceUi::HandleOpenNextPreviousL( TBool aOpenNext )
+void CMceUi::HandleOpenNextPreviousL( TBool /*aOpenNext*/ )
     {
     MCELOGGER_ENTERFN("HandleOpenNextPreviousL()");
-    __ASSERT_DEBUG( iMessageIterator, Panic(EMceUiMessageIteratorNotCreated));
-
-    if ( iMessageIterator )
-        {
-        TInt error = (aOpenNext ?
-            iMessageIterator->SetNextMessage() : iMessageIterator->SetPreviousMessage() );
-        if ( error == KErrNone )
-            {
-            TBool local = iMceListView->ListContainer()->FolderEntry().iServiceId == KMsvLocalServiceIndexEntryId;
-            if ( local && !iLocalScreenClearer ) 
-                {
-                iLocalScreenClearer = CAknLocalScreenClearer::NewL( ETrue );
-                }
-
-    // TODO
-            CMceMessageListContainerBase* container = iMceListView->ListContainer();
-            TMsvId currentItemId = iMessageIterator->CurrentMessage().Id();
-            if ( container )
+     
+    // Read the next message TMsvId using PS key 
+    TInt nextEntryId = 0;
+    TInt r = RProperty::Get( KPSUidMuiu, KMuiuKeyNextMsg, nextEntryId );
+    if ( r != KErrNone )
+        {
+        nextEntryId = 0;
+        }
+    
+    if ( nextEntryId > 0 )
+        {
+        // no need of following check because TMsvID is set properly
+        //set from MsgEditorAppUI.
+  
+    
+        TBool local = iMceListView->ListContainer()->FolderEntry().iServiceId == KMsvLocalServiceIndexEntryId;
+        if ( local && !iLocalScreenClearer ) 
+            {
+            iLocalScreenClearer = CAknLocalScreenClearer::NewL( ETrue );
+            }
+
+        CMceMessageListContainerBase* container = iMceListView->ListContainer();
+        
+        TMsvId currentItemId = nextEntryId;
+        if ( container )
+            {
+            container->SetCurrentItemIdL( currentItemId );
+            container->DrawNow();
+            }
+
+        TMsvEntry currentEntry;
+        TMsvId serviceId; // not used here but needed by GetEntry function
+        if ( iSession->GetEntry( currentItemId, serviceId, currentEntry ) == KErrNone &&
+             currentEntry.iType == KUidMsvMessageEntry )
+            {
+            TRAPD( err, EditMTMEntryL( currentEntry ) );
+            if ( err )
                 {
-                container->SetCurrentItemIdL( currentItemId );
-                container->DrawNow();
-/*                
-                TInt currentItemIndex = container->ItemIndex( currentItemId );
-                if ( currentItemIndex != KErrNotFound )
+                if ( iLocalScreenClearer )
                     {
-                    container->ListBox()->SetCurrentItemIndex( currentItemIndex );
-                    container->ListBox()->DrawDeferred();
-                    }*/
+                    delete iLocalScreenClearer;
+                    iLocalScreenClearer = NULL;
+                    }
+                User::Leave( err );
                 }
-
-            TMsvEntry currentEntry;
-            TMsvId serviceId; // not used here but needed by GetEntry function
-            if ( iSession->GetEntry( currentItemId, serviceId, currentEntry ) == KErrNone &&
-                 currentEntry.iType == KUidMsvMessageEntry )
-                {
-                TRAPD( err, EditMTMEntryL( currentEntry ) );
-                if ( err )
-                    {
-                    if ( iLocalScreenClearer )
-                        {
-                        delete iLocalScreenClearer;
-                        iLocalScreenClearer = NULL;
-                        }
-                    User::Leave( err );
-                    }
-                }
-            } // end if ( container )
-        } // end if ( error == KErrNone )
+            }
+        } // end  
     MCELOGGER_LEAVEFN("HandleOpenNextPreviousL()");
     }
 
@@ -2236,16 +2236,6 @@
         aCompletionCode == CMsgEmbeddedEditorWatchingOperation::EMsgExitPrevious )
         {
         MCELOGGER_WRITE("CMceUi::DoOperationCompletedL: Opening next/previous");
-        if ( iMessageIterator && closedEntryId > 0 )
-            {
-            TMsvEntry currentEntry;
-            TMsvId serviceId; // not used here but needed by GetEntry function
-            // Get current entry
-            if ( iSession->GetEntry( closedEntryId, serviceId, currentEntry ) == KErrNone )
-                {
-                iMessageIterator->SetCurrentMessageL( currentEntry );
-                }
-            }
         HandleOpenNextPreviousL( aCompletionCode ==
             CMsgEmbeddedEditorWatchingOperation::EMsgExitNext );
         if ( !IsForeground() )
@@ -2257,9 +2247,8 @@
         }
     else
         {
-        MCELOGGER_WRITE("CMceUi::DoOperationCompletedL: deleting iMessageIterator");
         // Viewer closed
-        if ( closedEntryId > 0 && iMessageIterator )
+        if ( closedEntryId > 0 )
             {
             CMceMessageListContainerBase* container = iMceListView->ListContainer();
             if ( container )
@@ -2267,9 +2256,7 @@
                 container->SetCurrentItemIdL( closedEntryId );
                 }
             }
-        delete iMessageIterator;
-        iMessageIterator = NULL;
-        }
+         }
 
     if ( !iMceErrorUi )
         {
@@ -2643,19 +2630,21 @@
         {
         User::LeaveIfError( r );
         }
+    
+     r = RProperty::Define( KPSUidMuiu, KMuiuKeyNextMsg, RProperty::EInt );
+     if ( r != KErrAlreadyExists )
+         {
+         User::LeaveIfError( r );
+         }
+
     // Set entry Id value to property
     if ( aEntry.iType == KUidMsvMessageEntry )
         {
         r = RProperty::Set( KPSUidMuiu, KMuiuKeyCurrentMsg, aEntry.Id() );
+        r = RProperty::Set( KPSUidMuiu, KMuiuKeyNextMsg, 0 );
         }
 
     TBool tabsToCleanupStack = EFalse;
-    delete iMessageIterator;
-    iMessageIterator = NULL;
-    if ( aEntry.iType == KUidMsvMessageEntry )
-        {
-        iMessageIterator = CMessageIterator::NewL( *iSession, aEntry );
-        }
 
     CBaseMtmUi& mtmUi=iMtmStore->GetMtmUiAndSetContextLC( aEntry );
     mtmUi.SetPreferences( mtmUi.Preferences() | EMtmUiFlagEditorPreferEmbedded );
@@ -5562,6 +5551,15 @@
 // ----------------------------------------------------
 void CMceUi::HandleGainingForeground() // CR : 401-1806
     {
+   
+    // This code is added to remove screen clearer when returning from viewer.
+    if ( iMceListView )
+        {
+        CAknLocalScreenClearer** localScreenClearer = NULL; 
+        iMceListView->GetLocalScreenClearer( localScreenClearer );
+        delete *localScreenClearer;
+        *localScreenClearer = NULL;// this will assign null to iLocalScreenClearer in messagelistview.
+        }
     if ( !iFeatureMgrEnabled )
         {
   	    TRAP_IGNORE( FeatureManager::InitializeLibL() );
@@ -6651,13 +6649,24 @@
 // ----------------------------------------------------
 void CMceUi::ResetAndHide()
     {
-    SetCustomControl(1);    // Disable bring-to-foreground on view activation
-    TRAP_IGNORE( CAknViewAppUi::CreateActivateViewEventL( \
-        KMessagingCentreMainViewUid, \
-        TUid::Uid(KMceHideInBackground), \
-        KNullDesC8 ) ) ;
+	if (!MceViewActive( EMceMainViewActive ))
+        {
+        SetCustomControl(1);    // Disable bring-to-foreground on view activation
+        TRAP_IGNORE( CAknViewAppUi::CreateActivateViewEventL( \
+            KMessagingCentreMainViewUid, \
+            TUid::Uid(KMceHideInBackground), \
+            KNullDesC8 ) ) ;
+        }
+    else
+        {
+        SetCustomControl(0); // Enable bring-to-foreground on view activation
+        }
     HideInBackground();
     }
+
+// ----------------------------------------------------
+// CMceUi::OpenMtmMailboxViewL
+// ----------------------------------------------------
 void CMceUi::OpenMtmMailboxViewL( const TMsvEntry& aEntry )
 	{
     CBaseMtmUi& mtmUi=iMtmStore->GetMtmUiAndSetContextLC( aEntry );
--- a/messagingappbase/msgavkon/muiu_domain/messageiterator/src/MuiuMessageIterator.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgavkon/muiu_domain/messageiterator/src/MuiuMessageIterator.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -422,17 +422,25 @@
     CMsvEntrySelection* tempSel = iParentOfCurrent->ChildrenL();
     CleanupStack::PushL( tempSel );
     
-    // remove all except messages from the list.
-    for ( TInt loop = tempSel->Count() - 1; loop >= 0; loop-- )
+    TMsvId parentId = iParentOfCurrent->EntryId();
+    // there is no need to check sub folder entry , if
+    // parent ID is Inbox/Draft/sent/outbox
+    if(parentId  != KMsvGlobalOutBoxIndexEntryId &&
+            parentId  != KMsvGlobalInBoxIndexEntryId &&
+            parentId  != KMsvDraftEntryId &&
+            parentId  != KMsvSentEntryId )
         {
-        const TMsvEntry& childEntry = iParentOfCurrent->ChildDataL( ( *tempSel )[loop] );
-        
-        if ( childEntry.iType.iUid != KUidMsvMessageEntryValue )
+        // remove all except messages from the list.
+        for ( TInt loop = tempSel->Count() - 1; loop >= 0; loop-- )
             {
-            tempSel->Delete( loop );
+            const TMsvEntry& childEntry = iParentOfCurrent->ChildDataL( ( *tempSel )[loop] );
+    
+            if ( childEntry.iType.iUid != KUidMsvMessageEntryValue )
+                {
+                tempSel->Delete( loop );
+                }
             }
         }
-    
     // Use the new child list
     delete iChildrenOfParent;
     CleanupStack::Pop( tempSel );
--- a/messagingappbase/msgavkon/muiu_internal/inc/MessagingInternalPSKeys.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgavkon/muiu_internal/inc/MessagingInternalPSKeys.h	Thu Jul 15 18:34:37 2010 +0300
@@ -47,6 +47,10 @@
 // Tells whether If one row list is populated or not, 1- list is populated, 0 - list population is in progress
 const TUint32 KMuiuOneRowListPopulated = 0x00000005;
 
+// Message viewer fast open previous/next message. Message id of next\previous message
+// needs to be opened from mce.
+const TUint32 KMuiuKeyNextMsg = 0x00000006;
+
 // The New PSK introduced from 5.0
 
 const TUid KPSUidMsgEditor	=	{0x101F87FF};
--- a/messagingappbase/msgeditor/appui/WINSU.DEF	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/appui/WINSU.DEF	Thu Jul 15 18:34:37 2010 +0300
@@ -102,4 +102,5 @@
 	?HandleStatusPaneSizeChange@CMsgEditorAppUi@@UAEXXZ @ 101 NONAME ; void CMsgEditorAppUi::HandleStatusPaneSizeChange(void)
 	?HandleServerAppExit@CMsgViewAttachmentsDialog@@UAEXH@Z @ 102 NONAME ; void CMsgViewAttachmentsDialog::HandleServerAppExit(int)
 	?GetAliasL@CMsgCheckNames@@QAEXABVTDesC16@@AAVTDes16@@H@Z @ 103 NONAME ; void CMsgCheckNames::GetAliasL(class TDesC16 const &, class TDes16 &, int)
+	?GetMessageIterator@CMsgNaviPaneControl@@QAEPAVCMessageIterator@@XZ @ 104 NONAME ; class CMessageIterator * CMsgNaviPaneControl::GetMessageIterator(void)
 
--- a/messagingappbase/msgeditor/appuisrc/MsgEditorAppUi.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/appuisrc/MsgEditorAppUi.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -205,6 +205,8 @@
     cache.RegisterPluginL( &( iMsgEditorAppUiExtension->iSettingCachePlugin ) );    
     
     iStatusPaneRes = StatusPane()->CurrentLayoutResId();
+    
+    iIterator = NULL;
     }
 
 // ---------------------------------------------------------
@@ -236,7 +238,9 @@
     delete iLock;
     delete iNaviDecorator;
 
-    delete iIterator;
+    // we are referring instance of nvaidecoratoir only
+    // no need to delete, alreday deleted in  delete iNaviDecorator;
+    //delete iIterator;
 
     // delete files from our temp directory.
     if ( iFileMan )
@@ -334,18 +338,25 @@
         }
 
     iMsgNaviDirection = aForward;
+    
+    // Check if next/previous message 
+    __ASSERT_DEBUG( iIterator != NULL, Panic( ENullPointer1 ) );
+     if ( aForward )
+         {
+         iIterator->SetNextMessage();
+         
+         }
+     else
+         {
+         iIterator->SetPreviousMessage();
+         }
+
+     RProperty::Set( KPSUidMuiu, KMuiuKeyNextMsg,
+              iIterator->CurrentMessage().Id() );
+         
 #ifdef RD_MSG_FAST_PREV_NEXT
     // Check if next/previous message can be fast opened by viewer
-    __ASSERT_DEBUG( iIterator != NULL, Panic( ENullPointer1 ) );
-    if ( aForward )
-        {
-        iIterator->SetNextMessage();
-        }
-    else
-        {
-        iIterator->SetPreviousMessage();
-        }
-
+    
     if ( CanFastOpenL( *iIterator) )
         {
         // Load next/previous message
@@ -376,6 +387,8 @@
             }
         else if ( err != KErrNone )
             {
+            // Reset the KMuiuKeyNextMsg to 0 
+            RProperty::Set( KPSUidMuiu, KMuiuKeyNextMsg,0 );
             // Unknown error during quick launch.
             iCoeEnv->HandleError( err );
             iExitMode = MApaEmbeddedDocObserver::ENoChanges;
@@ -409,12 +422,10 @@
         {
         CMsgEditorDocument* doc = Document();
 
-        if ( iIterator == NULL )
-            {
-            iIterator = CMessageIterator::NewL( doc->Session(), doc->Entry() );
-            iIterator->SetMessageIteratorObserver( this );
-            }
-
+        //We should not create iterator here  navi pane iterator
+        //will be refered  in  CMsgEditorAppUi
+         
+        __ASSERT_DEBUG( iIterator != NULL, Panic( ENullPointer1 ) );
         // Next is ETrue if layout is EAknLayoutIdABRW,
         // EFalse if EAknLayoutIdELAF or EAknLayoutIdAPAC
         if ( AknLayoutUtils::LayoutMirrored() )
@@ -453,12 +464,9 @@
     if ( iEikonEnv->StartedAsServerApp() )
         {
         CMsgEditorDocument* doc = Document();
-
-        if ( iIterator == NULL )
-            {
-            iIterator = CMessageIterator::NewL( doc->Session(), doc->Entry() );
-            iIterator->SetMessageIteratorObserver( this );
-            }
+        //We should not create iterator here, navi pane iterator
+        //will be refered  in  CMsgEditorAppUi
+        __ASSERT_DEBUG( iIterator != NULL, Panic( ENullPointer1 ) );
 
         aCurrentIndex = iIterator->CurrentMessageIndex();
         aMsgsInFolder = iIterator->MessagesInFolder();
@@ -1649,6 +1657,12 @@
         CMsgEditorDocument* doc = Document();
         naviPaneControl->SetNavigationIndicatorL( doc->Session(), doc->Entry() );
         
+        // this function will always be called when viwer is launched
+        // always navi decorater will be created.
+        // refer navi decorator iterator instance here
+        iIterator =  naviPaneControl->GetMessageIterator();
+        iIterator->SetMessageIteratorObserver( this );
+        
         iNaviDecorator->SetContainerWindowL( *naviContainer );
         iNaviDecorator->MakeScrollButtonVisible( EFalse );
         iNaviDecorator->SetComponentsToInheritVisibility( ETrue );
--- a/messagingappbase/msgeditor/appuisrc/MsgNaviPaneControl.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/appuisrc/MsgNaviPaneControl.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -91,6 +91,7 @@
     iControlArray = CCoeControlArray::NewL( *this );
     iControlArray->SetControlsOwnedExternally( EFalse );
     iPriorityIndicator = EFalse;
+    iMessageIterator = NULL;
     UpdateVarientId();
     SetComponentsToInheritVisibility( ETrue );
     ActivateL();
@@ -165,12 +166,14 @@
 EXPORT_C void CMsgNaviPaneControl::SetNavigationIndicatorL( CMsvSession& aSession,
                                                    const TMsvEntry& aCurrentMessage )
     {
-    delete iMessageIterator;
-    iMessageIterator = NULL;
-    
-    iMessageIterator = CMessageIterator::NewL( aSession, aCurrentMessage );
-    iMessageIterator->SetMessageIteratorObserver( this );
-    
+    if(!iMessageIterator)
+        {
+        // Iterator will be deleted once in the destructer only.
+        //deleting and creating it again is degrading the performance
+ 
+        iMessageIterator = CMessageIterator::NewL( aSession, aCurrentMessage );
+        iMessageIterator->SetMessageIteratorObserver( this );
+        }
     UpdateNavigationIndicatorsL();
     }
 
@@ -767,4 +770,13 @@
                 }                  
             }    
     }
+
+// ----------------------------------------------------------------------------
+// CMsgNaviPaneControl::GetNavigationIndicator
+// ----------------------------------------------------------------------------
+//
+EXPORT_C CMessageIterator* CMsgNaviPaneControl::GetMessageIterator()
+    {
+     return iMessageIterator;
+    }
 //  End of File
--- a/messagingappbase/msgeditor/eabi/msgeditorappuiU.def	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/eabi/msgeditorappuiU.def	Thu Jul 15 18:34:37 2010 +0300
@@ -165,4 +165,5 @@
 	_ZN25CMsgViewAttachmentsDialog19HandleServerAppExitEi @ 164 NONAME
 	_ZThn180_N25CMsgViewAttachmentsDialog19HandleServerAppExitEi @ 165 NONAME ; #<thunk>#
 	_ZN14CMsgCheckNames9GetAliasLERK7TDesC16R6TDes16i @ 166 NONAME
+	_ZN19CMsgNaviPaneControl18GetMessageIteratorEv @ 167 NONAME
 
--- a/messagingappbase/msgeditor/viewsrc/MsgAddressControlEditor.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/viewsrc/MsgAddressControlEditor.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -1672,6 +1672,15 @@
           aKeyEvent.iCode == EKeyDevice3 ) &&
         iValidHighlightable )
         {
+        if ( aKeyEvent.iCode == EKeyDevice3
+                && iFindItemEventReceived )
+            {
+            // Find item was activated by touch, 
+            // no need to restore highlight
+            iFindItemEventReceived = EFalse;
+            return EKeyWasNotConsumed;
+            }
+    
         if ( !SelectionLength() )
             {
             // Enable highlight if hw keys used
@@ -1743,21 +1752,17 @@
                 if ( currentField &&
                      iPreviousField == currentField )
                     {
-                    // We will send new EMsgFindItemEvent so that we can separate 
-                    // single click item activation and old key based activation.
-                    // This is just quick fix for doing it, other implementations should
-                    // be considered(e.g. storing state in editor or using some flags).
-                    // This is done because in AppUI::HandleKeyEvent we must separate
-                    // activation methods for enabling highlight when using keys. 
+                    // Addressfield text was clicked, we will send simulated key event for
+                    // opening context sensitive menu in AppUI::HandleKeyEvent               
                     TKeyEvent event;
-                    event.iCode = EMsgFindItemKeyEvent;
-                    event.iScanCode = EMsgFindItemKeyEvent;
+                    event.iCode = EKeyDevice3;
+                    event.iScanCode = EKeyDevice3;
                     event.iModifiers = 0;
                     event.iRepeats = 0;
                     
-                    iCoeEnv->WsSession().SimulateKeyEvent( event );
-                    
                     forwardRequest = EFalse;
+                    iFindItemEventReceived = ETrue;
+                    iCoeEnv->WsSession().SimulateKeyEvent( event );  
                     }
                 
                 if ( SelectionLength() )
--- a/messagingappbase/msgeditor/viewsrc/MsgBodyControlEditor.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/viewsrc/MsgBodyControlEditor.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -256,7 +256,17 @@
         {
         switch ( aKeyEvent.iCode )
             {
-            case EKeyDevice3:   
+            case EKeyDevice3:  
+                {
+                if ( iFindItemEventReceived )
+                    {
+                    // Find item was activated by touch, 
+                    // no need to restore highlight
+                    iFindItemEventReceived = EFalse;
+                    return EKeyWasNotConsumed;
+                    }
+                // fall through
+                } 
             case EKeyEnter:
                 {
                 // Restore highlight
@@ -308,20 +318,17 @@
                         MAknItemFinderObserver::TEventFlag aEvent,
                         TUint aFlags)
     {     
-    // We will send new EMsgFindItemEvent so that we can separate 
-    // single click item activation and old key based activation.
-    // This is just quick fix for doing it, other implementations should
-    // be considered(e.g. storing state in editor or using some flags).
-    // This is done because in AppUI::HandleKeyEvent we must separate
-    // activation methods for enabling highlight when using keys.    
+    // Body text find item was clicked, we will send simulated key event for
+    // opening context sensitive menu in AppUI::HandleKeyEvent    
     if ( MAknItemFinderObserver::EPointerEvent == aEvent )
         {
         TKeyEvent event;
-        event.iCode = EMsgFindItemKeyEvent;
-        event.iScanCode = EMsgFindItemKeyEvent;
+        event.iCode = EKeyDevice3;
+        event.iScanCode = EKeyDevice3;
         event.iModifiers = 0;
         event.iRepeats = 0;
 
+        iFindItemEventReceived = ETrue;
         iCoeEnv->WsSession().SimulateKeyEvent( event );
         }
     }
--- a/messagingappbase/msgeditor/viewsrc/MsgExpandableControlEditor.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/messagingappbase/msgeditor/viewsrc/MsgExpandableControlEditor.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -101,7 +101,8 @@
     CEikRichTextEditor( TGulBorder::ENone ),
     iParentControl( aParent ),
     iFlags( aFlags ),
-    iBaseControlObserver( aBaseControlObserver )
+    iBaseControlObserver( aBaseControlObserver ),
+    iFindItemEventReceived( EFalse )    
     {
     }
 
--- a/mobilemessaging/audiomsg/inc/audiomessageappui.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/audiomsg/inc/audiomessageappui.h	Thu Jul 15 18:34:37 2010 +0300
@@ -867,6 +867,16 @@
         
 #endif
        
+        /**
+         * Check if find item highlight needs to be enabled on key event.
+         * 
+         * @param aKeyEvent key event
+         * @param aType     event type
+         * @return ETrue if highlight was enabled,
+         *         EFalse otherwise
+         */  
+        TBool CheckFindItemHighlightL( const TKeyEvent& aKeyEvent,
+                                       TEventCode aType );
 
     private:     // Data
    		/**
--- a/mobilemessaging/audiomsg/src/audiomessageappui.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/audiomsg/src/audiomessageappui.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -998,7 +998,13 @@
 #endif                	
                 break;
            	case EKeyOK: // Selection key: Show context menus OR play/record clip
-                {
+                {    
+                // Check if find item highlight needs to be enabled
+                if ( CheckFindItemHighlightL( aKeyEvent, aType ) )
+                    {
+                    return EKeyWasConsumed;
+                    }
+                
                 if ( Document()->GetAppMode() == EAmsEditor )
                   	{
                   	HandleCommandL( EAmsSoftkeyAdd );
@@ -1082,6 +1088,11 @@
             	break;
             case EKeyEnter:
             	{
+            	// Check if find item highlight needs to be enabled
+                if ( CheckFindItemHighlightL( aKeyEvent, aType ) )
+                    {
+                    return EKeyWasConsumed;
+                    }
               	if (DoEnterKeyL() )
                 	{
                   	return EKeyWasConsumed;
@@ -1258,7 +1269,23 @@
               	{
             	const TPtrC details = iMtm->Entry().Entry().iDetails;
 
-                if( (FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) )
+                TInt focusedControl = FocusedControlId();                         
+                TBool senderHighlighted = EFalse;
+                
+                if ( focusedControl == EMsgComponentIdFrom )
+                    {
+                    CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
+                        iView->ControlById( EMsgComponentIdFrom ) );
+                    
+                    if ( address && address->Editor().SelectionLength() 
+                            == address->Editor().TextLength() )
+                        {
+                        senderHighlighted = ETrue;
+                        }
+                    }
+            	   	
+                if( ( focusedControl == EMsgComponentIdFrom ) && ( ( iMtm->Sender( ) ).Length() )
+                      && senderHighlighted )
                     {
                     iFindItemMenu->SetSenderHighlightStatus( ETrue );
                     iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) );
@@ -1271,7 +1298,8 @@
                   	0,
                   	aMenuPane,
                   	EFindItemMenuPlaceHolder,
-                  	TMmsGenUtils::PureAddress( iMtm->Sender() ),
+                  	senderHighlighted ? 
+                  	TMmsGenUtils::PureAddress( iMtm->Sender( ) ) : KNullDesC(),
           			( details.Length() == 0 ),
                   	EFalse );
           		//in sent folder reply is dimmed
@@ -1320,7 +1348,7 @@
         		aMenuPane,
               	EFindItemContextMenuPlaceHolder,
               	TMmsGenUtils::PureAddress( iMtm->Sender() ),
-        		( details.Length() != 0 ), //"Is sender known"
+        		( details.Length() == 0 ), //"Is sender known"
             	ETrue );
             // no items dimmed for now
           	if ( iMtm->Sender().Length() <= 0 )
@@ -4690,3 +4718,46 @@
     
     return result;
     }
+
+// ---------------------------------------------------------
+// CAudioMessageAppUi::CheckFindItemHighlightL
+// ---------------------------------------------------------
+//
+TBool CAudioMessageAppUi::CheckFindItemHighlightL( 
+    const TKeyEvent& aKeyEvent, TEventCode aType )
+    {   
+    TKeyResponse keyResp = EKeyWasNotConsumed;
+    CMsgExpandableControl* ctrl = NULL;
+    TBool checkHighlight = EFalse;
+    
+    if( iView->FocusedControl() )
+        {
+        ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() );
+        if ( ctrl )
+        	{	
+        	if ( ctrl->ControlType() == EMsgAddressControl
+                && !ctrl->Editor().SelectionLength()  ) 
+            {
+            checkHighlight = ETrue;
+            }
+        	else if ( ctrl->ControlType() == EMsgBodyControl )
+            {       
+            CItemFinder* itemFinder = iView->ItemFinder();
+            if ( FocusedControlId() == EMsgComponentIdBody && itemFinder
+                    && !itemFinder->CurrentSelection().Length() )
+                {                                                              
+                checkHighlight = ETrue;
+                }
+            }
+          }
+        }
+    
+    if ( ctrl && checkHighlight )
+        {
+        // Check if highlight needs to be restored to editor,
+        // address/body editor offerkeyevent will handle it
+        keyResp = ctrl->Editor().OfferKeyEventL( aKeyEvent, aType );
+        }    
+
+    return ( keyResp == EKeyWasConsumed ? ETrue : EFalse );  
+    }
--- a/mobilemessaging/mmsui/notviewersrc/NotViewerAppUi.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/mmsui/notviewersrc/NotViewerAppUi.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -614,8 +614,24 @@
     if (    iFlags & ENotViewerIsNotification )
         {   // Notification mode        
         if ( iView  )
-            {
-            if( (FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) )
+            {      
+            TInt focusedControl = FocusedControlId();                     
+            TBool senderHighlighted = EFalse;
+            
+            if ( focusedControl == EMsgComponentIdFrom )
+                {
+                CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
+                    iView->ControlById( EMsgComponentIdFrom ) );
+                
+                if ( address && address->Editor().SelectionLength() 
+                        == address->Editor().TextLength() )
+                    {
+                    senderHighlighted = ETrue;
+                    }
+                }
+        
+            if( ( focusedControl == EMsgComponentIdFrom ) && ( ( iMtm->Sender( ) ).Length() )
+                  && senderHighlighted )
                 {
                 iFindItemMenu->SetSenderHighlightStatus( ETrue );
                 iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) );
@@ -625,10 +641,13 @@
                 iFindItemMenu->SetSenderHighlightStatus( EFalse );
 		        }
 		    iFindItemMenu->AddItemFindMenuL( 
-                ( FocusedControlId() == EMsgComponentIdBody ) ? iView->ItemFinder() : 0,
+		        ( iView->ItemFinder() && 
+		          iView->ItemFinder()->CurrentSelection().Length() ) 
+		        ? iView->ItemFinder() : 0,
     			aMenuPane, 
                 EFindItemMenuPlaceHolder,
-                iMtm->Sender(),
+                senderHighlighted ? 
+                iMtm->Sender( ) : KNullDesC(),
                 iAlias && !iRemoteAlias ? ETrue : EFalse, //"Is sender known"
     			EFalse );
             }
@@ -867,6 +886,42 @@
         case EKeyDevice3:       //Selection key
         case EKeyEnter:         //Enter Key
             {
+            CMsgExpandableControl* ctrl = NULL;
+            TBool checkHighlight = EFalse;
+            
+            if( iView->FocusedControl() )
+                {
+                ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() );
+                if ( ctrl )
+                	{
+                	if ( ctrl->ControlType() == EMsgAddressControl
+                        && !ctrl->Editor().SelectionLength()  ) 
+                    {
+                    checkHighlight = ETrue;
+                    }
+                	else if ( ctrl->ControlType() == EMsgBodyControl )
+                    {       
+                    CItemFinder* itemFinder = iView->ItemFinder();
+                    if ( FocusedControlId() == EMsgComponentIdBody && itemFinder
+                            && !itemFinder->CurrentSelection().Length() )
+                        {                                                              
+                        checkHighlight = ETrue;
+                        }
+                    }
+                  }
+                }
+            if ( ctrl && checkHighlight )
+                {
+                // Check if highlight needs to be restored to editor,
+                // address/body editor offerkeyevent will handle it
+                if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) 
+                        == EKeyWasConsumed )
+                    {
+                    // Highlight was restored, just return, no cs menu needed
+                    return EKeyWasConsumed;
+                    }
+                } 
+  
             if ( DoSelectionKeyL( ) )
                 {
                 return EKeyWasConsumed;
--- a/mobilemessaging/mmsui/viewersrc/UniMmsViewerAppUi.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/mmsui/viewersrc/UniMmsViewerAppUi.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -1177,7 +1177,7 @@
             
             if ( !IsOwnMessage( ) )
                 {    
-                if( ( FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) 
+                if( ( focusedControl == EMsgComponentIdFrom ) && ( ( iMtm->Sender( ) ).Length() ) 
                       && senderHighlighted )
                     {
                     iFindItemMenu->SetSenderHighlightStatus( ETrue );
@@ -1190,8 +1190,9 @@
                 }
             
             iFindItemMenu->AddItemFindMenuL( 
-                ( iView->ItemFinder() && iView->ItemFinder()->CurrentSelection().Length() ) 
-                ? iView->ItemFinder( ) : 0,
+                ( iView->ItemFinder() && 
+                  iView->ItemFinder()->CurrentSelection().Length() ) 
+                ? iView->ItemFinder() : 0,
                 aMenuPane, 
                 EFindItemMenuPlaceHolder,
                 senderHighlighted ? 
@@ -1625,38 +1626,39 @@
         case EKeyDevice3:       //Selection key
         case EKeyEnter:         //Enter Key
             {                    
-            if( iView->FocusedControl()->ControlType() == EMsgAddressControl )
+            CMsgExpandableControl* ctrl = NULL;
+            TBool checkHighlight = EFalse;
+            
+            if( iView->FocusedControl() )
                 {
-                CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
-                    iView->FocusedControl() );
-                if ( address && !address->Editor().SelectionLength() )
+                ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() );
+                if ( ctrl->ControlType() == EMsgAddressControl
+                        && !ctrl->Editor().SelectionLength()  ) 
                     {
-                    // restore highlight to address field
-                    return address->Editor().OfferKeyEventL( aKeyEvent, aType );
-                    }               
-                }
-            else if ( iView->FocusedControl()->ControlType() == EMsgBodyControl )
-                {       
-                CItemFinder* itemFinder = iView->ItemFinder();
-                if ( FocusedControlId() == EMsgComponentIdBody 
-                     && itemFinder )
-                    {                                                                          
-                    if ( !itemFinder->CurrentSelection().Length() )
-                        {
-                        CMsgBodyControl* body = static_cast<CMsgBodyControl*>(
-                            iView->FocusedControl() );
-                        if ( body )
-                            {                     
-                             // restore highlight to current itemfinder item
-                            return body->Editor().OfferKeyEventL( aKeyEvent, aType );
-                            }
+                    checkHighlight = ETrue;
+                    }
+                else if ( ctrl->ControlType() == EMsgBodyControl )
+                    {       
+                    CItemFinder* itemFinder = iView->ItemFinder();
+                    if ( FocusedControlId() == EMsgComponentIdBody && itemFinder
+                            && !itemFinder->CurrentSelection().Length() )
+                        {                                                              
+                        checkHighlight = ETrue;
                         }
                     }
                 }
-            // fall through
-            } 
-        case EMsgFindItemKeyEvent:
-            {
+            if ( ctrl && checkHighlight )
+                {
+                // Check if highlight needs to be restored to editor,
+                // address/body editor offerkeyevent will handle it
+                if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) 
+                        == EKeyWasConsumed )
+                    {
+                    // Highlight was restored, just return, no cs menu needed
+                    return EKeyWasConsumed;
+                    }
+                }
+
             TInt focusedControl = FocusedControlId( );
             CMsgMediaControl* control = MediaControlById(focusedControl);
             if (control)
--- a/mobilemessaging/smilui/playersrc/SmilPlayerIndicatorController.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/smilui/playersrc/SmilPlayerIndicatorController.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -599,9 +599,18 @@
         {
         if ( iVolumeController &&
              iVolumeController->Rect().Contains( aPointerEvent.iPosition ) )
-            {
-            iVolumeController->HandlePointerEventL( aPointerEvent );                    
-            }
+                {
+                if (iPlayIndicator && !(iPlayIndicator->Rect().Contains( aPointerEvent.iPosition) ) ||
+                        (iPauseIndicator && !iPauseIndicator->Rect().Contains( aPointerEvent.iPosition )))
+                    {
+                    iVolumeController->HandlePointerEventL( aPointerEvent );
+                    }
+                else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+                    {
+                    iPresController->PlayPauseTappedL();
+                    }
+                
+                }
         else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
             {
             iPresController->PlayPauseTappedL();    
--- a/mobilemessaging/smsmtm/servermtm/group/SMSS.rss	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/smsmtm/servermtm/group/SMSS.rss	Thu Jul 15 18:34:37 2010 +0300
@@ -64,7 +64,12 @@
 				
 				//SMS Errors
 				SEND_ERROR { error = -4814; },	// KErrGsmSMSOperationNotAllowed
-				SEND_ERROR { error = -5252; }	// KPKIErrKeyStoreEmpty
+				SEND_ERROR { error = -5252; },	// KPKIErrKeyStoreEmpty
+				SEND_ERROR { error = -4533; },  // KErrGsmSMSShortMessageTransferRejected
+				SEND_ERROR { error = -4540; },  // KErrGsmSMSUnidentifiedSubscriber
+				SEND_ERROR { error = -4542; },  // KErrGsmSMSUnknownSubscriber
+				SEND_ERROR { error = -4550; },  // KErrGsmSMSNetworkOutOfOrder
+				SEND_ERROR { error = -4608; }   // KErrGsmSMSInvalidMandatoryInformation
 				};
 			},
 		SEND_ERROR_ACTION
--- a/mobilemessaging/smsmtm/servermtm/src/SMSSOUTB.CPP	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/smsmtm/servermtm/src/SMSSOUTB.CPP	Thu Jul 15 18:34:37 2010 +0300
@@ -23,7 +23,6 @@
 #include <logsmspdudata.h>
 #include <smsulog.h>
 #include <logwraplimits.h>
-#include <exterror.h>
 
 #include "SMSSendSession.h"
 #include "SMSSPAN.H"
@@ -211,15 +210,8 @@
 			{
 			if (iCurrentMessage)
 				{
-				if( (iProgress.iError == KErrGsmSMSShortMessageTransferRejected) || (iProgress.iError == KErrGsmSMSInvalidMandatoryInformation) || (iProgress.iError == KErrGsmSMSUnidentifiedSubscriber) ||
-					(iProgress.iError == KErrGsmSMSUnknownSubscriber) || (iProgress.iError == KErrGsmSMSNetworkOutOfOrder) )
-				    {
-					DoComplete(iProgress.iError);
-				    }
-				else
-				    {
-					ReScheduleFailedMessageL();
-				    }	
+                SMSSLOG(FLogFormat(_L8("CSmsOutboxSend::DoRunL(), error for ReSchedule %d"), iProgress.iError));
+				ReScheduleFailedMessageL();
 				}
 			else
 				{
--- a/mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -36,6 +36,7 @@
 #include <msgbiocontrol.h>              // CMsgBioControl
 #include <CGmsWrapper.h>                // CGmsWrapper
 #include <MsgNaviPaneControl.h>
+#include <MsgExpandableControlEditor.h>
 // messaging
 #include <smuthdr.h>                    // CSmsHeader
 #include <smsclnt.h>                    // CSmsClientMtm
@@ -979,7 +980,8 @@
                 CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
                     iView->ControlById( EMsgComponentIdFrom ) );
                            
-                if ( address && address->Editor().SelectionLength() )
+                if ( address && address->Editor().SelectionLength() 
+                        == address->Editor().TextLength() )
                     {
                     senderHighlighted = ETrue;
                     }
@@ -1105,7 +1107,8 @@
             CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
                 iView->ControlById( EMsgComponentIdFrom ) );
                        
-            if ( address && address->Editor().SelectionLength() )
+            if ( address && address->Editor().SelectionLength() 
+                    == address->Editor().TextLength() )
                 {
                 senderHighlighted = ETrue;
                 }
@@ -1614,39 +1617,40 @@
                 }
             case EKeyDevice3:
             case EKeyEnter:	
-                {             
-                if( iView->FocusedControl()->ControlType() == EMsgAddressControl )
+                {                                
+                CMsgExpandableControl* ctrl = NULL;
+                TBool checkHighlight = EFalse;
+                
+                if( iView->FocusedControl() )
                     {
-                    CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
-                        iView->FocusedControl() );
-                    if ( address && !address->Editor().SelectionLength() )
+                    ctrl = static_cast<CMsgExpandableControl*>( iView->FocusedControl() );
+                    if ( ctrl->ControlType() == EMsgAddressControl
+                            && !ctrl->Editor().SelectionLength()  ) 
                         {
-                        // restore highlight to address field
-                        return address->Editor().OfferKeyEventL( aKeyEvent, aType );
-                        }               
-                    }
-                else if ( iView->FocusedControl()->ControlType() == EMsgBodyControl )
-                    {       
-                    CItemFinder* itemFinder = iView->ItemFinder();
-                    if ( FocusedControlId() == EMsgComponentIdBody 
-                         && itemFinder )
-                        {                                                                          
-                        if ( !itemFinder->CurrentSelection().Length() )
-                            {
-                            CMsgBodyControl* body = static_cast<CMsgBodyControl*>(
-                                iView->FocusedControl() );
-                            if ( body )
-                                {                     
-                                 // restore highlight to current itemfinder item
-                                return body->Editor().OfferKeyEventL( aKeyEvent, aType );
-                                }
+                        checkHighlight = ETrue;
+                        }
+                    else if ( ctrl->ControlType() == EMsgBodyControl )
+                        {       
+                        CItemFinder* itemFinder = iView->ItemFinder();
+                        if ( FocusedControlId() == EMsgComponentIdBody && itemFinder
+                                && !itemFinder->CurrentSelection().Length() )
+                            {                                                              
+                            checkHighlight = ETrue;
                             }
                         }
                     }
-                // fall through
-                }
-            case EMsgFindItemKeyEvent:
-                {
+                if ( ctrl && checkHighlight )
+                    {
+                    // Check if highlight needs to be restored to editor,
+                    // address/body editor offerkeyevent will handle it
+                    if ( ctrl->Editor().OfferKeyEventL( aKeyEvent, aType ) 
+                            == EKeyWasConsumed )
+                        {
+                        // Highlight was restored, just return, no cs menu needed
+                        return EKeyWasConsumed;
+                        }
+                    }
+
                 // Selection-key checking (Context sensitive menu)
                 // (with Class 0 just show the menu)
                 if ( !iClass0CBA )
--- a/mobilemessaging/unieditor/application/inc/UniEditorAppUi.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorAppUi.h	Thu Jul 15 18:34:37 2010 +0300
@@ -1382,6 +1382,9 @@
       * Own. 
       */  
     	CAknStylusPopUpMenu* iEmbeddedObjectStylusPopup;
+		// sendui+jepg optimization changes
+    	TBool  iOptimizedFlow;
+    	TBool iSingleJpegImageProcessing;
     };
 
 #include "UniEditorAppUi.inl"
--- a/mobilemessaging/unieditor/application/inc/UniEditorLaunchOperation.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorLaunchOperation.h	Thu Jul 15 18:34:37 2010 +0300
@@ -94,6 +94,17 @@
         * Detach slide loader object
         */
         inline CUniSlideLoader* DetachSlideLoader();
+        
+        /**
+        * get header object
+        */
+        inline CUniEditorHeader* GetHeader();
+
+        /**
+        * get slide loader object
+        */
+        inline CUniSlideLoader* GetSlideLoader();
+
 
         /**
         * Return parse result
@@ -104,6 +115,11 @@
         * From MUniDataModelObserver
         */
         void RestoreReady( TInt aParseResult, TInt aError );
+            
+		/**
+        * check Is optimized flow
+        */  
+        TBool IsOptimizedFlagSet();
 
     protected: 
 
@@ -219,6 +235,8 @@
         TBool                           iSmilEditorSupported;
         // count of failed image operations
         TInt                            iParseResultTemp;
+		// sendui+jepg optimization changes
+        TBool 							iOptimizedFlow;
 
     };
 
--- a/mobilemessaging/unieditor/application/inc/UniEditorLaunchOperation.inl	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorLaunchOperation.inl	Thu Jul 15 18:34:37 2010 +0300
@@ -39,4 +39,22 @@
     return slideLoader;
     }
 
+// ---------------------------------------------------------
+// CUniEditorLaunchOperation::GetHeader
+// ---------------------------------------------------------
+//
+inline CUniEditorHeader* CUniEditorLaunchOperation::GetHeader()
+    {
+    return iHeader;
+    }
+
+// ---------------------------------------------------------
+// CUniEditorLaunchOperation::GetSlideLoader
+// ---------------------------------------------------------
+//
+inline CUniSlideLoader* CUniEditorLaunchOperation::GetSlideLoader()
+    {
+    return iSlideLoader;
+    }
+
 // End of file
--- a/mobilemessaging/unieditor/application/inc/UniEditorOperation.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorOperation.h	Thu Jul 15 18:34:37 2010 +0300
@@ -54,6 +54,7 @@
 enum TUniEditorOperationEvent
     {
     EUniEditorOperationProcessing,
+    EUniEditorOperationPartialComplete,
     EUniEditorOperationComplete,
     EUniEditorOperationError,
     // Cancel is called for active operation
--- a/mobilemessaging/unieditor/application/inc/UniEditorProcessImageOperation.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorProcessImageOperation.h	Thu Jul 15 18:34:37 2010 +0300
@@ -85,6 +85,11 @@
         * Detaches attachment id.
         */
         void DetachAttachmentId( TMsvAttachmentId& aAttachmentId );
+        
+	    /**
+        * Set Optimized Flow flag
+        */  
+        void SetOptimizedFlow(TBool aOptimizedFlow);
 
     protected:
 
@@ -205,9 +210,10 @@
         TInt                        iProcessMethod;
 
         TSize                       iScaleSize;
-        TSize                       iScaleSizeResult;
+  //      TSize                       iScaleSizeResult;
         TDataType                   iTargetType;
         TBool                       iExactImageScaling;
+        TBool                       iOptimizedFlow;
     };
 
 #endif //__UNIEDITORPROCESSIMAGEOPERATION_H
--- a/mobilemessaging/unieditor/application/inc/UniEditorSendUiOperation.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorSendUiOperation.h	Thu Jul 15 18:34:37 2010 +0300
@@ -73,6 +73,11 @@
         * Starts send ui operation
         */
         void Start();
+		
+        /**
+        * check Is optimized flow
+        */  
+        TBool IsOptimizedFlagSet();
 
     protected:
 
@@ -165,6 +170,8 @@
         CUniObject* iPreparedObject;
         TBool iDeleteAll;
         CUniEditorProcessTextOperation* iTextOperation;
+		// sendui+jepg optimization changes
+        TBool iOptimizedFlow; 
 
     };
 
--- a/mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -266,7 +266,9 @@
     iOriginalSlide( -1 ),
     iNextFocus( EMsgComponentIdNull ),
     iEditorFlags( EShowInfoPopups ),
-    iMskResId( R_UNIEDITOR_OPTIONS_CLOSE )
+    iMskResId( R_UNIEDITOR_OPTIONS_CLOSE ),
+    iOptimizedFlow(EFalse),
+    iSingleJpegImageProcessing(EFalse)
     {
     }
     
@@ -461,6 +463,22 @@
     {
     iEditorFlags |= EEditorExiting;
     
+	//sendui+jepg optimization changes
+    if(iLaunchOperation)
+        {
+        // check Is iLaunchOperation still attached to 
+        // iSlideLoader / iHeader
+        // Set the CUniEditorAppUi
+        // instance to NULL, to avoid crash.
+        if(iLaunchOperation->GetHeader())
+            {
+            iHeader = NULL;            
+            }
+        if(iLaunchOperation->GetSlideLoader())
+            {
+            iSlideLoader = NULL;            
+            }
+        }
     if ( iView )
         {
         // To prevent focus changes caused by input blocker deletion & toolbar extension
@@ -665,10 +683,31 @@
 //
 void CUniEditorAppUi::FinalizeLaunchL()
     {
+	// In all normal cases other then Sendui+Jepeg
+	// iOptimizedFlow will be false and flow should be 
+	// same as the normal launch
+    if(iOptimizedFlow)
+        {
+		//if iOptimizedFlow is True, it means
+		//sendui+Jepg and this is partial complete call
+        iSingleJpegImageProcessing = ETrue;
+        }
+		
     iFinalizeLaunchL = ETrue;
     iSmilModel = &Document()->DataModel()->SmilModel();
-    iHeader = iLaunchOperation->DetachHeader();
-    iSlideLoader = iLaunchOperation->DetachSlideLoader();
+	
+    if(!iOptimizedFlow)
+        {
+		//detach the iHeader and iSlideLoader
+        iHeader = iLaunchOperation->DetachHeader();
+        iSlideLoader = iLaunchOperation->DetachSlideLoader();
+        }
+    else
+        {
+		// get reference to complete partial lauch operation
+        iHeader = iLaunchOperation->GetHeader();
+        iSlideLoader = iLaunchOperation->GetSlideLoader();
+        }
     
     SetMessageTypeLockingL();
     
@@ -774,12 +813,41 @@
     MenuBar()->SetMenuType( CEikMenuBar::EMenuOptions );
     
     UpdateToolbarL();
-    
-    iEditorFlags |= ELaunchSuccessful;
-	
-    iView->ExecuteL( ClientRect(), focusedControlId );
+
+	// partial launch need to call execute to make
+	//the editor visible
+    if(iOptimizedFlow)
+        {
+        iView->ExecuteL( ClientRect(), focusedControlId );
+        }
+    else// not optmized Flow, common flow
+        {
+        // partial launch, dont set the flag
+        iEditorFlags |= ELaunchSuccessful;
+        
+		// in case of sendui+jepg , again finalize launch will be called 
+		//after image processing, no need to call iView->ExecuteL
+		// slide will be loaded already by slide loader.
+        if(!iSingleJpegImageProcessing)
+            {
+			//normal flow
+            iView->ExecuteL( ClientRect(), focusedControlId );
+            }
+        
+        //after the lauch complete for sendui+jepg
+        //rest it.
+        iSingleJpegImageProcessing = EFalse;        
+        }
+    
     delete iScreenClearer;
     iScreenClearer = NULL;
+   
+    // show note inserting 
+    if(iOptimizedFlow)
+        {
+        ShowWaitNoteL( R_QTN_UNI_WAIT_INSERTING );
+        }
+ 
 	
     }
     
@@ -6419,6 +6487,9 @@
     if ( iEditorFlags & EEditorExiting )
         {
         // Do not handle any event if we are exiting from editor.
+		// rest values.
+        iOptimizedFlow = EFalse;
+        iSingleJpegImageProcessing = EFalse;
         return;
         }
     
@@ -6426,9 +6497,20 @@
          aEvent == EUniEditorOperationError ||
          aEvent == EUniEditorOperationCancel )
         {
-        DeactivateInputBlocker();
-        iEditorFlags &= ~EMsgEditInProgress;   
-        
+		// set iOptimizedFlow
+        if( aOperation == EUniEditorOperationLaunch)
+            {
+            if(iLaunchOperation)
+                {
+                iOptimizedFlow = iLaunchOperation->IsOptimizedFlagSet();
+                }
+            }
+		// sendui+jepg-> this required after image processing 
+        if(!iOptimizedFlow)
+            {
+            DeactivateInputBlocker();
+            iEditorFlags &= ~EMsgEditInProgress;   
+            }
         if ( aEvent == EUniEditorOperationCancel &&
              aOperation != EUniEditorOperationSend )
             {
@@ -6447,6 +6529,15 @@
     TRAPD( error, DoEditorOperationEventL( aOperation, aEvent ) );
     if ( error != KErrNone )
         {
+		// error handling
+        if(iOptimizedFlow)
+            {
+            DeactivateInputBlocker();
+            iEditorFlags &= ~EMsgEditInProgress;   
+            }
+        iOptimizedFlow = EFalse;
+        iSingleJpegImageProcessing = EFalse;
+        
         // Handle operation handling error.
         if ( error == KLeaveExit )
             {
@@ -6463,6 +6554,10 @@
                 }
             }
         }
+    //sendui+jepg-> after first call to finallizelauch,rest
+	// it, so that next call will cover the code finallizelaunch
+	//as happened for other launch cases.
+    iOptimizedFlow = EFalse;
     }
 
 // ---------------------------------------------------------
@@ -6615,11 +6710,19 @@
 //
 void CUniEditorAppUi::DoLaunchCompleteL()
     {
-    // Does no harm to call this even if no wait note is set.
-    RemoveWaitNote();        
-
+	//sendui+jepg -> this required after image processing 
+    if(!iOptimizedFlow)
+        {
+        // Does no harm to call this even if no wait note is set.
+        RemoveWaitNote();        
+        }
+		
     TBool shutDown( EFalse );
-    ShowLaunchNotesL( shutDown );
+	// sendui+jepg-> this required after image processing 
+    if(!iOptimizedFlow)
+		{
+        ShowLaunchNotesL( shutDown );
+		}
     
     if ( shutDown )
         {
--- a/mobilemessaging/unieditor/application/src/UniEditorLaunchOperation.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/src/UniEditorLaunchOperation.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -115,7 +115,8 @@
     CUniEditorOperation( aOperationObserver, aDocument, aFs, EUniEditorOperationLaunch ),
     iControlObserver( aControlObserver ),
     iView( aView ),
-    iAppUi( aAppUi )
+    iAppUi( aAppUi ),
+    iOptimizedFlow(EFalse)
     {
     }
 
@@ -401,9 +402,13 @@
 //
 void CUniEditorLaunchOperation::DoPrepareHeaderL()
     {
-    // Header is always drawn and populated
-    iHeader = CUniEditorHeader::NewL( iDocument.Mtm(), iDocument, iView, iFs );
-    CompleteSelf( KErrNone );
+    if(!iHeader)
+        {
+	    // Header is always drawn and populated
+	    iHeader = CUniEditorHeader::NewL( iDocument.Mtm(), iDocument, iView, iFs );
+        }
+    if(!iOptimizedFlow)
+        CompleteSelf( KErrNone );
     }
 
 // ---------------------------------------------------------
@@ -412,21 +417,28 @@
 //
 void CUniEditorLaunchOperation::DoPrepareBodyL()
     {
-    iSlideLoader = CUniSlideLoader::NewL(
-        iControlObserver,
-        *iDocument.DataModel(),
-        iView,
-        EUniControlEditorMode );
-        
+    if(!iSlideLoader)
+        {
+     	iSlideLoader = CUniSlideLoader::NewL(
+	        iControlObserver,
+	        *iDocument.DataModel(),
+	        iView,
+	        EUniControlEditorMode );
+        }
+    
     if ( iDocument.DataModel()->SmilType() == EMmsSmil )
         {
-        if ( !iDocument.DataModel()->SmilModel().SlideCount() )
+        if(!iOptimizedFlow)
             {
-            iDocument.DataModel()->SmilModel().AddSlideL();
+	        if ( !iDocument.DataModel()->SmilModel().SlideCount() )
+	            {
+	            iDocument.DataModel()->SmilModel().AddSlideL();
+	            }
+            
+	        iSlideLoader->LoadSlideL( *this, 0 );       
+        
+	        SetPending();
             }
-            
-        iSlideLoader->LoadSlideL( *this, 0 );
-        SetPending();
         }
     else
         {
@@ -608,10 +620,25 @@
 // ---------------------------------------------------------
 //
 void CUniEditorLaunchOperation::HandleOperationEvent( TUniEditorOperationType aOperation,
-                                                      TUniEditorOperationEvent /*aEvent*/ )
+                                                      TUniEditorOperationEvent aEvent )
     {
     if ( aOperation == EUniEditorOperationSendUi )
         {
+        iOptimizedFlow = EFalse;
+        if(aEvent == EUniEditorOperationPartialComplete)
+            {
+            iOptimizedFlow = iSendUiOperation->IsOptimizedFlagSet();
+            if(iOptimizedFlow)
+                {
+                DoPrepareHeaderL();
+                DoPrepareBodyL();
+                iObserver.EditorOperationEvent(
+                            EUniEditorOperationLaunch,
+                            EUniEditorOperationComplete ); 
+                iOptimizedFlow = EFalse;
+                }
+            return;
+            }
         CArrayFixFlat<TInt>* errors = iSendUiOperation->GetErrors();
         for ( TInt i = 0; i < errors->Count(); i++ )
             {
@@ -654,6 +681,14 @@
     
     return parseResult;
     }
-
+	
+// ---------------------------------------------------------
+// CUniEditorLaunchOperation::IsOptimizedFlagSet
+// ---------------------------------------------------------
+//
+TBool CUniEditorLaunchOperation::IsOptimizedFlagSet()
+    {
+    return iOptimizedFlow; 
+    }
 
 // EOF
--- a/mobilemessaging/unieditor/application/src/UniEditorProcessImageOperation.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/src/UniEditorProcessImageOperation.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -98,7 +98,8 @@
         CUniEditorDocument& aDocument,
         RFs& aFs ) :
     CUniEditorOperation( aObserver, aDocument, aFs, EUniEditorOperationProcessImage ),
-    iNewAttaId( KMsvNullIndexEntryId )
+    iNewAttaId( KMsvNullIndexEntryId ),
+    iOptimizedFlow(EFalse)
     {
     }
 
@@ -258,6 +259,13 @@
 //
 void CUniEditorProcessImageOperation::DoStartProcessL()
     {
+    
+    if(iOptimizedFlow)
+        {
+         iObserver.EditorOperationEvent( EUniEditorOperationProcessImage,
+                                      EUniEditorOperationPartialComplete );   
+         iOptimizedFlow = EFalse;
+        }
     CreateEmptyAttachmentL();
     
     if ( !iImageProcessor )
@@ -646,5 +654,13 @@
     iNewImageInfo = NULL;
     return tempInfo;
     }
-    
+
+// ---------------------------------------------------------
+// CUniEditorProcessImageOperation::SetOptimizedFlow
+// ---------------------------------------------------------
+//
+void CUniEditorProcessImageOperation::SetOptimizedFlow(TBool aOptimizedFlow)
+    {
+    iOptimizedFlow =  aOptimizedFlow;
+    }
 // End of file
--- a/mobilemessaging/unieditor/application/src/UniEditorSendUiOperation.cpp	Mon Jun 21 15:36:19 2010 +0300
+++ b/mobilemessaging/unieditor/application/src/UniEditorSendUiOperation.cpp	Thu Jul 15 18:34:37 2010 +0300
@@ -134,6 +134,7 @@
     BaseConstructL();
     
     iDeleteAllLimit = ( iDocument.MaxMessageSize() * KSendAsDeleteAllPercentage ) / 100;
+    iOptimizedFlow = EFalse;
     }
 
 // ---------------------------------------------------------
@@ -222,6 +223,21 @@
 //
 void CUniEditorSendUiOperation::DoSendUiCheckL()
     {
+    // check is it, one embedded object with jpeg image
+    // captured from camera\ seleted from photo\ filemanager
+    TInt objectCount =iDocument.DataModel()->ObjectList().Count() ;
+    TInt slideCount =iDocument.DataModel()->SmilModel().SlideCount() ;
+    if ( (objectCount == 1)&&(slideCount == 1)&&
+         (iDocument.DataModel()->AttachmentList().Count()== 0))
+        {
+        CUniObject* obj = 
+        iDocument.DataModel()->SmilModel().GetObjectByIndex( slideCount-1, objectCount-1 );
+        if(obj->MediaInfo()->MimeType().CompareF( KMsgMimeImageJpeg )== 0)
+            {
+            iOptimizedFlow = ETrue;
+            }
+        }
+        
     if ( iDocument.DataModel()->ObjectList().Count() ||
          iDocument.DataModel()->AttachmentList().Count() )
         {
@@ -461,6 +477,7 @@
                 iImageOperation = CUniEditorProcessImageOperation::NewL( *this, iDocument, iFs );
                 }
                 
+            iImageOperation->SetOptimizedFlow(iOptimizedFlow);
             // Processes if needed:
             iImageOperation->Process( static_cast<CMsgImageInfo*>( aObject->MediaInfo() ),
                                       aObject->AttachmentId(),
@@ -564,7 +581,7 @@
 // ---------------------------------------------------------
 //
 void CUniEditorSendUiOperation::HandleOperationEvent( TUniEditorOperationType aOperation,
-                                                      TUniEditorOperationEvent /*aEvent*/ )
+                                                      TUniEditorOperationEvent aEvent )
     {
     TBool remove( EFalse );
     
@@ -573,6 +590,17 @@
     
     if ( aOperation == EUniEditorOperationProcessImage )
         {
+        if( aEvent == EUniEditorOperationPartialComplete)
+            {
+            if(iOptimizedFlow)
+                {           
+                iObserver.EditorOperationEvent( EUniEditorOperationSendUi,
+                                                EUniEditorOperationPartialComplete );
+                iOptimizedFlow = EFalse;                        
+                }
+            return;
+            }
+        iOptimizedFlow = EFalse;
         // Process image error handling
         CArrayFixFlat<TInt>* errors = iImageOperation->GetErrors();
         for ( TInt i = 0; i < errors->Count(); i++ )
@@ -660,5 +688,12 @@
     //else --> original object remains...
     CompleteOperation( KErrNone );
     }
-
+// ---------------------------------------------------------
+// CUniEditorSendUiOperation::IsOptimizedFlagSet
+// ---------------------------------------------------------
+//
+TBool CUniEditorSendUiOperation::IsOptimizedFlagSet()
+    {
+    return iOptimizedFlow; 
+    }
 // EOF
--- a/msg_plat/messaging_editor_api/inc/MsgExpandableControlEditor.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/msg_plat/messaging_editor_api/inc/MsgExpandableControlEditor.h	Thu Jul 15 18:34:37 2010 +0300
@@ -350,6 +350,7 @@
        CMsgEditorCustomDraw*    iCustomDraw;
        TInt                     iControlType;
        TInt                     iEditortop;
+       TBool                    iFindItemEventReceived;
     };
 
 #endif // CMSGEXPANDABLECONTROLEDITOR_H
--- a/msg_plat/messaging_editor_api/inc/MsgNaviPaneControl.h	Mon Jun 21 15:36:19 2010 +0300
+++ b/msg_plat/messaging_editor_api/inc/MsgNaviPaneControl.h	Thu Jul 15 18:34:37 2010 +0300
@@ -127,6 +127,15 @@
         */
         IMPORT_C void SetNavigationControlObserver( MMsgNaviPaneControlObserver* aObserver );
         
+        /**
+         * Get Message Iterator Instance  
+         *
+         * @since 9.2
+         *
+         * @return aMessageIterator Message iterator 
+         */
+        IMPORT_C CMessageIterator* GetMessageIterator();
+
     public: // Functions from base classes
 
         /**
--- a/msg_pub/messaging_editor_constants_api/inc/MsgEditor.hrh	Mon Jun 21 15:36:19 2010 +0300
+++ b/msg_pub/messaging_editor_constants_api/inc/MsgEditor.hrh	Thu Jul 15 18:34:37 2010 +0300
@@ -174,12 +174,6 @@
     EMsgFirstFreeComponentSpecificCommand = 2000
     };
     
-    
-//Internal Enumeration for find item functionality
-enum TMsgFindItemKeyCommands
-    {
-    EMsgFindItemKeyEvent = 0x55555555 
-    };
 
 #endif