201041
authorhgs
Tue, 19 Oct 2010 11:30:16 +0530
changeset 76 60a8a215b0ec
parent 73 ecf6a73a9186
201041
email/imap4mtm/imapprotocolcontroller/inc/cimapprotocolcontroller.h
email/imap4mtm/imapprotocolcontroller/src/cimapprotocolcontroller.cpp
email/imap4mtm/imapservermtm/src/cimap4servermtm.cpp
email/imap4mtm/imapservermtm/src/cimapupsresponsewaiter.cpp
email/imap4mtm/imapsession/inc/cimapsessionmanager.h
email/imap4mtm/imapsession/src/cimapsessionmanager.cpp
email/pop3andsmtpmtm/clientmtms/group/bld.inf
email/pop3andsmtpmtm/clientmtms/inc/CACHEMAN.H
email/pop3andsmtpmtm/clientmtms/inc/CONSYNC.H
email/pop3andsmtpmtm/clientmtms/inc/IMAPCMDS.H
email/pop3andsmtpmtm/clientmtms/inc/IMPCMTM.H
email/pop3andsmtpmtm/clientmtms/inc/MIUTMSG.H
email/pop3andsmtpmtm/clientmtms/inc/OFFOP.H
email/pop3andsmtpmtm/clientmtms/inc/POP3CMDS.H
email/pop3andsmtpmtm/clientmtms/inc/SMTPCMDS.H
email/pop3andsmtpmtm/clientmtms/inc/cimmessagepart.h
email/pop3andsmtpmtm/clientmtms/src/CONSYNC.CPP
email/pop3andsmtpmtm/clientmtms/src/IMPCMTM.CPP
email/pop3andsmtpmtm/clientmtms/src/MIUTMSG.CPP
email/pop3andsmtpmtm/clientmtms/src/POPCMTM.CPP
email/pop3andsmtpmtm/clientmtms/src/SMTCMTM.CPP
email/pop3andsmtpmtm/popservermtm/inc/POPS.H
email/pop3andsmtpmtm/popservermtm/inc/POPSMTM.H
email/pop3andsmtpmtm/popservermtm/inc/cpopsessionmanager.h
email/pop3andsmtpmtm/popservermtm/src/POPS.CPP
email/pop3andsmtpmtm/popservermtm/src/POPSMTM.CPP
email/pop3andsmtpmtm/popservermtm/src/cpopsessionmanager.cpp
email/pop3andsmtpmtm/servermtmutils/group/IMUT.mmp
email/pop3andsmtpmtm/servermtmutils/inc/IMCVCODC.H
email/pop3andsmtpmtm/servermtmutils/inc/IMSK.H
email/pop3andsmtpmtm/servermtmutils/inc/imutcon.h
email/pop3andsmtpmtm/servermtmutils/src/IMCVCODC.CPP
email/pop3andsmtpmtm/servermtmutils/src/IMSK.CPP
email/pop3andsmtpmtm/servermtmutils/src/imutcon.cpp
email/pop3andsmtpmtm/servermtmutils/test/src/T_IMSK01.cpp
email/pop3andsmtpmtm/smtpservermtm/inc/IMSM.H
email/pop3andsmtpmtm/smtpservermtm/inc/SMTS.H
email/pop3andsmtpmtm/smtpservermtm/inc/csmtpsessionmanager.h
email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP
email/pop3andsmtpmtm/smtpservermtm/src/IMSMSEND.CPP
email/pop3andsmtpmtm/smtpservermtm/src/IMSMSEND.H
email/pop3andsmtpmtm/smtpservermtm/src/SMTS.CPP
email/pop3andsmtpmtm/smtpservermtm/src/csmtpsessionmanager.cpp
email/pop3andsmtpmtm/smtpservermtm/src/csmtpupsresponsewaiter.cpp
messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro
messagingapp/msgnotifications/msgindicatorplugin/resources/message.svg
messagingapp/msgnotifications/msgindicatorplugin/rom/msgindicatorplugin.iby
messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp
messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp
messagingapp/msgservices/msgserviceapp/tsrc/tsrc.pro
messagingapp/msgui/bwins/unifiededitoru.def
messagingapp/msgui/conversationview/conversationview.pro
messagingapp/msgui/conversationview/conversationview.qrc
messagingapp/msgui/conversationview/inc/msgbodytextedit.h
messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h
messagingapp/msgui/conversationview/inc/msgconversationviewitem.h
messagingapp/msgui/conversationview/inc/msgconversationwidget.h
messagingapp/msgui/conversationview/resources/layouts/msgbodytextedit.css
messagingapp/msgui/conversationview/src/msgbodytextedit.cpp
messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp
messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp
messagingapp/msgui/conversationview/src/msgconversationwidget.cpp
messagingapp/msgui/conversationview/src/msgeditorwidget.cpp
messagingapp/msgui/eabi/unifiededitoru.def
messagingapp/msgui/msgapp/inc/msgactivityhandler.h
messagingapp/msgui/msgapp/inc/msgapplication.h
messagingapp/msgui/msgapp/inc/msglistview.h
messagingapp/msgui/msgapp/inc/msglistviewitem.h
messagingapp/msgui/msgapp/inc/msgmainwindow.h
messagingapp/msgui/msgapp/inc/msgviewmanager.h
messagingapp/msgui/msgapp/msgapp.pro
messagingapp/msgui/msgapp/src/draftslistview.cpp
messagingapp/msgui/msgapp/src/main.cpp
messagingapp/msgui/msgapp/src/msgactivityhandler.cpp
messagingapp/msgui/msgapp/src/msgapplication.cpp
messagingapp/msgui/msgapp/src/msglistview.cpp
messagingapp/msgui/msgapp/src/msglistviewitem.cpp
messagingapp/msgui/msgapp/src/msgmainwindow.cpp
messagingapp/msgui/msgapp/src/msgviewmanager.cpp
messagingapp/msgui/msgaudiofetcher/tsrc/tsrc.pri
messagingapp/msgui/msgaudiofetcher/tsrc/unittest_msgaudiofetchermodel/unittest_msgaudiofetchermodel.pro
messagingapp/msgui/msgaudiofetcher/tsrc/unittest_msgaudiopreview/unittest_msgaudiopreview.pro
messagingapp/msgui/msguiutils/src/msgservicelaunchutil.cpp
messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h
messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h
messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h
messagingapp/msgui/unifiededitor/inc/msgunieditoraudiowidget.h
messagingapp/msgui/unifiededitor/inc/msgunieditorbasewidget.h
messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h
messagingapp/msgui/unifiededitor/inc/msgunieditorbodyeditor.h
messagingapp/msgui/unifiededitor/inc/msgunieditorimageprocessor.h
messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h
messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.h
messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.inl
messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h
messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h
messagingapp/msgui/unifiededitor/inc/msgunieditorscrollarea.h
messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h
messagingapp/msgui/unifiededitor/inc/msgunieditorutils.h
messagingapp/msgui/unifiededitor/inc/msgunieditorview.h
messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css
messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml
messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbodyeditor.css
messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbodyeditor.widgetml
messagingapp/msgui/unifiededitor/resources/qtg_anim_loading.axml
messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorattachmentcontainer.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorbodyeditor.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorlineedit.cpp
messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorscrollarea.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/CatsFallingInLove1280x1024.jpg
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEGProgressive_8Mpix.jpg
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEGProgressive_QCIF.jpg
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEG_CIF.JPG
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEG_QCIF.jpg
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/WMF_Qcif.jpg
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/animated_gif_800X600.gif
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/gif87_bomb.gif
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/jpg_sun.jpg
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorutils/data/JPEG_CIF.JPG
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorutils/src/unittest_msgunieditorutils.cpp
messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorutils/unittest_msgunieditorutils.pro
messagingapp/msgui/unifiededitor/unifiededitor.pro
messagingapp/msgui/unifiededitor/unifiededitor.qrc
messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h
messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h
messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp
mobilemessaging/smsmtm/clientmtm/group/bld.inf
msg_plat/conversation_services_utilities_api/inc/ccsdefs.h
msg_plat/messaging_history_api/inc/msgitem.h
--- a/email/imap4mtm/imapprotocolcontroller/inc/cimapprotocolcontroller.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/imap4mtm/imapprotocolcontroller/inc/cimapprotocolcontroller.h	Tue Oct 19 11:30:16 2010 +0530
@@ -124,6 +124,7 @@
 	void MobilityError(TUint aError);
 	const TDesC8& MobilityProgress(); 
 
+	inline void SetSilentConnection(TBool aIsSilent);
 
 private:
 	CImapProtocolController(CMsvServerEntry& aEntry,CImapOfflineControl& aImapOfflineControl);
@@ -262,6 +263,13 @@
 	TBool 					iCancelInProgress;
 	TImapPcMigrateState		iMigrateState;
 	TImap4ProgressBuf 		iProgressBuffer;
+	TBool                   iIsSilent;
 	};
-							 
+
+
+inline void CImapProtocolController::SetSilentConnection(TBool aIsSilent)
+    {
+    iIsSilent = aIsSilent;
+    }
+
 #endif	//__CIMAPPROTOCOLCONTROLLER_H__
--- a/email/imap4mtm/imapprotocolcontroller/src/cimapprotocolcontroller.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/imap4mtm/imapprotocolcontroller/src/cimapprotocolcontroller.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -197,6 +197,7 @@
 		iImapSessionArray.AppendL(imapSession);
 
 		// Request the session manager to connect the session
+		iImapSessionManager->SetSilentConnection(iIsSilent);
 		iImapSessionManager->GetSessionL(iStatus, iImapSessionArray[0]);
 
 		iForegroundSession = 0;
--- a/email/imap4mtm/imapservermtm/src/cimap4servermtm.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/imap4mtm/imapservermtm/src/cimap4servermtm.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -641,10 +641,19 @@
 		}
 
 	case KIMAP4MTMConnect:
+	case KIMAP4MTMSilentConnect:
 		{
 		__LOG_TEXT(KDefaultLog, "     -  KIMAP4MTMConnect");
-		// Completes with KErrServerBusy if already connected, otherwise 
-		// establishes a connected IMAP session.
+		if(aCommand==KIMAP4MTMSilentConnect)
+		    {
+            iImapProtocolController->SetSilentConnection(ETrue);
+		    }
+		else
+		    {
+            iImapProtocolController->SetSilentConnection(EFalse);
+		    }
+	      // Completes with KErrServerBusy if already connected, otherwise 
+	      // establishes a connected IMAP session.
 		if (iImapProtocolController->Connected())
 			{
 			Queue(aStatus);
@@ -665,8 +674,17 @@
 		}
 		
 	case KIMAP4MTMConnectAndSynchronise:
+	case KIMAP4MTMSilentConnectAndSynchronise:
 		{
 		__LOG_TEXT(KDefaultLog, "     -  KIMAP4MTMConnectAndSynchronise");
+	      if(aCommand==KIMAP4MTMSilentConnectAndSynchronise)
+	            {
+	            iImapProtocolController->SetSilentConnection(ETrue);
+	            }
+	        else
+	            {
+	            iImapProtocolController->SetSilentConnection(EFalse);
+	            }
 		// Completes with KErrServerBusy if already connected, otherwise
 		// establishes a connected IMAP session.
 
--- a/email/imap4mtm/imapservermtm/src/cimapupsresponsewaiter.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/imap4mtm/imapservermtm/src/cimapupsresponsewaiter.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -67,11 +67,11 @@
 	{
 	__ASSERT_DEBUG(iState==EIMAP4MTMDisConnected, User::Invariant());
 	
-	if(aCommand == KIMAP4MTMConnect)
+	if(aCommand == KIMAP4MTMConnect || aCommand == KIMAP4MTMSilentConnect)
 		{
 		iState = EIMAP4MTMConnect;
 		}
-	else if(aCommand == KIMAP4MTMConnectAndSynchronise)	
+	else if(aCommand == KIMAP4MTMConnectAndSynchronise || aCommand == KIMAP4MTMSilentConnectAndSynchronise)	
 		{
 		iState = EIMAP4MTMConnectAndSynchronise;
 		}
--- a/email/imap4mtm/imapsession/inc/cimapsessionmanager.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/imap4mtm/imapsession/inc/cimapsessionmanager.h	Tue Oct 19 11:30:16 2010 +0530
@@ -86,7 +86,9 @@
 	IMPORT_C TInt GetAccessPointIdForConnection(TUint32& aAccessPointId) const;
 	// Close the current network connection
  	IMPORT_C void CloseNetworkConnection();
-
+ 	// Set whether silent connection is required or not
+ 	inline void SetSilentConnection(TBool aIsSilent);
+ 	
 private:
 	// Construction routines
 	CImapSessionManager(CImapSettings& aImapSettings, CImapMailStore& aImapMailStore);
@@ -236,9 +238,20 @@
 	// Flag to indicate if there was an error while  upgrading the socket to SSL/TLS.
 	TBool iErrorUpgradingSSLSocket;
 	
+	//Silent Connection
+	TBool iIsSilent;
 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
 	CImapAuthMechanismHelper::TImapAuthProfileFlag iCurrentAuthProfile;
 #endif
 	};
 
+/**
+Sets whether silent connection is required or not. If ETrue, Connection is established 
+without prompting the user.
+*/
+inline void CImapSessionManager::SetSilentConnection(TBool aIsSilent)
+    {
+    iIsSilent = aIsSilent;
+    }
+
 #endif // __CIMAPSESSIONMANAGER_H__
--- a/email/imap4mtm/imapsession/src/cimapsessionmanager.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/imap4mtm/imapsession/src/cimapsessionmanager.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -1024,7 +1024,7 @@
 		{
 		iImConnect = CImConnect::NewL(iImapSettings.IAPPreferences(), iSocketServ);
 		}
-
+	iImConnect->SetSilentConnection(iIsSilent);
 	iImConnect->StartL(iStatus);
 	iState = EStateCreatingNetworkConnection;
 	SetActive();
--- a/email/pop3andsmtpmtm/clientmtms/group/bld.inf	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/group/bld.inf	Tue Oct 19 11:30:16 2010 +0530
@@ -18,7 +18,7 @@
 PRJ_EXPORTS
 
 ../inc/MIUTHDR.H 	SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(miuthdr.h)
-../inc/MIUTHDR.INL 	SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(miuthdr.inl)
+../inc/MIUTHDR.INL 	SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(miuthdr.inl)
 ../inc/MIUTSET.H 	SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(miutset.h)
 ../inc/MIUTPARS.H 	SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(miutpars.h)
 ../inc/POP3SET.H 	SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(pop3set.h)
--- a/email/pop3andsmtpmtm/clientmtms/inc/CACHEMAN.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/CACHEMAN.H	Tue Oct 19 11:30:16 2010 +0530
@@ -21,7 +21,6 @@
 #if !defined (__CACHEMAN_H__)
 #define __CACHEMAN_H__
 
-#include <mentact.h>
 #include <msvstd.h>
 #include <msvapi.h>
 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS  
--- a/email/pop3andsmtpmtm/clientmtms/inc/CONSYNC.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/CONSYNC.H	Tue Oct 19 11:30:16 2010 +0530
@@ -174,6 +174,7 @@
 									  TInt 								aPriority, 
 									  TRequestStatus&					aStatus, 
 									  TImapConnectionCompletionState	aCompletionState, 
+	                                  TInt                              aFunctionId,
 									  MMsvImapConnectionObserver* 		aConnectionObserver=NULL
 									  );
 
@@ -205,7 +206,7 @@
 						 TImapConnectionCompletionState aCompletionState,
 						 MMsvImapConnectionObserver* aConnectionObserver
 						 );
-	void ConstructL(const CMsvEntrySelection& aSelection);
+	void ConstructL(const CMsvEntrySelection& aSelection, TInt aFunctionId);
 
 	void Completed(TInt aError);
 	TInt GetServiceProgress();
--- a/email/pop3andsmtpmtm/clientmtms/inc/IMAPCMDS.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/IMAPCMDS.H	Tue Oct 19 11:30:16 2010 +0530
@@ -48,6 +48,7 @@
 - Connect and logon to remote server:
   - #KIMAP4MTMConnect
   - #KIMAP4MTMDisconnect
+  - #KIMAP4MTMSilentConnect
 - Synchronise headers:
   - #KIMAP4MTMCancelBackgroundSynchronise
   - #KIMAP4MTMConnectAndSyncCompleteAfterConnect
@@ -59,6 +60,8 @@
   - #KIMAP4MTMInboxNewSync
   - #KIMAP4MTMSynchronise
   - #KIMAP4MTMWaitForBackground
+  - #KIMAP4MTMSilentConnectAndSynchronise
+  - #KIMAP4MTMSilentConnectAndSyncCompleteAfterFullSync
 - Subscribe to mailboxes:
   - #KIMAP4MTMLocalSubscribe
   - #KIMAP4MTMLocalUnsubscribe
@@ -153,6 +156,8 @@
 	This makes a network connection and logs on the IMAP server specified 
 	in the settings for the service. 
 	
+	Command KIMAP4MTMSilentConnect is also available to silently connect to the network.
+	
 	@c aSelection: @c aSelection[0] should contain the entry ID of the service 
 	to connect to.
 	 
@@ -175,6 +180,8 @@
 	The call completes when the connection occurs and the synchronisation starts. See
 	CImap4ClientMtm for a description of a background synchronisation.
 	
+	Command KIMAP4MTMSilentConnectAndSynchronise is also available to silently connect to the network.
+	
 	@c aSelection: @c aSelection[0] should contain the entry ID of the service 
 	to connect to.
 	 
@@ -491,6 +498,9 @@
 	This is similar to KIMAP4MTMConnectAndSynchronise, except that the operation
 	does not complete until synchronisation is complete.  
 	
+	Command KIMAP4MTMSilentConnectAndSyncCompleteAfterFullSync is also available to 
+	silently connect to the network.
+	
 	@c aSelection: @c aSelection[0] should contain the entry ID of the service 
 	to connect to.
 	 
@@ -1076,7 +1086,72 @@
 	The operation object returned is a CImEmailOperation. Final progress information 
 	from this contains the ID of the newly created message.
 	*/
-	KIMAP4MTMCreateReceiptEmailMessage
+	KIMAP4MTMCreateReceiptEmailMessage,
+	
+	/** Connects to the specified IMAP service.
+
+    This makes a network connection and logs on the IMAP server specified 
+    in the settings for the service. 
+    
+    This differs from KIMAP4MTMConnect by connecting to the network silently, without prompting the user.
+    
+    @c aSelection: @c aSelection[0] should contain the entry ID of the service 
+    to connect to.
+     
+    @c aParameter: packages a pointer to an implementation of the connection observer 
+    interface, MMsvImapConnectionObserver. Callbacks are made to this interface
+    to notify the client of the stages of connection.
+    
+    Completion: KErrBusy if the device is already connected to the specified server.
+
+    Example:
+    @code
+    TBuf8<1> parameter;
+    iOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMSilentConnect, *iServiceSelection, parameter, iStatus);    
+    @endcode	  
+	 */
+	KIMAP4MTMSilentConnect,
+	
+	/** Connects to the specified IMAP service, and starts a background synchronisation.
+
+    The call completes when the connection occurs and the synchronisation starts. See
+    CImap4ClientMtm for a description of a background synchronisation.
+    
+    This differs from KIMAP4MTMConnectAndSynchronise by connecting to the network silently, without prompting the user.
+    
+    @c aSelection: @c aSelection[0] should contain the entry ID of the service 
+    to connect to.
+     
+    @c aParameter: packages a pointer to an implementation of the connection observer 
+    interface, MMsvImapConnectionObserver. Callbacks are made to this interface
+    to notify the client of the stages of connection and synchronisation.
+    
+    Completion: KErrBusy if the device is already connected to the specified server. 
+    
+    Example:
+    @code
+    TPckg<MMsvImapConnectionObserver*> parameter(this); 
+    iOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMSilentConnectAndSynchronise, *iServiceSelection, parameter, iStatus);
+    @endcode 
+	 */
+	KIMAP4MTMSilentConnectAndSynchronise,
+
+	/** Connect and synchronise the specified service, and complete after synchronisation. 
+    
+    This is similar to KIMAP4MTMConnectAndSyncCompleteAfterFullSync except that it will not
+    prompt the user while connecting.
+    
+    @c aSelection: @c aSelection[0] should contain the entry ID of the service 
+    to connect to.
+     
+    @c aParameter: packages a pointer to an implementation of the connection observer 
+    interface, MMsvImapConnectionObserver. Callbacks are made to this interface
+    to notify the client of the stages of connection and synchronisation.
+    
+    Completion: KErrBusy if a connected session already exists. 
+	*/
+	KIMAP4MTMSilentConnectAndSyncCompleteAfterFullSync
+
 };
 
 #endif
--- a/email/pop3andsmtpmtm/clientmtms/inc/IMPCMTM.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/IMPCMTM.H	Tue Oct 19 11:30:16 2010 +0530
@@ -39,9 +39,7 @@
 #include <imapcmds.h>
 #endif
 
-#if !defined(__OFFOP_H__)
-#include <offop.h>
-#endif
+
 
 #if !defined(__MIUTMSG_H__)
 #include <miutmsg.h>
@@ -53,6 +51,20 @@
 class CImap4ClientSessionObserver;
 class CImImap4GetMail;
 class CImEmailAutoSend;
+class CImOffLineOperation;
+class CImOperationQueueList;
+
+class MImUndoOffLineOperation
+/**
+@publishedAll
+@released
+*/
+    {
+    public:
+        virtual void UndoOffLineChangesL(const CImOffLineOperation& aDeleted, TMsvId aFolderId) = 0; 
+    };
+
+
 
 //
 // Imap4 Client MTM  
--- a/email/pop3andsmtpmtm/clientmtms/inc/MIUTMSG.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/MIUTMSG.H	Tue Oct 19 11:30:16 2010 +0530
@@ -19,7 +19,6 @@
 
 #include <msvstd.h>
 #include <msvapi.h>			// TMsvEntry, CMsvOperation etc
-#include <mentact.h>		// CMsgActive
 #include <miuthdr.h>		// CImHeader, CImMimeHeader
 #include <txtrich.h>		// CRichText etc
 #include <miutdef.h>		// CImHeader, CImMimeHeader
@@ -31,10 +30,6 @@
 #include <barsc.h>		// RResourceFile
 #include <conarc.h>
 #include <conlist.h>
-
-#include <txtmrtsr.h>
-
-//#include <mmsvattachmentmanager.h>
 #include <s32mem.h>
 
 //Content-Transfer-Encoding: types
@@ -90,7 +85,7 @@
 #endif
 
 class CImHtmlConverter;
-
+class CMsgActive;
 class CImAttachmentManager;
 class CMsvMimeHeaders;
 class CImPlainBodyText;
--- a/email/pop3andsmtpmtm/clientmtms/inc/OFFOP.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/OFFOP.H	Tue Oct 19 11:30:16 2010 +0530
@@ -27,7 +27,7 @@
 #if !defined(__MSVSTORE_H__)
 #include <msvstore.h>
 #endif
-
+#include <impcmtm.h>
 #include <miut_err.h>
 
 const TInt KCurrentOfflineOperationArrayVersion = 2;
@@ -225,15 +225,7 @@
         CArrayFixFlat<TQueuedOperation> *iArray;
     };
 
-class MImUndoOffLineOperation
-/**
-@internalTechnology
-@released
-*/
-    {
-    public:
-        virtual void UndoOffLineChangesL(const CImOffLineOperation& aDeleted, TMsvId aFolderId) = 0; 
-    };
+
 
 class CImOperationQueueList : public CBase
 /**
--- a/email/pop3andsmtpmtm/clientmtms/inc/POP3CMDS.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/POP3CMDS.H	Tue Oct 19 11:30:16 2010 +0530
@@ -28,7 +28,8 @@
 	{
 	/** Unsupported. */
 	KPOP3MTMIsConnected = KMtmFirstFreeMtmFunctionId,
-	/** Attempt to connect to the current service. */
+	/** Attempt to connect to the current service. 
+	Command KPOP3MTMSilentConnect is also available to connect silently to network.*/
 	KPOP3MTMConnect,
 	/** Disconnect from the current service. */
 	KPOP3MTMDisconnect,
@@ -107,7 +108,9 @@
 	KPOP3MTMPopulateNew,
 	/** Populates all messages from the current service, assuming a new connection does 
 	not need to be made. */
-	KPOP3MTMPopulateAll 
+	KPOP3MTMPopulateAll,
+	/** Attempt to connect to the current service silently without prompting the user. */
+	KPOP3MTMSilentConnect
 	};
 
 #endif
--- a/email/pop3andsmtpmtm/clientmtms/inc/SMTPCMDS.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/SMTPCMDS.H	Tue Oct 19 11:30:16 2010 +0530
@@ -39,7 +39,11 @@
 	
 	If an Internet connection has already been established by another client, 
 	then this function may fail with KSmtpNoMsgsToSendWithActiveSettings if none 
-	of the messages specified in aSelection match the IAP currently in use. */
+	of the messages specified in aSelection match the IAP currently in use. 
+	
+	Command KSMTPMTMSilentlySendOnNextConnection is also available to silently connect
+	to the network.
+	*/
 	KSMTPMTMSendOnNextConnection,
 	/** Creates a new message. */
 	KSMTPMTMCreateNewEmailMessage,
@@ -50,7 +54,21 @@
 	/** Creates a new forwarded message as an attachment. */
 	KSMTPMTMCreateForwardAsAttachmentEmailMessage,
 	/** Creates a new message-receipt message. */
-	KSMTPMTMCreateReceiptEmailMessage
+	KSMTPMTMCreateReceiptEmailMessage,
+		
+	/** Send messages on next connection silently without prompting the user.
+	
+	The first entry in aSelection specifies the SMTP service entry that is to 
+	be used to send the email messages. aSelection may contain only one entry 
+	ID. The SMTP MTM will append the Ids of all "ready" email messages which exist 
+	in the outbox that match the IAP of the specified SMTP service. Whether an 
+	email message is "ready" is determined from its TMsvEntry::SendingState() 
+	flag.
+	
+	If an Internet connection has already been established by another client, 
+	then this function may fail with KSmtpNoMsgsToSendWithActiveSettings if none 
+	of the messages specified in aSelection match the IAP currently in use. */
+	KSMTPMTMSilentlySendOnNextConnection
 	};
 
 #endif
--- a/email/pop3andsmtpmtm/clientmtms/inc/cimmessagepart.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/inc/cimmessagepart.h	Tue Oct 19 11:30:16 2010 +0530
@@ -23,6 +23,8 @@
 #ifndef __CIMMESSAGEPART_H__
 #define __CIMMESSAGEPART_H__
 
+
+#include <txtmrtsr.h>
 class CImEmailMessage;
 class CImMimeHeader;
 class CMsvMimeHeaders;
--- a/email/pop3andsmtpmtm/clientmtms/src/CONSYNC.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/src/CONSYNC.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -39,6 +39,7 @@
 													CBaseMtm& aBaseMtm, TInt aPriority, 
 													TRequestStatus& aStatus, 
 													TImapConnectionCompletionState aCompletionState, 
+                                                    TInt aFunctionId,
 													MMsvImapConnectionObserver* aConnectionObserver)
 //
 //
@@ -46,7 +47,7 @@
 	{
 	CImapConnectAndSyncOp* self=new(ELeave) CImapConnectAndSyncOp(aSession, aSelection, aBaseMtm, aPriority, aStatus, aCompletionState, aConnectionObserver);
 	CleanupStack::PushL(self);
-	self->ConstructL(aSelection);
+	self->ConstructL(aSelection, aFunctionId);
 	CleanupStack::Pop(); //	self
 	return self;
 	}
@@ -68,7 +69,7 @@
 	iMtm=KUidMsgTypeIMAP4;
 	}
 
-void CImapConnectAndSyncOp::ConstructL(const CMsvEntrySelection& aSelection)
+void CImapConnectAndSyncOp::ConstructL(const CMsvEntrySelection& aSelection, TInt aFunctionId)
 //
 //
 //
@@ -97,7 +98,15 @@
 	// Start the connection operation
 	iSelection = aSelection.CopyL();
 	TBuf8<4> buf;
-	iOperation = iBaseMtm.InvokeAsyncFunctionL(KIMAP4MTMConnectAndSynchronise, *iSelection, buf, iStatus);
+	if(aFunctionId == KIMAP4MTMConnectAndSyncCompleteAfterFullSync)
+	    {
+        iOperation = iBaseMtm.InvokeAsyncFunctionL(KIMAP4MTMConnectAndSynchronise, *iSelection, buf, iStatus);
+	    }
+	else if(aFunctionId == KIMAP4MTMSilentConnectAndSyncCompleteAfterFullSync)
+	    {
+        iOperation = iBaseMtm.InvokeAsyncFunctionL(KIMAP4MTMSilentConnectAndSynchronise, *iSelection, buf, iStatus);
+	    }
+	    
 	SetActive();
 	iState = EConnecting;
 	iObserverRequestStatus=KRequestPending;
--- a/email/pop3andsmtpmtm/clientmtms/src/IMPCMTM.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/src/IMPCMTM.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -24,7 +24,7 @@
 #include <txtrich.h>
 #include <msvutils.h>
 #include <cemailaccounts.h>
-
+#include <offop.h>
 #include "MIUTMSG.H"	//CImEmailOperation
 #include "CONSYNC.H"
 #include <imcm.rsg>
@@ -583,6 +583,8 @@
 		{
 	case KIMAP4MTMConnect:
 	case KIMAP4MTMConnectAndSynchronise:
+	case KIMAP4MTMSilentConnect:
+	case KIMAP4MTMSilentConnectAndSynchronise:
 	case KIMAP4MTMDisconnect:
 		if (aFunctionId!=KIMAP4MTMDisconnect)
 			{
@@ -624,6 +626,7 @@
 	case KIMAP4MTMConnectAndSyncCompleteAfterConnect:
 	case KIMAP4MTMConnectAndSyncCompleteAfterFullSync:
 	case KIMAP4MTMConnectAndSyncCompleteAfterDisconnect:
+	case KIMAP4MTMSilentConnectAndSyncCompleteAfterFullSync:
 		{
 		TImapConnectionCompletionState connectAndSyncCompleteState = EAfterConnect;
 		switch (aFunctionId)
@@ -632,6 +635,7 @@
 				connectAndSyncCompleteState = EAfterConnect;
 				break;
 			case KIMAP4MTMConnectAndSyncCompleteAfterFullSync:
+			case KIMAP4MTMSilentConnectAndSyncCompleteAfterFullSync:
 				connectAndSyncCompleteState = EAfterFullSync;
 				break;
 			case KIMAP4MTMConnectAndSyncCompleteAfterDisconnect:
@@ -652,6 +656,7 @@
 												CActive::EPriorityStandard,
 												aCompletionStatus,
 												connectAndSyncCompleteState,
+												aFunctionId,
 												connectionObserver);
 		}
 		break;
--- a/email/pop3andsmtpmtm/clientmtms/src/MIUTMSG.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/src/MIUTMSG.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -36,6 +36,7 @@
 #include <eikenv.h>
 #include <txtrich.h>
 #include <cmsvbodytext.h>
+#include <mentact.h>        // CMsgActive
 #include <imcvcodc.h>
 #include <tz.h> //Converting from UTC to local time
 #include <tzconverter.h>
--- a/email/pop3andsmtpmtm/clientmtms/src/POPCMTM.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/src/POPCMTM.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -568,9 +568,10 @@
 	switch(aFunctionId)
 		{
 		case KPOP3MTMConnect:
+		case KPOP3MTMSilentConnect:
 		case KPOP3MTMDisconnect:
 		case KPOP3MTMCancelOfflineOperations:
-			if (aFunctionId==KPOP3MTMConnect)
+			if (aFunctionId==KPOP3MTMConnect || aFunctionId==KPOP3MTMSilentConnect)
 				{
 				RestoreSettingsL();
 				if (iImPop3Settings->AutoSendOnConnect()) 
--- a/email/pop3andsmtpmtm/clientmtms/src/SMTCMTM.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/clientmtms/src/SMTCMTM.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -724,6 +724,7 @@
 	case KMTMStandardFunctionsSendMessage:
 		return CMsvSmtpProgressOperation::NewL(Session(), aSelection, KSMTPMTMSendOnNextConnection, aParameter, aCompletionStatus);
 	case KSMTPMTMSendOnNextConnection:
+	case KSMTPMTMSilentlySendOnNextConnection:
 		return (Session().TransferCommandL(aSelection, aFunctionId, aParameter, aCompletionStatus));
 	case KSMTPMTMCreateNewEmailMessage:
 	case KSMTPMTMCreateReplyEmailMessage:
--- a/email/pop3andsmtpmtm/popservermtm/inc/POPS.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/popservermtm/inc/POPS.H	Tue Oct 19 11:30:16 2010 +0530
@@ -125,7 +125,7 @@
 	CImCaf*				iCaf;
 
 	CImPop3Capa*		iPopCapabilities;
-	TBuf8<KImMailMaxBufferSize>	iResponseBuffer;
+	TBuf8<KMailMaxBufferSize>	iResponseBuffer;
 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
 	TBool iSaslAuthLogin;
 	CPopAuthMechanismHelper* iPopAuthHelper;
--- a/email/pop3andsmtpmtm/popservermtm/inc/POPSMTM.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/popservermtm/inc/POPSMTM.H	Tue Oct 19 11:30:16 2010 +0530
@@ -129,7 +129,7 @@
 	void DoCancelCurrentOp();
 
 	void CheckMailboxStateL();
-	void DoConnectL(TRequestStatus& aStatus, CMsvEntrySelection& aSelection);
+	void DoConnectL(TRequestStatus& aStatus, CMsvEntrySelection& aSelection, TInt aCommand);
 	void DoRefreshL();
 	void DoCopyMoveL(const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aStatus, TImppCopyMethod aCopyMethod);
 	void DoQuitL(TRequestStatus& aStatus);
--- a/email/pop3andsmtpmtm/popservermtm/inc/cpopsessionmanager.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/popservermtm/inc/cpopsessionmanager.h	Tue Oct 19 11:30:16 2010 +0530
@@ -45,7 +45,8 @@
 	TBool HasConnection();
 	RConnection& GetConnection();
 	TInt GetAccessPointIdForConnection(TUint32& aAccessPointId) const;
-
+	void SetSilentConnection(TBool aIsSilent);
+	
 private:
 	enum TState
 		{
@@ -92,6 +93,9 @@
 
 	// State machine state
 	TState iState;
+	
+	//Silent Connection
+	TBool iIsSilent;
 	};
 
 #endif // __CPOPSESSIONMANAGER_H__
--- a/email/pop3andsmtpmtm/popservermtm/src/POPS.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/popservermtm/src/POPS.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -249,7 +249,7 @@
 		
 		if(iPopSettings->Apop() && iState==EWaitingForReply)
 			{
-			HBufC8* connectReply = HBufC8::NewL(KImMailMaxBufferSize);
+			HBufC8* connectReply = HBufC8::NewL(KMailMaxBufferSize);
 			// Delete iConnectReply if not NULL & assign newly created
 			delete iConnectReply;
 			iConnectReply = connectReply;
--- a/email/pop3andsmtpmtm/popservermtm/src/POPSMTM.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/popservermtm/src/POPSMTM.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -260,7 +260,8 @@
 	switch(aCommand)
 		{
 	case KPOP3MTMConnect: // KPop3MtmConnectUID
-		DoConnectL(aStatus, aSelection);
+	case KPOP3MTMSilentConnect:
+		DoConnectL(aStatus, aSelection, aCommand);
 		MOBILITY_TEST_MTM_STATE(iServiceId, KMobilityTestMtmStatePopConnecting);
 		break;
 	case KPOP3MTMDisconnect:
@@ -294,7 +295,7 @@
 //
 //
 //
-void CImppServerMtm::DoConnectL(TRequestStatus& aStatus, CMsvEntrySelection& aSelection)
+void CImppServerMtm::DoConnectL(TRequestStatus& aStatus, CMsvEntrySelection& aSelection, TInt aCommand)
 	{
 	__ASSERT_ALWAYS(iServerEntry, Panic(EPopNullPointer));
 	if(IsActive())
@@ -332,7 +333,14 @@
 		{
 		iSessionManager = CPopSessionManager::NewL();
 		}
-
+	if(aCommand == KPOP3MTMSilentConnect)
+	    {
+        iSessionManager->SetSilentConnection(ETrue);
+	    }
+	else
+	    {
+        iSessionManager->SetSilentConnection(EFalse);
+	    }
 #if (defined SYMBIAN_USER_PROMPT_SERVICE) 	
 	// Connect to UPS server and check if connection to remote server is permitted.
 	iWaiter->AuthoriseAndConnectL(iPopSettings, iClientThreadId, iHasCapability, iStatus);
--- a/email/pop3andsmtpmtm/popservermtm/src/cpopsessionmanager.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/popservermtm/src/cpopsessionmanager.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -245,6 +245,7 @@
 	else
 		{
 		iConnect = CImConnect::NewL(*iIAPPrefs, iServ);
+		iConnect->SetSilentConnection(iIsSilent);
 		iConnect->StartL(iStatus);
 		}
 	SetActive();
@@ -321,3 +322,12 @@
 
 	return KErrNotFound;
 	}
+
+/**
+Sets whether connection to the network has to be established silently or not.
+@param aIsSilent If ETrue then silent connection is required.
+*/
+void CPopSessionManager::SetSilentConnection(TBool aIsSilent)
+    {
+    iIsSilent = aIsSilent;
+    }
--- a/email/pop3andsmtpmtm/servermtmutils/group/IMUT.mmp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/group/IMUT.mmp	Tue Oct 19 11:30:16 2010 +0530
@@ -37,7 +37,7 @@
 LIBRARY         insock.lib charconv.lib commsdat.lib msgs.lib imcm.lib 
 LIBRARY         commdb.lib
 LIBRARY         caf.lib cafutils.lib
-LIBRARY         esocksvr.lib netmeta.lib
+LIBRARY         esocksvr.lib netmeta.lib extendedconnpref.lib
 LIBRARY         mobilitypolicyprovider.lib
 
 #ifdef __MOBILITY_TEST_FRAMEWORK
--- a/email/pop3andsmtpmtm/servermtmutils/inc/IMCVCODC.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/inc/IMCVCODC.H	Tue Oct 19 11:30:16 2010 +0530
@@ -27,11 +27,6 @@
 #include <miutatch.h>
 #include <miutconv.h>
 #include <miuthdr.h>
-#include <mentact.h>		// CMsgActive
-
-#include <imcvdata.h>
-#include <imcvtext.h>
-#include <imutdll.h>
 
 #define KBase64 _L("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")
 #define KCharFormat _L("%c")
--- a/email/pop3andsmtpmtm/servermtmutils/inc/IMSK.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/inc/IMSK.H	Tue Oct 19 11:30:16 2010 +0530
@@ -28,14 +28,9 @@
 #include <es_sock.h>
 #include <in_sock.h>
 #include <f32file.h>
-#include <mentact.h>
-#include <miutlog.h>
 #include <miut_err.h>
 #include <miuthdr.h>
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include "timrfc822datefield.h"				
-#endif
+#include <mentact.h>        // CMsgActive
 
 #ifdef _DEBUG
 #define __IMSK_SIMULATION
@@ -46,6 +41,8 @@
 #define __IMSK_SCRIPTING
 #endif
 
+const TInt KMailMaxBufferSize     = 1000; // 1000 is defined by the SMTP spec as max space
+
 /** 
 @publishedAll
 @released
@@ -66,7 +63,7 @@
 @publishedAll
 @released
 */
-typedef TBuf8<KImMailMaxBufferSize> TImMailBuffer;
+typedef TBuf8<KMailMaxBufferSize> TImMailBuffer;
 
 /** received buffer data line type
 @publishedAll
@@ -87,7 +84,7 @@
 class CImConnect;
 class CSecureSocket;
 class CImSocketIdleTimer;
-
+class CMsgActive;
 /**
 Creates/opens socket and sends and receives data.
 
@@ -384,7 +381,7 @@
 	//Do not call SetSecurity.  Call SetSSLTLSResponseL
 	IMPORT_C TInt SetSecurity(TBool aSecurityOn, TBool aUnattendedMode = FALSE);
 	IMPORT_C void PerformLogging(TBool aLogging);
-
+	inline void SetSilentConnection(TBool aIsSilent);
 private:
 /**
 	//cat			Construction and Destruction
@@ -613,6 +610,14 @@
 	/** SSL domain name for secure sockets */
 	HBufC8* iSSLDomainName;
 	TBool							iSocketIdleTimeSet;          // iSocketIdleTimeSet=ETrue, if smtp server did not responds within 10 seconds after sending "."
+	TBool  iIsSilent;	//Silent Connection
 	};
 
+
+// Sets if Silent connection is required or not
+inline void CImTextServerSession::SetSilentConnection(TBool aIsSilent)
+    {
+    iIsSilent = aIsSilent;
+    }
+
 #endif
--- a/email/pop3andsmtpmtm/servermtmutils/inc/imutcon.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/inc/imutcon.h	Tue Oct 19 11:30:16 2010 +0530
@@ -94,6 +94,14 @@
 	*/
 	IMPORT_C TInt GetLastSocketActivityTimeout(TUint32& aTimeout);
 
+	/**
+     @fn            SetSilentConnection(TBool aSilent)
+     Intended Usage :  Sets value for silent connection.
+     @since         10.1
+     @param         aSilent is true if silent connection is required.
+     */
+	inline void SetSilentConnection(TBool aIsSilentConn);
+	    
 #ifdef __IMSK_SIMULATION
 	// the code will ignore the first aIAPsToFail iaps in the preferences passed in.
 	// if this is more than the number of iaps then it will fail with KErrEtelModemNotDetected
@@ -147,7 +155,16 @@
 	// if this is more than the number of iaps then it will fail with KErrEtelModemNotDetected
 	TInt iIAPsToFail;
 #endif
+		   
+    //Indicates whether silent connection is chosen.
+    TBool iIsSilentConn;
 	};
 
+// Silent Connection
+inline void CImConnect::SetSilentConnection(TBool aIsSilentConn)
+    {
+    iIsSilentConn = aIsSilentConn;
+    }
+
 #endif
 
--- a/email/pop3andsmtpmtm/servermtmutils/src/IMCVCODC.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/src/IMCVCODC.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -17,6 +17,9 @@
 #include "IMCVCODC.H"
 #include "IMUTDLL.H"
 #include "IMCVSEND.H"
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
+#include "timrfc822datefield.h"               
+#endif
 
 const TInt8 AsciiToBase64[80]=
 	{
--- a/email/pop3andsmtpmtm/servermtmutils/src/IMSK.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/src/IMSK.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -18,16 +18,19 @@
 #include "IMSKSCR.H"
 #include "IMUTDLL.H"
 #include "cimsocketidletimer.h"
-
+#include <miutlog.h>
 #include <e32hal.h>
 #include <securesocket.h>
 
 #include <bautils.h>
 #include <barsread.h>
-
+#include <mentact.h>        // CMsgActive
 #include <es_enum.h>
 #include <ssl_internal.h>
 
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
+#include "timrfc822datefield.h"             
+#endif
 
 /*************************************************************
 * Notes:                                           
@@ -219,7 +222,7 @@
 //
 void CImTextServerSession::ConstructL()
 	{
-	iBuffer = HBufC8::NewL(KImMailMaxBufferSize*2 +2);
+	iBuffer = HBufC8::NewL(KMailMaxBufferSize*2 +2);
 
 	if (!iClientOwnsConnection)
 		{
@@ -338,7 +341,8 @@
 #if defined(__IMSK_SIMULATION)
 		iConnect->SetIAPsToFail(ReadConfigNum(KFailIAPConfigFile));
 #endif //(__IMSK_SIMULATION)
-
+		
+        iConnect->SetSilentConnection(iIsSilent);
 		// if local textseversession is active, then connect the session using existing RConnection
 		if(iPrimaryTextServerSession)
 			{
@@ -510,7 +514,7 @@
 	{
 	VA_LIST list;
 	VA_START(list,aFmt);
-	TBuf8<2*KImMailMaxBufferSize+2>aBuf;
+	TBuf8<2*KMailMaxBufferSize+2>aBuf;
 	aBuf.AppendFormatList(aFmt,list);
 
 	Send(aStatus, aBuf);
@@ -543,7 +547,7 @@
 	{
 	VA_LIST list;
 	VA_START(list,aFmt);
-	TBuf8<2*KImMailMaxBufferSize+2>aBuf;
+	TBuf8<2*KMailMaxBufferSize+2>aBuf;
 	aBuf.AppendFormatList(aFmt,list);
 
 	SendQueueReceive(aStatus, aBuf);
--- a/email/pop3andsmtpmtm/servermtmutils/src/imutcon.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/src/imutcon.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -17,7 +17,9 @@
 
 #include <commsdat.h>
 #include <commsdattypesv1_1.h>
-#include <commdbconnpref.h>
+#include <connpref.h>
+#include <extendedconnpref.h>
+
 #include <miut_err.h>
 #include <es_enum.h>		// For TConnectionInfo
 #include <imutcon.h>
@@ -95,14 +97,36 @@
 
 void CImConnect::ConnectWithSNAP()
 	{
-	TConnSnapPref snapPref(iIAPPreferences.SNAPPreference());
-	iConn.Start(snapPref, iStatus);
+	// Create connection preferences
+	TConnPrefList prefList;
+	TExtendedConnPref prefs;
+	
+	prefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
+	if(iIsSilentConn)
+	    {
+		prefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnSilent );
+	    }
+	prefs.SetSnapId(iIAPPreferences.SNAPPreference());
+	prefList.AppendL( &prefs );
+	
+	// Start a connection with connection preferences
+	iConn.Start( prefList, iStatus );
 	}
 
 void CImConnect::ConnectWithIAPListL()
 	{
 	TInt iapCount=iIAPPreferences.NumberOfIAPs();
 
+	// Create connection preferences
+	TConnPrefList prefList;
+	TExtendedConnPref prefs;
+	prefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
+	if(iIsSilentConn)
+	    {
+		prefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnSilent );
+	    }
+
+	
 	if(iapCount==0)
 		{
 #ifdef __IMSK_LOGGING
@@ -112,7 +136,9 @@
 			iTextSession->LogText(KImConDefault);
 			}
 #endif
-		iConn.Start(iStatus);
+		prefList.AppendL( &prefs );
+        // Start a connection with connection preferences
+		iConn.Start( prefList, iStatus );
 		}
 	else
 		{
@@ -141,32 +167,11 @@
 			}
 #endif
 
-		TInt rank=1;
-#ifdef __IMSK_SIMULATION
-		for(TInt i=iIAPsToFail;i<iapCount;i++)
-#else
-		for(TInt i=0;i<iapCount;i++)
-#endif
-			{
-			TCommDbConnPref pref;
-			pref.SetDirection(ECommDbConnectionDirectionOutgoing);
-			
-			// legacy code which restricted the type of bearer
-			pref.SetBearerSet(KCommDbBearerCSD | KCommDbBearerWcdma | KCommDbBearerLAN |
-			                  KCommDbBearerVirtual | KCommDbBearerPAN | KCommDbBearerWLAN);
+			TImIAPChoice iapChoice = iIAPPreferences.IAPPreference(0);
 
-			TImIAPChoice iapChoice = iIAPPreferences.IAPPreference(i);
-
-			pref.SetIapId(iapChoice.iIAP);
-			pref.SetDialogPreference(iapChoice.iDialogPref);
-
-			User::LeaveIfError(iPrefs.SetPreference(rank, pref));
-
-			rank++;
-			}
-
-		iPrefs.SetConnectionAttempts(rank-1);
-		iConn.Start(iPrefs, iStatus);
+			prefs.SetIapId(iapChoice.iIAP);
+			prefList.AppendL( &prefs );
+		iConn.Start(prefList, iStatus);
 		}
 	}
 
--- a/email/pop3andsmtpmtm/servermtmutils/test/src/T_IMSK01.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/servermtmutils/test/src/T_IMSK01.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -330,7 +330,7 @@
 		break;
 	case 7:
 		iImSocket->LogError(_L8("\t\tEnd of POP3 test session; completion code="),iStatus.Int());
-		TBuf8<KImMailMaxBufferSize> buffer;
+		TBuf8<KMailMaxBufferSize> buffer;
 		iLineStatus=iImSocket->GetCurrentTextLine(buffer);
 		test.Printf(TRefByValue<const TDesC>_L("Final %S\n "),&buffer);
 		CActiveScheduler::Stop();
--- a/email/pop3andsmtpmtm/smtpservermtm/inc/IMSM.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/inc/IMSM.H	Tue Oct 19 11:30:16 2010 +0530
@@ -57,9 +57,9 @@
 	~CMsgImOutboxSend();
 
 #if (defined SYMBIAN_USER_PROMPT_SERVICE)
-	void StartL(TRequestStatus& aStatus, TThreadId aClientThreadId, TBool aHasCapability);
+	void StartL(TRequestStatus& aStatus, TThreadId aClientThreadId, TBool aHasCapability, TBool aIsSilent);
 #endif		
-	void StartL(TRequestStatus& aStatus);
+	void StartL(TRequestStatus& aStatus, TBool aIsSilent);
 	
 	const TImSmtpProgress&	Progress();
 	TBool SessionIsConnected();
@@ -157,6 +157,8 @@
 	TBool iDecrementMessageCountAfterMigration;
 
 	TPckgBuf<TImSmtpProgress> iMobilityProgressBuffer;	
+	TBool iIsSilent;
+	
 	};
 
 #endif
--- a/email/pop3andsmtpmtm/smtpservermtm/inc/SMTS.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/inc/SMTS.H	Tue Oct 19 11:30:16 2010 +0530
@@ -92,7 +92,8 @@
 #endif
 
 	TNonOperationMtmDataAccessPointIdBuffer iMtmDataAccessPointIdBuffer;
-
+	TBool iIsSilent;
+	
 	};
 
 #endif
--- a/email/pop3andsmtpmtm/smtpservermtm/inc/csmtpsessionmanager.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/inc/csmtpsessionmanager.h	Tue Oct 19 11:30:16 2010 +0530
@@ -48,7 +48,8 @@
 	TBool IsSessionConnected();
 	TBool IsConnectionStarted();
 	TInt GetAccessPointIdForConnection(TUint32& aAccessPointId) const;
-
+	void SetSilentConnection(TBool aIsSilent);
+	
 private:
 	enum TState
 		{
@@ -102,6 +103,9 @@
 
 	// State machine state
 	TState iState;
+
+	// Silent Connection	
+	TBool iIsSilent;
 	};
 
 #endif // __CSMTPSESSIONMANAGER_H__
--- a/email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/IMSM.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -110,8 +110,9 @@
 	}
 
 #if (defined SYMBIAN_USER_PROMPT_SERVICE)	
-void CMsgImOutboxSend::StartL(TRequestStatus& aStatus, TThreadId aClientThreadId, TBool aHasCapability) 
+void CMsgImOutboxSend::StartL(TRequestStatus& aStatus, TThreadId aClientThreadId, TBool aHasCapability, TBool aIsSilent) 
 	{
+    iIsSilent = aIsSilent;
 	SetupStartL();
 
 	iState = EStateUserPrompting;
@@ -123,8 +124,9 @@
 	}
 #endif
 
-void CMsgImOutboxSend::StartL(TRequestStatus& aStatus) 
+void CMsgImOutboxSend::StartL(TRequestStatus& aStatus, TBool aIsSilent) 
 	{
+    iIsSilent = aIsSilent;
 	SetupStartL();
 	StartConnectingL();
 
@@ -164,6 +166,7 @@
 		{
 		iSessionManager = CSmtpSessionManager::NewL(iMobilityManager, iProgress.ServiceId());
 		}
+	iSessionManager->SetSilentConnection(iIsSilent);
 	iSessionManager->GetSessionL(iServerEntry, *iSettings, iSession, iStatus);
 	SetActive();
 	}
--- a/email/pop3andsmtpmtm/smtpservermtm/src/IMSMSEND.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/IMSMSEND.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -56,8 +56,9 @@
 Connect the session to the server
 
 @param aClientStatus Client status to be completed
+@param aIsSilent If ETrue then Silent Connection is required
 */
-void CImSmtpSession::ConnectL(TRequestStatus& aClientStatus)
+void CImSmtpSession::ConnectL(TRequestStatus& aClientStatus, TBool aIsSilent)
 	{
 	__ASSERT_DEBUG(!iSocketIsConnected, gPanic(EImsmSocketAlreadyConnected));
 
@@ -72,7 +73,7 @@
 
 		iCompleted = KErrNone;
 		iState = EConnectingToSmtp;		// Initialise to 1st state of state machine
-		DoStateL();						// Here we go...
+		DoStateL(aIsSilent);						// Here we go...
 		Queue(aClientStatus);		
 		}
 	else
@@ -316,16 +317,19 @@
 
 			TInt numberRcpts = rcptArray->Count();
 			if(numberRcpts)
-			{
-			iSendFiles->BccRcptArray().AppendL((*rcptArray)[0]);
-			CDesCArray& tempArr = iSendFiles->BccRcptArray();
-			for(TInt counter=1; counter<numberRcpts; counter++)
-				{
-				TInt aPos = 0;
-				tempArr.Find((*rcptArray)[counter],aPos,ECmpFolded16);			
-				if(aPos > 0)	
-				iSendFiles->BccRcptArray().AppendL((*rcptArray)[counter]);
-				}
+                {
+                iSendFiles->BccRcptArray().AppendL((*rcptArray)[0]);
+                CDesCArray& tempArr = iSendFiles->BccRcptArray();
+                for(TInt counter=1; counter<numberRcpts; counter++)
+                    {
+                    TInt aPos = 0;
+                    TInt found = tempArr.Find((*rcptArray)[counter],aPos,ECmpFolded16);			
+                    if(found == KErrNone && aPos > 0)
+                        {
+                        iSendFiles->BccRcptArray().AppendL((*rcptArray)[counter]);    
+                        }
+                    
+                    }
 				}
 			rcptArray->Reset();
 			}
@@ -820,7 +824,7 @@
 	return EClosingSmtp;
 	}
 
-void CImSmtpSession::DoStateL()
+void CImSmtpSession::DoStateL(TBool aIsSilent)
 // performs the operation required by iState
     {
     switch (iState)
@@ -830,6 +834,7 @@
 			i8BitMimeAcceptedHere = EFalse;
 			iSizeAcceptedHere = EFalse;
 			iStartTlsAcceptedHere = EFalse;
+            iSocket->SetSilentConnection(aIsSilent);
 			if(iSettings.SSLWrapper())
 				{
 				// Open secure socket on port 465 for SMTP session
--- a/email/pop3andsmtpmtm/smtpservermtm/src/IMSMSEND.H	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/IMSMSEND.H	Tue Oct 19 11:30:16 2010 +0530
@@ -126,7 +126,7 @@
 		~CImSmtpSession();
 	
 	public:
-		void ConnectL(TRequestStatus& aStatus);
+		void ConnectL(TRequestStatus& aStatus, TBool aIsSilent);
 		void SendFilesL(CMsgImOutboxSend& aSendFiles, TRequestStatus& aStatus);
 		void QuitL(TRequestStatus& aStatus);
 		TImImailFileProgress FileProgress();		// Return snapshot of session progress to client
@@ -147,7 +147,7 @@
 
 	private:
 		void SendFileL();						
-		void DoStateL();						// the state machine engine
+		void DoStateL(TBool aIsSilent = EFalse);						// the state machine engine
 		TInt NextStateL();						// logic which calculates next state from result of current operation
 		TInt NextStateFromWaitingForReply();
 		TInt NextStateFromAuthorisingSmtpL();
--- a/email/pop3andsmtpmtm/smtpservermtm/src/SMTS.CPP	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/SMTS.CPP	Tue Oct 19 11:30:16 2010 +0530
@@ -103,9 +103,9 @@
 	iOutboxSend = CMsgImOutboxSend::NewL(*iSendSelection,*iServerEntry,iServiceId);
 
 #if (defined SYMBIAN_USER_PROMPT_SERVICE)
-	iOutboxSend->StartL(iStatus, iClientThreadId, iHasCapability);
+	iOutboxSend->StartL(iStatus, iClientThreadId, iHasCapability, iIsSilent);
 #else
-	iOutboxSend->StartL(iStatus);
+	iOutboxSend->StartL(iStatus, iIsSilent);
 #endif
 	
 	SetActive();
@@ -197,6 +197,15 @@
             error = KErrDisconnected;    
         break;
     case KSMTPMTMSendOnNextConnection:
+    case KSMTPMTMSilentlySendOnNextConnection:
+        if(aCommand == KSMTPMTMSilentlySendOnNextConnection)
+            {
+            iIsSilent = ETrue;
+            }
+        else
+            {
+            iIsSilent = EFalse;
+            }
 		CopyFromLocalL(aSelection, aSelection.At(0), aStatus);
 		return;
     default:
--- a/email/pop3andsmtpmtm/smtpservermtm/src/csmtpsessionmanager.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/csmtpsessionmanager.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -291,6 +291,7 @@
 		iState = EStateCreatingConnection;
 
 		iConnect = CImConnect::NewL(iSettings->IapPrefs(), iServ);
+		iConnect->SetSilentConnection(iIsSilent);
 		iConnect->StartL(iStatus);
 		SetActive();
 		}
@@ -319,7 +320,7 @@
 	iState = EStateCreatingSession;
 
 	iSession = CImSmtpSession::NewL(*iServerEntry, *iSettings, iServ, *iConnect, iServiceId);
-	iSession->ConnectL(iStatus);
+	iSession->ConnectL(iStatus, iIsSilent);
 	SetActive();
 	}
 
@@ -370,3 +371,13 @@
 
 	return KErrNotFound;
 	}
+
+/**
+Sets whether connection to the network has to be established silently or not
+
+@param aIsSilent If ETrue then Silent connection is chosen.
+*/
+void CSmtpSessionManager::SetSilentConnection(TBool aIsSilent)
+    {
+    iIsSilent = aIsSilent;
+    }
--- a/email/pop3andsmtpmtm/smtpservermtm/src/csmtpupsresponsewaiter.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/email/pop3andsmtpmtm/smtpservermtm/src/csmtpupsresponsewaiter.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -13,7 +13,7 @@
 // Description:
 //
 
-#include "IMSMSEND.H"
+
 #include "csmtpupsresponsewaiter.h"
 
 #include <miut_err.h>
--- a/messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -49,8 +49,8 @@
 
 BLD_INF_RULES.prj_exports += \
   "$${LITERAL_HASH}include <platform_paths.hrh>" \
-  "rom/msgindicatorplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(msgindicatorplugin.iby)" \
-  "resources/message.svg             			/epoc32/winscw/c/resource/messaging/message.svg"
+  "rom/msgindicatorplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(msgindicatorplugin.iby)"
+  
   
  LIBS += -lxqservice \
  		 -lcsserverclientapi \
--- a/messagingapp/msgnotifications/msgindicatorplugin/resources/message.svg	Tue Oct 05 13:58:47 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="40px" version="1.1" viewBox="0 0 30 40" width="30px" x="0px" y="0px">
-<g>
-<path d="M27.458,17.31l-0.81-0.416l0.81-0.418c0.624-0.317,0.62-1.024,0.405-1.392l-0.881-1.512   c-0.251-0.43-0.877-0.683-1.406-0.336l-0.748,0.484l0.051-0.892c0.025-0.453-0.309-1.056-0.998-1.056h-1.764   c-0.57,0-1.031,0.48-0.998,1.056l0.051,0.892l-0.748-0.484c-0.402-0.263-1.08-0.22-1.406,0.336l-0.879,1.512   c-0.219,0.376-0.126,0.735-0.049,0.916H6C4.346,16,3,17.345,3,19v12c0,1.621,1.293,2.944,2.901,2.997v2.695   c0,1.407,1.723,2.251,2.869,1.029l3.063-3.723h11.165C24.654,33.999,26,32.653,26,31V20.706c0.185,0.031,0.699-0.003,0.982-0.487   l0.881-1.516C28.278,17.989,27.701,17.435,27.458,17.31z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M27,15.588l-0.882-1.512c0,1.023-6.239,1.58-6.239,0L19,15.588l7.118,4.126L27,18.199l-2.536-1.305   L27,15.588z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<path d="M4,26.718V31c0,1.101,0.9,2,2,2h0.901v3.692c0,0.517,0.646,0.86,1.098,0.394L11.362,33H23c1.1,0,2-0.899,2-2   v-4.282c0-0.004-0.001-0.007-0.001-0.011L4,26.718z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<linearGradient gradientTransform="matrix(1 0 0 1 -1530 0)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="1544.5" x2="1544.5" y1="13.4609" y2="38.8497">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.2239" style="stop-color:#FAD337"/>
-<stop offset="0.6537" style="stop-color:#EFAB26"/>
-<stop offset="1" style="stop-color:#E48717"/>
-</linearGradient>
-<path d="M23,16H6c-1.1,0-2,0.9-2,2v12c0,1.101,0.9,2,2,2h0.901v3.692c0,0.438,0.599,0.907,1.098,0.394   L11.362,32H23c1.1,0,2-0.899,2-2V18C25,16.9,24.1,16,23,16z" fill="url(#SVGID_1_)"/>
-<rect fill="#A55B11" height="1" width="10" x="9.5" y="20.5"/>
-<rect fill="#A55B11" height="1" width="10" x="9.5" y="23.5"/>
-<rect fill="#A55B11" height="1" width="6.25" x="9.5" y="26.5"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="14.7773" x2="14.7773" y1="17" y2="32.9845">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.2239" style="stop-color:#FAD337"/>
-<stop offset="0.6537" style="stop-color:#EFAB26"/>
-<stop offset="1" style="stop-color:#E48717"/>
-</linearGradient>
-<path d="M25,18c0-0.572-0.243-1.089-0.631-1.454l-0.706,0.705C23.869,17.435,24,17.702,24,18   v11.999c0,0.554-0.5,1.002-1,1.002H10.891l-2.989,3.627v-3.627H6c-0.263,0-0.499-0.107-0.678-0.274   c0.009,0.009,0.013,0.021,0.022,0.03l-0.79,0.616C4.92,31.757,5.432,32,6,32h0.901v3.692c0.005,0.61,0.755,0.782,1.098,0.394   L11.362,32H23c1.172,0,2-0.947,2-2V18z" fill="url(#SVGID_2_)" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M7.901,34.628v-3.627l-1,0.999v3.692c0,0.262,0.164,0.494,0.411,0.583L7.901,34.628z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M5.345,30.757c-0.212-0.184-0.347-0.455-0.347-0.758V18c0-0.552,0.449-1.001,1.002-1.001h17   c0.254,0,0.457,0.069,0.663,0.252l0.706-0.705C24.011,16.208,23.528,16,23,16H6c-1.1,0-2,0.9-2,2v12   c0,0.532,0.211,1.017,0.552,1.376L5.345,30.757z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<path d="M7.901,31.001H6c-0.263,0-0.499-0.107-0.678-0.274c0.009,0.009,0.013,0.021,0.022,0.03l-0.79,0.616   C4.92,31.757,5.432,32,6,32h0.901L7.901,31.001z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M25,18c0-0.572-0.243-1.089-0.631-1.454l-0.706,0.705C23.869,17.435,24,17.702,24,18v11.999   c0,0.585-0.562,1.002-1,1.002H10.891l-2.989,3.627l-0.589,1.647c0.067,0.024,0.422,0.105,0.687-0.189L11.362,32H23   c0.984,0,2-0.775,2-2V18z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M25,16.619L24.25,16h-5.518c0.014,0.009,1.713,0.894,1.713,0.894l-1.675,0.86   c-0.317,0.205-0.271,0.577-0.204,0.694l0.879,1.515c0.352,0.402,0.623,0.224,0.705,0.171l1.574-1.017l-0.105,1.856   c0.021,0.438,0.361,0.527,0.498,0.527h1.764c0.4,0,0.508-0.391,0.498-0.527l-0.104-1.856L25,19.587V16.619z" fill-opacity="0.3" stroke-opacity="0.3"/>
-<polygon fill="#EA2227" points="27,17.199 26.118,18.714 23.722,17.162 23.881,20 22.117,20 22.277,17.162 19.879,18.714    19,17.199 21.537,15.895 19,14.588 19.879,13.076 22.277,14.625 22.117,11.771 23.881,11.771 23.722,14.625 26.118,13.076    27,14.588 24.464,15.895  "/>
-<rect fill="none" height="40" width="30"/>
-</g>
-</svg>
--- a/messagingapp/msgnotifications/msgindicatorplugin/rom/msgindicatorplugin.iby	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgnotifications/msgindicatorplugin/rom/msgindicatorplugin.iby	Tue Oct 19 11:30:16 2010 +0530
@@ -20,5 +20,4 @@
 REM DLL
 file=ABI_DIR\UREL\msgindicatorplugin.dll               SHARED_LIB_DIR\msgindicatorplugin.dll UNPAGED
 data=\epoc32\data\z\resource\plugins\indicators\msgindicatorplugin.qtplugin   \resource\plugins\indicators\msgindicatorplugin.qtplugin
-data=\epoc32\winscw\c\resource\messaging\message.svg   \resource\messaging\message.svg
 #endif
\ No newline at end of file
--- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -360,7 +360,11 @@
             "displayErrorNote(QVariantList)", false);
 
     snd << args;
-    snd.send();
+    if (!snd.send()) 
+    {
+        int lastErr = snd.latestError();
+        QDEBUG_WRITE_FORMAT("MsgNotifierPrivate displayFailedNote failed", lastErr);
+    }
     
     QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote end.")
     }
--- a/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -90,7 +90,6 @@
         {
         case MsgBaseView::UNIEDITOR:
             {
-            mUniEditor->saveContentToDrafts();
             HbApplication::quit();
             break;
             }
--- a/messagingapp/msgservices/msgserviceapp/tsrc/tsrc.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgservices/msgserviceapp/tsrc/tsrc.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -19,7 +19,7 @@
 CONFIG += ordered
 
 #Sub .pro files
-SUBDIRS += msgserviceapptest/msgserviceapptest.pro
+SUBDIRS += msgserviceapptest
 
 # Platforms
 SYMBIAN_PLATFORMS = DEFAULT
\ No newline at end of file
--- a/messagingapp/msgui/bwins/unifiededitoru.def	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/bwins/unifiededitoru.def	Tue Oct 19 11:30:16 2010 +0530
@@ -1,69 +1,62 @@
 EXPORTS
-	?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 1 NONAME ; void MsgUnifiedEditorView::fetchImages(void)
-	?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 2 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *)
-	?fetchMessageFromStore@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@H@Z @ 3 NONAME ; void MsgUnifiedEditorView::fetchMessageFromStore(class ConvergedMessageId &, enum ConvergedMessage::MessageType, int)
-	?onContentChanged@MsgUnifiedEditorView@@AAEXXZ @ 4 NONAME ; void MsgUnifiedEditorView::onContentChanged(void)
-	?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject
-	?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 6 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *)
-	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 7 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int)
-	?vkbAboutToClose@MsgUnifiedEditorView@@AAEXXZ @ 8 NONAME ; void MsgUnifiedEditorView::vkbAboutToClose(void)
-	?onDialogSmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 9 NONAME ; void MsgUnifiedEditorView::onDialogSmsSettings(class HbAction *)
-	?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::addCcBcc(void)
-	?saveContentToDrafts@MsgUnifiedEditorView@@QAEHXZ @ 11 NONAME ; int MsgUnifiedEditorView::saveContentToDrafts(void)
-	?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 12 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &)
-	?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 13 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &)
-	?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 14 NONAME ; void MsgUnifiedEditorView::addSubject(void)
-	?createTempFolder@MsgUnifiedEditorView@@AAE_NXZ @ 15 NONAME ; bool MsgUnifiedEditorView::createTempFolder(void)
-	?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 16 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &)
-	?setFocus@MsgUnifiedEditorView@@AAEXPAVMsgUnifiedEditorBaseWidget@@@Z @ 17 NONAME ; void MsgUnifiedEditorView::setFocus(class MsgUnifiedEditorBaseWidget *)
-	?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 18 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &)
-	?isReplyPathBroken@MsgUnifiedEditorView@@AAE_NXZ @ 19 NONAME ; bool MsgUnifiedEditorView::isReplyPathBroken(void)
-	?removeTempFolder@MsgUnifiedEditorView@@AAEXXZ @ 20 NONAME ; void MsgUnifiedEditorView::removeTempFolder(void)
-	?vkbOpened@MsgUnifiedEditorView@@AAEXXZ @ 21 NONAME ; void MsgUnifiedEditorView::vkbOpened(void)
-	?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 22 NONAME ; void MsgUnifiedEditorView::addMenu(void)
-	??_EMsgUnifiedEditorView@@UAE@I@Z @ 23 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int)
-	?setAttachOptionEnabled@MsgUnifiedEditorView@@AAEXW4TBE_AttachOption@1@_N@Z @ 24 NONAME ; void MsgUnifiedEditorView::setAttachOptionEnabled(enum MsgUnifiedEditorView::TBE_AttachOption, bool)
-	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 25 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int)
-	?send@MsgUnifiedEditorView@@AAEXXZ @ 26 NONAME ; void MsgUnifiedEditorView::send(void)
-	?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@_N@Z @ 27 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &, bool)
-	?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 28 NONAME ; void MsgUnifiedEditorView::addToolBar(void)
-	?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 29 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *)
-	?onAudioSelected@MsgUnifiedEditorView@@AAEXAAVQString@@@Z @ 30 NONAME ; void MsgUnifiedEditorView::onAudioSelected(class QString &)
-	?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 31 NONAME ; void MsgUnifiedEditorView::fetchContacts(void)
-	?formatAddresses@MsgUnifiedEditorView@@AAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 32 NONAME ; void MsgUnifiedEditorView::formatAddresses(class QList<class ConvergedMessageAddress *> &)
-	?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 33 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList)
-	??0CUniImageProcessor@@QAE@PAVMUniImageProcessorCallback@@@Z @ 34 NONAME ; CUniImageProcessor::CUniImageProcessor(class MUniImageProcessorCallback *)
-	?fetchAudio@MsgUnifiedEditorView@@AAEXXZ @ 35 NONAME ; void MsgUnifiedEditorView::fetchAudio(void)
-	?changePriority@MsgUnifiedEditorView@@AAEXXZ @ 36 NONAME ; void MsgUnifiedEditorView::changePriority(void)
-	?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 38 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool)
-	?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 39 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &)
-	?vkbAboutToOpen@MsgUnifiedEditorView@@AAEXXZ @ 40 NONAME ; void MsgUnifiedEditorView::vkbAboutToOpen(void)
-	?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 41 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void)
-	?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 42 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void)
-	?onDialogMmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 43 NONAME ; void MsgUnifiedEditorView::onDialogMmsSettings(class HbAction *)
-	?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 44 NONAME ; void MsgUnifiedEditorView::populateContent(class QList<class QVariant> const &)
-	?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 45 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int)
-	?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 46 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const
-	?vkbClosed@MsgUnifiedEditorView@@AAEXXZ @ 47 NONAME ; void MsgUnifiedEditorView::vkbClosed(void)
-	?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 48 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *)
-	?enableSendButton@MsgUnifiedEditorView@@AAEX_N@Z @ 49 NONAME ; void MsgUnifiedEditorView::enableSendButton(bool)
-	?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 50 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int)
-	?handleKeyEvent@MsgUnifiedEditorView@@UAE_NH@Z @ 51 NONAME ; bool MsgUnifiedEditorView::handleKeyEvent(int)
-	?initView@MsgUnifiedEditorView@@AAEXXZ @ 52 NONAME ; void MsgUnifiedEditorView::initView(void)
-	?packMessage@MsgUnifiedEditorView@@AAEHAAVConvergedMessage@@_N@Z @ 53 NONAME ; int MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool)
-	??1MsgUnifiedEditorView@@UAE@XZ @ 54 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void)
-	?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 55 NONAME ; void MsgUnifiedEditorView::hideChrome(bool)
-	?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 56 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void)
-	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *)
-	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *)
-	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 59 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int)
-	?Reset@CUniImageProcessor@@QAEXXZ @ 60 NONAME ; void CUniImageProcessor::Reset(void)
-	?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 61 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList<class QVariant> const &)
-	?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 62 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &)
-	?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 63 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void)
-	??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 64 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *)
-	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int)
-	?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 66 NONAME ; void MsgUnifiedEditorView::deleteMessage(void)
-	?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 67 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void)
+	?fetchAudio@MsgUnifiedEditorView@@AAEXXZ @ 1 NONAME ; void MsgUnifiedEditorView::fetchAudio(void)
+	??0CUniImageProcessor@@QAE@PAVMUniImageProcessorCallback@@@Z @ 2 NONAME ; CUniImageProcessor::CUniImageProcessor(class MUniImageProcessorCallback *)
+	?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@_N1@Z @ 3 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &, bool, bool)
+	?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 5 NONAME ; void MsgUnifiedEditorView::fetchImages(void)
+	?focusChanged@MsgUnifiedEditorView@@AAEXXZ @ 6 NONAME ; void MsgUnifiedEditorView::focusChanged(void)
+	?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 7 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void)
+	?fetchMessageFromStore@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@H@Z @ 8 NONAME ; void MsgUnifiedEditorView::fetchMessageFromStore(class ConvergedMessageId &, enum ConvergedMessage::MessageType, int)
+	?onContentChanged@MsgUnifiedEditorView@@AAEXXZ @ 9 NONAME ; void MsgUnifiedEditorView::onContentChanged(void)
+	?doLayout@MsgUnifiedEditorView@@AAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::doLayout(void)
+	?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 11 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject
+	?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 12 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void)
+	?resetLayout@MsgUnifiedEditorView@@AAEXXZ @ 13 NONAME ; void MsgUnifiedEditorView::resetLayout(void)
+	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 14 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int)
+	?onDialogSmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 15 NONAME ; void MsgUnifiedEditorView::onDialogSmsSettings(class HbAction *)
+	?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 16 NONAME ; void MsgUnifiedEditorView::populateContent(class QList<class QVariant> const &)
+	?onDialogMmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 17 NONAME ; void MsgUnifiedEditorView::onDialogMmsSettings(class HbAction *)
+	?ensureVisibility@MsgUnifiedEditorView@@AAEXXZ @ 18 NONAME ; void MsgUnifiedEditorView::ensureVisibility(void)
+	?addCcBcc@MsgUnifiedEditorView@@AAEX_N@Z @ 19 NONAME ; void MsgUnifiedEditorView::addCcBcc(bool)
+	?saveContentToDrafts@MsgUnifiedEditorView@@QAEHXZ @ 20 NONAME ; int MsgUnifiedEditorView::saveContentToDrafts(void)
+	?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 21 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int)
+	?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 22 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &)
+	?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const
+	?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 24 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &)
+	?createTempFolder@MsgUnifiedEditorView@@AAE_NXZ @ 25 NONAME ; bool MsgUnifiedEditorView::createTempFolder(void)
+	?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 26 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &)
+	?enableMenuAction@MsgUnifiedEditorView@@AAEXH_N@Z @ 27 NONAME ; void MsgUnifiedEditorView::enableMenuAction(int, bool)
+	?setFocus@MsgUnifiedEditorView@@AAEXPAVMsgUnifiedEditorBaseWidget@@@Z @ 28 NONAME ; void MsgUnifiedEditorView::setFocus(class MsgUnifiedEditorBaseWidget *)
+	?vkbClosed@MsgUnifiedEditorView@@AAEXXZ @ 29 NONAME ; void MsgUnifiedEditorView::vkbClosed(void)
+	?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 30 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &)
+	?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 31 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *)
+	?isReplyPathBroken@MsgUnifiedEditorView@@AAE_NXZ @ 32 NONAME ; bool MsgUnifiedEditorView::isReplyPathBroken(void)
+	?addSubject@MsgUnifiedEditorView@@AAEX_N@Z @ 33 NONAME ; void MsgUnifiedEditorView::addSubject(bool)
+	?removeTempFolder@MsgUnifiedEditorView@@AAEXXZ @ 34 NONAME ; void MsgUnifiedEditorView::removeTempFolder(void)
+	?vkbOpened@MsgUnifiedEditorView@@AAEXXZ @ 35 NONAME ; void MsgUnifiedEditorView::vkbOpened(void)
+	?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 36 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int)
+	?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 37 NONAME ; void MsgUnifiedEditorView::addMenu(void)
+	?handleKeyEvent@MsgUnifiedEditorView@@UAE_NH@Z @ 38 NONAME ; bool MsgUnifiedEditorView::handleKeyEvent(int)
+	?packMessage@MsgUnifiedEditorView@@AAEHAAVConvergedMessage@@_N@Z @ 39 NONAME ; int MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool)
+	?initView@MsgUnifiedEditorView@@AAEXXZ @ 40 NONAME ; void MsgUnifiedEditorView::initView(void)
+	??_EMsgUnifiedEditorView@@UAE@I@Z @ 41 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int)
+	??1MsgUnifiedEditorView@@UAE@XZ @ 42 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void)
+	?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 43 NONAME ; void MsgUnifiedEditorView::hideChrome(bool)
+	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *)
+	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *)
+	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 46 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int)
+	?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void)
+	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int)
+	?send@MsgUnifiedEditorView@@AAEXXZ @ 49 NONAME ; void MsgUnifiedEditorView::send(void)
+	?Reset@CUniImageProcessor@@QAEXXZ @ 50 NONAME ; void CUniImageProcessor::Reset(void)
+	?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 51 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList<class QVariant> const &)
+	?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 52 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &)
+	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 53 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int)
+	?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 54 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *)
+	??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 55 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *)
+	?onAudioSelected@MsgUnifiedEditorView@@AAEXAAVQString@@@Z @ 56 NONAME ; void MsgUnifiedEditorView::onAudioSelected(class QString &)
+	?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 57 NONAME ; void MsgUnifiedEditorView::fetchContacts(void)
+	?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 58 NONAME ; void MsgUnifiedEditorView::deleteMessage(void)
+	?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 59 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList)
+	?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 60 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void)
 
--- a/messagingapp/msgui/conversationview/conversationview.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/conversationview.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -58,6 +58,7 @@
     inc/msgcontactcardwidget.h \
     inc/msgeditorwidget.h \
     inc/msgconversationbaseview.h \
+    inc/msgbodytextedit.h \
     ../inc/msgbaseview.h
     
 
@@ -67,7 +68,8 @@
     src/msgviewutils.cpp \
     src/msgcontactcardwidget.cpp \
     src/msgeditorwidget.cpp \
-    src/msgconversationbaseview.cpp
+    src/msgconversationbaseview.cpp \
+    src/msgbodytextedit.cpp
     
 RESOURCES += conversationview.qrc
 
--- a/messagingapp/msgui/conversationview/conversationview.qrc	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/conversationview.qrc	Tue Oct 19 11:30:16 2010 +0530
@@ -13,5 +13,6 @@
         <file alias="msgeditorwidget.css">resources/layouts/msgeditorwidget.css</file>
         <file alias="msgeditorwidget.widgetml">resources/layouts/msgeditorwidget.widgetml</file>
         <file alias="msgcontactcardwidget_color.css">resources/layouts/msgcontactcardwidget_color.css</file>
+        <file alias="msgbodytextedit.css">resources/layouts/msgbodytextedit.css</file>
     </qresource>
 </RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/conversationview/inc/msgbodytextedit.h	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Widget for BodyText.
+ *
+ */
+
+#ifndef MSG_BODY_TEXT_EDIT_H
+#define MSG_BODY_TEXT_EDIT_H
+
+// SYSTEM INCLUDES
+#include <HbTextEdit>
+
+// FORWORD DECLARATIONS
+class MsgConversationViewItem;
+
+
+/**
+ * @class MsgBodyTextEdit
+ * @brief This class is a widget for Text Item in the conversation View.
+ */
+class MsgBodyTextEdit: public HbTextEdit
+{
+Q_OBJECT
+
+public:
+
+    /**
+     * Constructor
+     */
+    MsgBodyTextEdit(MsgConversationViewItem* item, QGraphicsItem *parent =0);
+
+    /**
+     * Destructor
+     */
+    virtual ~MsgBodyTextEdit();
+
+protected:
+   
+    /*
+     * Handle Gestures
+	 * @param event gesture event
+     */
+    void gestureEvent(QGestureEvent* event);
+    
+    
+private:
+    
+    /*
+     * Conversation View Item
+     * Not Own
+     */
+    MsgConversationViewItem* mItem;
+	
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgBodyTextEdit;
+#endif
+
+};
+
+#endif // MSG_BODY_TEXT_EDIT_H
+// EOF
--- a/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h	Tue Oct 19 11:30:16 2010 +0530
@@ -163,11 +163,6 @@
     void call();
 
     /**
-     * Adds unknown number to phonebook
-     */
-    void addToContacts();
-
-    /**
      * Called after service request is completed.
      */
     void onServiceRequestCompleted();
--- a/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h	Tue Oct 19 11:30:16 2010 +0530
@@ -78,6 +78,12 @@
      * @return bool
      */
     bool isIncoming();
+    
+    /**
+     * Handle Gesture Event
+     * @param event, Event
+     */
+    void gestureEvent(QGestureEvent *event);
 
 private:
 
--- a/messagingapp/msgui/conversationview/inc/msgconversationwidget.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/inc/msgconversationwidget.h	Tue Oct 19 11:30:16 2010 +0530
@@ -26,6 +26,8 @@
 class HbFrameItem;
 class HbIconItem;
 class HbTextItem;
+class MsgBodyTextEdit;
+class MsgConversationViewItem;
 
 /**
  * This class represents the custom layouted widget to show
@@ -290,7 +292,7 @@
     /**
      * Initialize the widget.
      */
-    void init();
+    void init(MsgConversationViewItem* item);
 
 public:
 
@@ -403,7 +405,7 @@
      * Graphics Item to hold body text content.
      * Owned
      */
-    HbTextItem *mBodyTextItem;
+    MsgBodyTextEdit *mBodyTextItem;
 
     /**
      * Graphics Item to hold Time stamp.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/conversationview/resources/layouts/msgbodytextedit.css	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,8 @@
+
+MsgBodyTextEdit::text
+{
+  left: var(hb-param-margin-gene-middle-horizontal);
+  right: -var(hb-param-margin-gene-middle-horizontal);
+  top: var(hb-param-margin-gene-middle-vertical);
+  bottom: -var(hb-param-margin-gene-middle-vertical);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/conversationview/src/msgbodytextedit.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "msgbodytextedit.h"
+#include "msgconversationviewitem.h"
+
+// SYSTEM INCLUDES
+
+//---------------------------------------------------------------
+// MsgBodyTextEdit::MsgBodyTextEdit
+// @see header
+//---------------------------------------------------------------
+MsgBodyTextEdit::MsgBodyTextEdit(MsgConversationViewItem* item, QGraphicsItem *parent): 
+HbTextEdit(parent), mItem(item)
+{
+    //set textedit properties
+    setCursorVisibility(Hb::TextCursorHidden);
+    setFlag(QGraphicsItem::ItemIsFocusable,false);
+    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+    setBackgroundItem(0);
+    setSmileysEnabled(true);
+    setReadOnly(true);
+    setScrollable(false);
+
+    // grab gestures
+    grabGesture(Qt::TapGesture);
+}
+
+//---------------------------------------------------------------
+// MsgBodyTextEdit::~MsgBodyTextEdit
+// @see header
+//---------------------------------------------------------------
+MsgBodyTextEdit::~MsgBodyTextEdit()
+{
+    
+}
+
+//---------------------------------------------------------------
+// MsgBodyTextEdit::gestureEvent
+// @see header file
+//---------------------------------------------------------------
+void MsgBodyTextEdit::gestureEvent(QGestureEvent *event)
+{
+    mItem->gestureEvent(event);    
+}
+
+// EOF
--- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -27,6 +27,7 @@
 #include <qcontactphonenumber.h>
 #include <qcontactavatar.h>
 #include <xqaiwrequest.h>
+#include <xqaiwdecl.h>
 #include <xqappmgr.h>
 #include <xqservicerequest.h>
 #include <cntservicescontact.h>
@@ -57,7 +58,6 @@
 #define LOC_RECEIVED_FILES hbTrId("txt_messaging_title_received_files")
 #define LOC_MENU_CONTACT_INFO hbTrId("txt_messaging_menu_contact_info")
 #define LOC_COMMON_MENU_CALL hbTrId("txt_common_menu_call_verb")
-#define LOC_SAVETO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts")
 
 // LOCAL FUNCTIONS
 
@@ -87,7 +87,6 @@
 void MsgContactCardWidget::init()
 {
     this->setProperty("state", "normal");
-    this->grabGesture(Qt::TapGesture);
 
     HbFrameItem *frameItem = new HbFrameItem(BG_FRAME_NORMAL, HbFrameDrawer::NinePieces, this);
     this->setBackgroundItem(frameItem);
@@ -230,13 +229,12 @@
     if (KBluetoothMsgsConversationId == convId) {
         setAddress(LOC_RECEIVED_FILES);
         setAvatar(HbIcon(BT_ICON));
+        this->ungrabGesture(Qt::TapGesture);
     }
     else {
         //Set the Contact Name/Number
-        qint64 convId;
         QString displayName;
         QString contactAddress;
-        convId = ConversationsEngine::instance()->getCurrentConversationId();
         ConversationsEngine::instance()->getContactDetails(convId, displayName, contactAddress);
 
         mContactNumber = contactAddress;
@@ -263,6 +261,8 @@
 
         // Set default avatar till actual is set.
         setAvatar(HbIcon(DEFAULT_AVATAR_ICON));
+
+        this->grabGesture(Qt::TapGesture);
     }
 }
 
@@ -357,24 +357,15 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::handleLongTap(const QPointF &position)
 {
-    if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) {
-        HbMenu* contextMenu = new HbMenu();
-        contextMenu->setDismissPolicy(HbPopup::TapAnywhere);
-        contextMenu->setAttribute(Qt::WA_DeleteOnClose, true);
-        contextMenu->setPreferredPos(position);   
+    HbMenu* contextMenu = new HbMenu();
+    contextMenu->setDismissPolicy(HbPopup::TapAnywhere);
+    contextMenu->setAttribute(Qt::WA_DeleteOnClose, true);
+    contextMenu->setPreferredPos(position);
 
-        //If contact doesn't exist in phonebook then add another menu item "Save to Contacts"
-        int contactId = resolveContactId(mContactNumber);
-        if (contactId < 0) {
-            contextMenu->addAction(LOC_SAVETO_CONTACTS, this, SLOT(addToContacts()));
-        }
-        else{
-            contextMenu->addAction(LOC_MENU_CONTACT_INFO, this, SLOT(openContactInfo()));
-        }
-        contextMenu->addAction(LOC_COMMON_MENU_CALL, this, SLOT(call()));
+    contextMenu->addAction(LOC_MENU_CONTACT_INFO, this, SLOT(openContactInfo()));
+    contextMenu->addAction(LOC_COMMON_MENU_CALL, this, SLOT(call()));
 
-        contextMenu->show();
-    }
+    contextMenu->show();
 }
 
 //---------------------------------------------------------------
@@ -383,19 +374,11 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::handleShortTap(const QPointF &position)
 {
+    Q_UNUSED(position)
+
     this->ungrabGesture(Qt::TapGesture);
     
-    int contactId = resolveContactId(mContactNumber);
-    if(contactId > 0)
-    {
-        //resolved contact open contact card.
-        openContactInfo();
-    }
-    else
-    {
-        //unresolved contact show longpress options menu.
-        handleLongTap(position);
-    }
+    openContactInfo();
     
     //fire timer to regrab gesture after some delay.
     QTimer::singleShot(300,this,SLOT(regrabGesture()));    
@@ -407,46 +390,39 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::openContactInfo()
 {
-    //service stuff.
-    QString service("phonebookservices");
-    QString interface;
-    QString operation;
     QList<QVariant> args;
-    if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) {
-        int contactId = resolveContactId(mContactNumber);
-        if (contactId > 0) {
-            //open existing contact card
-            interface = QString("com.nokia.symbian.IContactsView");
-            operation = QString("openContactCard(int)");
-            args << contactId;
-        }
-        else {
-            //populate data and open unknown contact template
-            interface = QString("com.nokia.symbian.IContactsEdit");
-            operation = QString("editCreateNew(QString,QString)");
-            QString type = QContactPhoneNumber::DefinitionName;
-            args << type;
-            args << mAddress;
-        }
-        XQAiwRequest* request;
-        XQApplicationManager appManager;
-        request = appManager.create(service, interface, operation, true); // embedded
-        if (request == NULL) {
-            return;
-        }
+    XQAiwRequest* request = NULL;
+    XQApplicationManager appManager;
 
-        // Result handlers
-        connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
-        connect(request, SIGNAL(requestError(const QVariant&)), this,
-            SLOT(handleError(const QVariant&)));
+    int contactId = resolveContactId(mContactNumber);
+    if (contactId > 0) {
+        // open existing contact card
+        request = appManager.create(XQI_CONTACTS_VIEW, XQOP_CONTACTS_VIEW_CONTACT_CARD, true); // Embedded
+        args << contactId;
+    }
+    else {
+        // open temp contact card
+        request = appManager.create(XQI_CONTACTS_VIEW,
+            XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL, true); // Embedded
+        args << QContactPhoneNumber::DefinitionName; // Type
+        args << mAddress; // Actual data
+    }
 
-        //disbale subscritption for the CV events
-        ConversationsEngine::instance()->disableRegisterationForCVEvents();
+    if (request == NULL) {
+        return;
+    }
 
-        request->setArguments(args);
-        request->send();
-        delete request;
-    }
+    // Result handlers
+    connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+    connect(request, SIGNAL(requestError(const QVariant&)), this,
+        SLOT(handleError(const QVariant&)));
+
+    //disbale subscritption for the CV events
+    ConversationsEngine::instance()->disableRegisterationForCVEvents();
+
+    request->setArguments(args);
+    request->send();
+    delete request;
 }
 
 //---------------------------------------------------------------
@@ -483,15 +459,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgContactCardWidget::addToContacts
-// @see header
-//---------------------------------------------------------------
-void MsgContactCardWidget::addToContacts()
-{
-    openContactInfo();
-}
-
-//---------------------------------------------------------------
 // MsgContactCardWidget::handleOk
 // @see header
 //---------------------------------------------------------------
--- a/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -28,6 +28,7 @@
 #include <HbExtendedLocale>
 #include <ccsdefs.h>
 #include <HbInstance>
+#include <HbEffect.h>
 
 // USER INCLUDES
 #include "msgconversationwidget.h"
@@ -153,6 +154,7 @@
         mConversation->setIncoming(true);
 
         mIncomingMsgStateIconItem->setVisible(false);
+        HbEffect::add(this,"chatincoming_appear", "appear");	
     }
     else if (direction == ConvergedMessage::Outgoing)
         {
@@ -162,7 +164,8 @@
         int sendingState = index.data(SendingState).toInt();
         mConversation->setSendingState(sendingState);
         setMessageStateIcon(sendingState);
-        }
+        HbEffect::add(this,"chatoutgoing_appear", "appear");	
+    }
 
     bool unreadStatus = index.data(UnReadStatus).toBool();
     mConversation->setUnread(unreadStatus);
@@ -220,8 +223,9 @@
         else
             {
             mIncomingMsgStateIconItem->setVisible(false);
-            }
         }
+        HbEffect::add(this,"chatincoming_appear", "appear");	
+    }
     else if (direction == ConvergedMessage::Outgoing)
         {
         setIncoming(false);
@@ -230,7 +234,8 @@
         int sendingState = index.data(SendingState).toInt();
         mConversation->setSendingState(sendingState);
         setMessageStateIcon(sendingState);
-        }
+        HbEffect::add(this,"chatoutgoing_appear", "appear");	
+    }
 
     bool unreadStatus = index.data(UnReadStatus).toBool();
     mConversation->setUnread(unreadStatus);
@@ -555,7 +560,8 @@
 
     QString msgTimeStamp;
     if (ConvergedMessage::Resend == index.data(SendingState).toInt()) {
-        msgTimeStamp = LOC_RESEND_AT.arg(timeStampStr);
+        msgTimeStamp = LOC_RESEND_AT;
+	msgTimeStamp.append(" "+timeStampStr);
     }
     else {
         msgTimeStamp = timeStampStr;
@@ -563,4 +569,13 @@
     return msgTimeStamp;
 }
 
+//---------------------------------------------------------------
+// MsgConversationViewItem::gestureEvent
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationViewItem::gestureEvent(QGestureEvent *event)
+{
+    HbListViewItem::gestureEvent(event);
+}
+
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -15,7 +15,8 @@
  *
  */
 #include "msgconversationwidget.h"
-
+#include "msgconversationviewitem.h"
+#include "msgbodytextedit.h"
 #include <HbTextItem>
 #include <HbFrameItem>
 #include <HbFrameDrawer>
@@ -89,7 +90,8 @@
 
 
 {
-    init();
+    MsgConversationViewItem* item = static_cast<MsgConversationViewItem*>(parent);
+    init(item);
 }
 
 //---------------------------------------------------------------
@@ -105,7 +107,7 @@
 // MsgConversationWidget::init
 // @see header file
 //---------------------------------------------------------------
-void MsgConversationWidget::init()
+void MsgConversationWidget::init(MsgConversationViewItem* item)
 {
     // Common to SMS/MMS
 
@@ -121,8 +123,9 @@
     mSubjectTextItem->setTextWrapping(Hb::TextNoWrap);  
     HbStyle::setItemName(mSubjectTextItem, "subject");
     
-    mBodyTextItem = new HbTextItem(this);
-    mBodyTextItem->setTextWrapping(Hb::TextWordWrap);
+    //passing MsgConversationViewItem object for handling gestures
+    mBodyTextItem = new MsgBodyTextEdit(item, this);
+    
     HbStyle::setItemName(mBodyTextItem, "bodyText");
     
     mPreviewIconItem = new HbIconItem(this);
@@ -176,7 +179,7 @@
     }
     HbStyle::setItemName(mBodyTextItem, "bodyText");
 
-    mBodyTextItem->setText(body);
+    mBodyTextItem->setPlainText(body);
     mBodyTextItem->show();
 }
 
@@ -622,8 +625,8 @@
         mSendingState =Unknown;
         mNotificationState =0;
         
-		if(mBodyTextItem){
-			  mBodyTextItem->setText(QString());
+        if(mBodyTextItem){
+             mBodyTextItem->setPlainText(QString());
         mBodyTextItem->hide();
         HbStyle::setItemName(mBodyTextItem, "");
 	    }
--- a/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -373,8 +373,9 @@
 MsgEditor::MsgEditor(QGraphicsItem *parent)
 :HbLineEdit(parent)
     {
-     this->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
-     this->setPlaceholderText(LOC_HINT_TEXT);
+     setFontSpec(HbFontSpec(HbFontSpec::Secondary));
+     setPlaceholderText(LOC_HINT_TEXT);
+     setSmileysEnabled(true);
     }
 
 //---------------------------------------------------------------
--- a/messagingapp/msgui/eabi/unifiededitoru.def	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/eabi/unifiededitoru.def	Tue Oct 19 11:30:16 2010 +0530
@@ -6,69 +6,62 @@
 	_ZN18CUniImageProcessor5ResetEv @ 5 NONAME
 	_ZN18CUniImageProcessorC1EP26MUniImageProcessorCallback @ 6 NONAME
 	_ZN18CUniImageProcessorC2EP26MUniImageProcessorCallback @ 7 NONAME
-	_ZN20MsgUnifiedEditorView10addSubjectEv @ 8 NONAME
-	_ZN20MsgUnifiedEditorView10addToolBarEv @ 9 NONAME
-	_ZN20MsgUnifiedEditorView10fetchAudioEv @ 10 NONAME
-	_ZN20MsgUnifiedEditorView10hideChromeEb @ 11 NONAME
-	_ZN20MsgUnifiedEditorView11fetchImagesEv @ 12 NONAME
-	_ZN20MsgUnifiedEditorView11packMessageER16ConvergedMessageb @ 13 NONAME
-	_ZN20MsgUnifiedEditorView11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME
-	_ZN20MsgUnifiedEditorView11qt_metacastEPKc @ 15 NONAME
-	_ZN20MsgUnifiedEditorView11resizeEventEP25QGraphicsSceneResizeEvent @ 16 NONAME
-	_ZN20MsgUnifiedEditorView12createVCardsERK8QVariantR11QStringList @ 17 NONAME
-	_ZN20MsgUnifiedEditorView13addAttachmentERK7QString @ 18 NONAME
-	_ZN20MsgUnifiedEditorView13deleteMessageEv @ 19 NONAME
-	_ZN20MsgUnifiedEditorView13fetchContactsEv @ 20 NONAME
-	_ZN20MsgUnifiedEditorView13imagesFetchedERK8QVariant @ 21 NONAME
-	_ZN20MsgUnifiedEditorView14addAttachmentsE11QStringList @ 22 NONAME
-	_ZN20MsgUnifiedEditorView14changePriorityEv @ 23 NONAME
-	_ZN20MsgUnifiedEditorView14handleKeyEventEi @ 24 NONAME
-	_ZN20MsgUnifiedEditorView14vkbAboutToOpenEv @ 25 NONAME
-	_ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 26 NONAME
-	_ZN20MsgUnifiedEditorView15formatAddressesER5QListIP23ConvergedMessageAddressE @ 27 NONAME
-	_ZN20MsgUnifiedEditorView15onAudioSelectedER7QString @ 28 NONAME
-	_ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 29 NONAME
-	_ZN20MsgUnifiedEditorView15vkbAboutToCloseEv @ 30 NONAME
-	_ZN20MsgUnifiedEditorView16createTempFolderEv @ 31 NONAME
-	_ZN20MsgUnifiedEditorView16enableSendButtonEb @ 32 NONAME
-	_ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 33 NONAME
-	_ZN20MsgUnifiedEditorView16onContentChangedEv @ 34 NONAME
-	_ZN20MsgUnifiedEditorView16removeTempFolderEv @ 35 NONAME
-	_ZN20MsgUnifiedEditorView16staticMetaObjectE @ 36 NONAME DATA 16
-	_ZN20MsgUnifiedEditorView17isReplyPathBrokenEv @ 37 NONAME
-	_ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 38 NONAME
-	_ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 39 NONAME
-	_ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 40 NONAME
-	_ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 41 NONAME
-	_ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 42 NONAME
-	_ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 43 NONAME
-	_ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 44 NONAME
-	_ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 45 NONAME
-	_ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 46 NONAME
-	_ZN20MsgUnifiedEditorView21fetchMessageFromStoreER18ConvergedMessageIdN16ConvergedMessage11MessageTypeEi @ 47 NONAME
-	_ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 48 NONAME
-	_ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 49 NONAME
-	_ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 50 NONAME
-	_ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessageb @ 51 NONAME
-	_ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 52 NONAME
-	_ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 53 NONAME
-	_ZN20MsgUnifiedEditorView4sendEv @ 54 NONAME
-	_ZN20MsgUnifiedEditorView7addMenuEv @ 55 NONAME
-	_ZN20MsgUnifiedEditorView8addCcBccEv @ 56 NONAME
-	_ZN20MsgUnifiedEditorView8initViewEv @ 57 NONAME
-	_ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 58 NONAME
-	_ZN20MsgUnifiedEditorView9vkbClosedEv @ 59 NONAME
-	_ZN20MsgUnifiedEditorView9vkbOpenedEv @ 60 NONAME
-	_ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 61 NONAME
-	_ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 62 NONAME
-	_ZN20MsgUnifiedEditorViewD0Ev @ 63 NONAME
-	_ZN20MsgUnifiedEditorViewD1Ev @ 64 NONAME
-	_ZN20MsgUnifiedEditorViewD2Ev @ 65 NONAME
-	_ZNK20MsgUnifiedEditorView10metaObjectEv @ 66 NONAME
-	_ZTI20MsgUnifiedEditorView @ 67 NONAME
-	_ZTV20MsgUnifiedEditorView @ 68 NONAME
-	_ZThn16_N20MsgUnifiedEditorViewD0Ev @ 69 NONAME
-	_ZThn16_N20MsgUnifiedEditorViewD1Ev @ 70 NONAME
-	_ZThn8_N20MsgUnifiedEditorViewD0Ev @ 71 NONAME
-	_ZThn8_N20MsgUnifiedEditorViewD1Ev @ 72 NONAME
+	_ZN20MsgUnifiedEditorView10addSubjectEb @ 8 NONAME
+	_ZN20MsgUnifiedEditorView10fetchAudioEv @ 9 NONAME
+	_ZN20MsgUnifiedEditorView10hideChromeEb @ 10 NONAME
+	_ZN20MsgUnifiedEditorView11fetchImagesEv @ 11 NONAME
+	_ZN20MsgUnifiedEditorView11packMessageER16ConvergedMessageb @ 12 NONAME
+	_ZN20MsgUnifiedEditorView11qt_metacallEN11QMetaObject4CallEiPPv @ 13 NONAME
+	_ZN20MsgUnifiedEditorView11qt_metacastEPKc @ 14 NONAME
+	_ZN20MsgUnifiedEditorView11resetLayoutEv @ 15 NONAME
+	_ZN20MsgUnifiedEditorView12createVCardsERK8QVariantR11QStringList @ 16 NONAME
+	_ZN20MsgUnifiedEditorView12focusChangedEv @ 17 NONAME
+	_ZN20MsgUnifiedEditorView13deleteMessageEv @ 18 NONAME
+	_ZN20MsgUnifiedEditorView13fetchContactsEv @ 19 NONAME
+	_ZN20MsgUnifiedEditorView13imagesFetchedERK8QVariant @ 20 NONAME
+	_ZN20MsgUnifiedEditorView14addAttachmentsE11QStringList @ 21 NONAME
+	_ZN20MsgUnifiedEditorView14handleKeyEventEi @ 22 NONAME
+	_ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 23 NONAME
+	_ZN20MsgUnifiedEditorView15onAudioSelectedER7QString @ 24 NONAME
+	_ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 25 NONAME
+	_ZN20MsgUnifiedEditorView16createTempFolderEv @ 26 NONAME
+	_ZN20MsgUnifiedEditorView16enableMenuActionEib @ 27 NONAME
+	_ZN20MsgUnifiedEditorView16ensureVisibilityEv @ 28 NONAME
+	_ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 29 NONAME
+	_ZN20MsgUnifiedEditorView16onContentChangedEv @ 30 NONAME
+	_ZN20MsgUnifiedEditorView16removeTempFolderEv @ 31 NONAME
+	_ZN20MsgUnifiedEditorView16staticMetaObjectE @ 32 NONAME DATA 16
+	_ZN20MsgUnifiedEditorView17isReplyPathBrokenEv @ 33 NONAME
+	_ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 34 NONAME
+	_ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 35 NONAME
+	_ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 36 NONAME
+	_ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 37 NONAME
+	_ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 38 NONAME
+	_ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 39 NONAME
+	_ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 40 NONAME
+	_ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 41 NONAME
+	_ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 42 NONAME
+	_ZN20MsgUnifiedEditorView21fetchMessageFromStoreER18ConvergedMessageIdN16ConvergedMessage11MessageTypeEi @ 43 NONAME
+	_ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 44 NONAME
+	_ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessagebb @ 45 NONAME
+	_ZN20MsgUnifiedEditorView4sendEv @ 46 NONAME
+	_ZN20MsgUnifiedEditorView7addMenuEv @ 47 NONAME
+	_ZN20MsgUnifiedEditorView8addCcBccEb @ 48 NONAME
+	_ZN20MsgUnifiedEditorView8doLayoutEv @ 49 NONAME
+	_ZN20MsgUnifiedEditorView8initViewEv @ 50 NONAME
+	_ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 51 NONAME
+	_ZN20MsgUnifiedEditorView9vkbClosedEv @ 52 NONAME
+	_ZN20MsgUnifiedEditorView9vkbOpenedEv @ 53 NONAME
+	_ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 54 NONAME
+	_ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 55 NONAME
+	_ZN20MsgUnifiedEditorViewD0Ev @ 56 NONAME
+	_ZN20MsgUnifiedEditorViewD1Ev @ 57 NONAME
+	_ZN20MsgUnifiedEditorViewD2Ev @ 58 NONAME
+	_ZNK20MsgUnifiedEditorView10metaObjectEv @ 59 NONAME
+	_ZTI20MsgUnifiedEditorView @ 60 NONAME
+	_ZTV20MsgUnifiedEditorView @ 61 NONAME
+	_ZThn16_N20MsgUnifiedEditorViewD0Ev @ 62 NONAME
+	_ZThn16_N20MsgUnifiedEditorViewD1Ev @ 63 NONAME
+	_ZThn8_N20MsgUnifiedEditorViewD0Ev @ 64 NONAME
+	_ZThn8_N20MsgUnifiedEditorViewD1Ev @ 65 NONAME
 
--- a/messagingapp/msgui/msgapp/inc/msgactivityhandler.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/inc/msgactivityhandler.h	Tue Oct 19 11:30:16 2010 +0530
@@ -21,10 +21,16 @@
 
 #include <QObject>
 #include <QVariant>
+#include <afactivities_global.h>
 
 class MsgMainWindow;
 class MsgViewManager;
 class AfActivityStorage;
+class AfActivation;
+
+// Activity Names 
+const QString ListViewActivityName("MsgConversationsList");
+const QString EditorActivityName("MsgCreate");
 
 class MsgActivityHandler: public QObject
 {
@@ -47,7 +53,16 @@
       * Saves the current running activity.
       */
     void saveActivity();
-    
+
+signals:
+
+    /**
+     * Reemit activated signal from AfActivation
+     */
+    void activated(Af::ActivationReason reason, 
+        QString name, 
+        QVariantHash parameters);
+
 public:   
    /** 
     * Set the message main window pointer.
@@ -73,6 +88,11 @@
      */
     AfActivityStorage*  activitiyStorage();
     
+    /**
+     * This return the Af activition instance 
+     */
+    AfActivation*  activation();
+    
 private:
     /**
      * main window reference not owned.
@@ -84,6 +104,12 @@
      * Own.
      */
     AfActivityStorage *mActivityStorage;
+
+    /**
+     * App Framework activation
+     * Own.
+     */
+    AfActivation *mActivation;
 };
 
 #endif /* MSGACTIVITYHANDLER_H_ */
--- a/messagingapp/msgui/msgapp/inc/msgapplication.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/inc/msgapplication.h	Tue Oct 19 11:30:16 2010 +0530
@@ -43,11 +43,21 @@
 	 */
 	void initViewReady();
 	
+	/**
+	 * symbianEventFilter
+	 * handles S60 events
+	 */
+    bool symbianEventFilter(const QSymbianEvent *event);
+    
 private slots:
 	void handleAppReady();
 
 signals:
 	void applicationReady();
+
+signals:
+    // emitted when close event is handled
+    void closeEvent();
 };
     
 #endif // MSGAPPLICATION_H_
--- a/messagingapp/msgui/msgapp/inc/msglistview.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/inc/msglistview.h	Tue Oct 19 11:30:16 2010 +0530
@@ -102,11 +102,6 @@
     void doDelayedConstruction();
     
     /**
-     * Handles saving to contacts
-     */
-    void saveToContacts();
-    
-    /**
      * Opens contact card for resolved contact.
      */
     void contactInfo();
@@ -167,6 +162,9 @@
      * Own
      */    
     QGraphicsLinearLayout *mMainLayout;
+    #ifdef MSGUI_MSGAPP_UNIT_TEST
+        friend class TestMsgListView;
+    #endif
 };
 
 #endif // MSG_LIST_VIEW_H
--- a/messagingapp/msgui/msgapp/inc/msglistviewitem.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/inc/msglistviewitem.h	Tue Oct 19 11:30:16 2010 +0530
@@ -145,7 +145,7 @@
     /**
      * Unit Testing
      */
-    #ifdef MSGUI_UNIT_TEST
+    #ifdef MSGUI_MSGAPP_UNIT_TEST
 	  friend class TestMsgListViewItem;
 	  
 	#endif
--- a/messagingapp/msgui/msgapp/inc/msgmainwindow.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/inc/msgmainwindow.h	Tue Oct 19 11:30:16 2010 +0530
@@ -27,6 +27,7 @@
 class MsgViewManager;
 class MsgServiceInterface;
 class MsgSendServiceInterface;
+class MsgActivityHandler;
 
 /**
  * Main window of the messaging application. Activates the
@@ -40,7 +41,8 @@
     /**
      * Constructor
      */
-    MsgMainWindow(bool serviceRequest,
+    MsgMainWindow(bool serviceRequest, 
+                  MsgActivityHandler *handler,
                    QWidget *parent = 0);
 
     /**
@@ -53,6 +55,7 @@
      */
     MsgViewManager* viewManager();
     
+
 protected:
 
     /**
@@ -60,7 +63,12 @@
      * @see QGraphicsItem
      */
     void keyPressEvent(QKeyEvent *event);
-    
+
+    /**
+     * Event filter on application
+     */
+    bool eventFilter(QObject *obj, QEvent *event);
+	    
 private:
     /**
      * This initializes the member objects
@@ -71,11 +79,15 @@
     MsgServiceInterface* mMsgSI;
     MsgSendServiceInterface* mMsgSendSI;
     MsgViewManager* mViewManager;
+	/**
+	 * Not owned
+	 */
+    MsgActivityHandler* mActivityHandler;
     
     /**
      * Unit Testing
      */
-    #ifdef MSGUI_UNIT_TEST
+    #ifdef MSGUI_MSGAPP_UNIT_TEST
       friend class TestMsgMainWindow;
     #endif
     
--- a/messagingapp/msgui/msgapp/inc/msgviewmanager.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/inc/msgviewmanager.h	Tue Oct 19 11:30:16 2010 +0530
@@ -22,6 +22,7 @@
 #include <QObject>
 #include <QVariantList>
 #include <QVariant>
+#include <afactivities_global.h>
 
 class HbMainWindow;
 class MsgUnifiedEditorView;
@@ -33,6 +34,8 @@
 class MsgSettingsView;
 class HbAction;
 class HbView;
+class MsgActivityHandler;
+class TsTaskSettings;
 
 class MsgViewManager: public QObject
 {
@@ -103,6 +106,12 @@
      */
     bool handleKeyEvent(int key);
 
+    /**
+     * Sets the activity handler
+     * @param activityHandler
+     */
+    void setActivityHandler(MsgActivityHandler* activityHandler);        
+
 private:
     /**
      * swiches back to last view after service request is complete.
@@ -177,12 +186,6 @@
 	* Appends the views to be deleted into a QList to be deleted when view is ready
 	*/
     void appendViewToBeDeleted(HbView* view);
-
-	 /**
-	  * Save the editor data to be populated
-	  * @param editorData QVariantList
-	  */    
-    void populateUniEditorAfterViewReady(const QVariantList& editorData);
     
     /**
 	 * opens unieditor as activity.
@@ -230,9 +233,23 @@
     void onDialogSaveTone(HbAction* action);
     
     /**
-     * When this slot is called the saved editor data is set to the editor
+     * Send the app to background
+     */
+    void handleSendToBackGround();
+   
+public slots:
+
+    /**
+     * Set the view for the app
      */
-    void populateUniEditorView();
+    void handleApplicationActive();
+
+    /**
+     * Handler for activated signal
+     */
+    void handleActivated(Af::ActivationReason reason, 
+            QString name, 
+            QVariantHash parameters);    
 	
 private:
     /**
@@ -251,7 +268,11 @@
     MsgSettingsView* mSettingsView;
     
     HbAction* mBackAction;
-
+	/**
+	 * Not owned
+	 */
+    MsgActivityHandler* mActivityHandler;
+    TsTaskSettings* mClient;
     int mPreviousView;
     int mCurrentView;
     int mViewAtServiceRequest;
@@ -262,8 +283,12 @@
     HbView* mDummyview;
     int mMessageId;
     
-    QVariantList mEditorData;
     QVariantList mViewerData;
+    /*
+     * Keeps track of the app background status
+     * if set then it means app is in background
+     */
+    bool mBringtoForground;
 };
 
 #endif /* MSGVIEWMANAGER_H_ */
--- a/messagingapp/msgui/msgapp/msgapp.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/msgapp.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -104,8 +104,13 @@
         -lsettingsview \
         -lringbc \
         -lafservice \
-        -lunidatamodelloader 
-
+        -lunidatamodelloader \
+        -ltstaskmonitorclient \
+        -lapgrfx \
+        -leikcore \
+        -lcone \
+        -lQtServiceFramework
+        
 
 
 symbian:MMP_RULES += SMPSAFE
--- a/messagingapp/msgui/msgapp/src/draftslistview.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/draftslistview.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -45,7 +45,7 @@
 // LOCAL CONSTANTS
 const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal");
 const QString NEW_MESSAGE_ICON("qtg_mono_create_message");
-const QString SORT_ICON("qtg_mono_sort");
+const QString SORT_ICON("qtg_mono_show_view");
 
 // LOCALIZATION CONSTANTS
 
--- a/messagingapp/msgui/msgapp/src/main.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/main.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -23,8 +23,11 @@
 #include <QDateTime>
 #include <QPointer>
 #include <HbSplashScreen>
+#include <HbApplication>
 
 #include "msgmainwindow.h"
+#include "msgviewmanager.h"
+#include "msgactivityhandler.h"
 #include "msgapplication.h"
 
 //Localised constants
@@ -32,7 +35,6 @@
 
 const QString debugFileName("c:/art2_app_log.txt");
 const QString activityParam("-activity");
-const int INVALID_MSGID = -1;
 
 #ifdef _DEBUG_TRACES_
 void debugInit(QtMsgType type, const char *msg)
@@ -94,13 +96,16 @@
     {
         HbSplashScreen::setScreenId("clv");   
     }
-    
+        
     // Application
     //MsgApplication class dervied from HbApplication is create in order to 
     //emit applicationReady signal for Matti tool
-    MsgApplication app(argc, argv);
+    MsgApplication app(argc, argv);     
     
-
+	//TODO pass this flag to viewmanager to prevent saving of activity 
+	//if this is set
+    //bool preloaded = HbApplication::startedToBackground();
+    
     //TODO: Uncomment the lines when actual translation files are available in sdk and remove loading locally.
     QString locale = QLocale::system().name();
     QString path = "z:/resource/qt/translations/";
@@ -122,11 +127,22 @@
     }
     qInstallMsgHandler(debugInit);
 #endif
-    
+           
+    MsgActivityHandler* activityHandler = new MsgActivityHandler(&app);     
     // Main window
-    QPointer<MsgMainWindow> mainWindow = 
-            new MsgMainWindow(serviceRequest);
-    app.initViewReady();    
+    QPointer<MsgMainWindow> mainWindow = new MsgMainWindow(serviceRequest,
+        activityHandler);
+    app.initViewReady();
+    // Set the main window pointer to activity handler.
+    activityHandler->setMainWindow(mainWindow);
+
+    //Install event filter on app
+    app.installEventFilter(mainWindow);
+    
+    // connect to aboutToQuit signal to save activity
+    QObject::connect(&app, SIGNAL(closeEvent()), 
+            mainWindow->viewManager(), SLOT(handleSendToBackGround()));
+        
     mainWindow->show();
 
     // Event loop
--- a/messagingapp/msgui/msgapp/src/msgactivityhandler.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msgactivityhandler.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -18,17 +18,18 @@
 
 #include "msgactivityhandler.h"
 
+#include <QVariantHash>
+#include <afactivitystorage.h>
+#include <afactivation.h>
+#include <QServiceManager>
+
 #include "msgviewmanager.h"
 #include "msgbaseview.h"
 #include "msgmainwindow.h"
-#include <QVariantHash>
-#include <afactivitystorage.h>
+
+QTM_USE_NAMESPACE
 
 const int INVALID_MSGID = -1;
-// Activity Names 
-const QString ListViewActivityName("MsgConversationsList");
-const QString EditorActivityName("MsgCreate");
-
 //-----------------------------------------------------------------------------
 // MsgActivityHandler::MsgActivityHandler
 // Constructor
@@ -36,7 +37,15 @@
 MsgActivityHandler::MsgActivityHandler(QObject* parent):
     QObject(parent)
 {
-    mActivityStorage = new AfActivityStorage();
+    QServiceManager serviceManager;
+    mActivityStorage = static_cast<AfActivityStorage *>
+    (serviceManager.loadInterface("com.nokia.qt.activities.Storage"));
+    mActivation = static_cast<AfActivation *>
+    (serviceManager.loadInterface("com.nokia.qt.activities.Activation"));
+    
+    connect(mActivation, 
+         SIGNAL(activated(Af::ActivationReason, QString, QVariantHash)), 
+         this, SIGNAL(activated(Af::ActivationReason, QString, QVariantHash)));
 }
 
 //-----------------------------------------------------------------------------
@@ -49,6 +58,10 @@
        delete mActivityStorage;
        mActivityStorage = NULL;
    }
+   if(mActivation) {
+      delete mActivation;
+      mActivation = NULL;
+   }
 }
 
 //-----------------------------------------------------------------------------
@@ -137,3 +150,13 @@
 {
     return mActivityStorage;
 }
+
+//-----------------------------------------------------------------------------
+// MsgActivityHandler::activitiyStorage
+// @see header
+//-----------------------------------------------------------------------------
+AfActivation*  MsgActivityHandler::activation()
+{
+    return mActivation;
+}
+
--- a/messagingapp/msgui/msgapp/src/msgapplication.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msgapplication.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -18,6 +18,8 @@
 //include
 #include <hbmainwindow.h>
 #include <hbinstance.h>
+#include <EIKENV.H>
+#include <QSymbianEvent>
 
 //userinclude
 #include "msgapplication.h"
@@ -47,3 +49,21 @@
 	HbMainWindow *window = hbInstance->allMainWindows().first();
 	disconnect(window, SIGNAL(viewReady()),this,SLOT(handleAppReady()));
 	}
+
+/*
+ * Overloaded method
+ * handles S60 events
+ */
+bool MsgApplication::symbianEventFilter(const QSymbianEvent *event)
+{
+    QSymbianEvent::Type eventType = event->type();
+    
+    // handle close event
+    if (eventType == QSymbianEvent::CommandEvent && 
+            event->command() == EEikCmdExit) {
+        emit closeEvent();
+        return true;
+    }
+    return false;
+}
+
--- a/messagingapp/msgui/msgapp/src/msglistview.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msglistview.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -31,9 +31,10 @@
 #include <QSortFilterProxyModel>
 #include <QGraphicsLinearLayout>
 #include <hblistviewitem.h>
-#include <HbStyleLoader>
-#include <HbMainWindow>
+#include <hbstyleloader.h>
+#include <hbmainwindow.h>
 #include <xqaiwrequest.h>
+#include <xqaiwdecl.h>
 #include <xqappmgr.h>
 #include <qtcontacts.h>
 
@@ -50,7 +51,7 @@
 //Icons
 const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal");
 const QString NEW_MESSAGE_ICON("qtg_mono_create_message");
-const QString SORT_ICON("qtg_mono_sort");
+const QString SORT_ICON("qtg_mono_show_view");
 
 //Localized constants
 
@@ -59,7 +60,6 @@
 
 //itemspecific menu
 #define LOC_OPEN hbTrId("txt_common_menu_open")
-#define LOC_SAVETO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts")
 #define LOC_DELETE_CONVERSATION hbTrId("txt_messaging_menu_delete_conversation")
 #define LOC_OPEN_CONTACT_INFO hbTrId("txt_messaging_menu_contact_info")
 
@@ -129,20 +129,12 @@
         
         //save to contacts for unresolved.
         int msgType = viewItem->modelIndex().data(MessageType).toInt();
-        if(msgType == ConvergedMessage::Sms || 
-           msgType == ConvergedMessage::Mms || 
-           msgType == ConvergedMessage::BioMsg)
-            {
-            qint64 contactId = mMsgList->currentIndex().data(ContactId).toLongLong();
-            if(contactId < 0)
-                {
-                contextMenu->addAction(LOC_SAVETO_CONTACTS,this,SLOT(saveToContacts()));
-                }
-            else
-                {
-                contextMenu->addAction(LOC_OPEN_CONTACT_INFO,this,SLOT(contactInfo()));
-                }
-            }
+        if (msgType == ConvergedMessage::Sms ||
+            msgType == ConvergedMessage::Mms ||
+            msgType == ConvergedMessage::BioMsg)
+        {
+            contextMenu->addAction(LOC_OPEN_CONTACT_INFO, this, SLOT(contactInfo()));
+        }
         
         //delete conversation
         contextMenu->addAction(LOC_DELETE_CONVERSATION,this,SLOT(deleteItem()));
@@ -365,71 +357,39 @@
     }
 
 //---------------------------------------------------------------
-// MsgListView::saveToContacts
-// @see header
-//---------------------------------------------------------------
-void MsgListView::saveToContacts()
-    {
-    //save to contacts with phone number field prefilled.
-    QList<QVariant> args;  
-
-    QString data = mMsgList->currentIndex().data(DisplayName).toString();
-
-    QString type = QContactPhoneNumber::DefinitionName;
-
-    args << type;
-    args << data;
-
-    //service stuff.
-    QString service("phonebookservices");
-    QString interface("com.nokia.symbian.IContactsEdit");
-    QString operation("editCreateNew(QString,QString)");
-
-    XQAiwRequest* request;
-    XQApplicationManager appManager;
-    request = appManager.create(service, interface, operation, true); // embedded
-    if ( request == NULL )
-        {
-        return;       
-        }
-
-    request->setArguments(args);
-    request->send();
-    
-    delete request;
-    }
-
-//---------------------------------------------------------------
 // MsgListView::contactInfo
 // @see header
 //---------------------------------------------------------------
 void MsgListView::contactInfo()
-    {
-    //open contact info.
-    QList<QVariant> args;  
+{
+    QList<QVariant> args;
+    XQAiwRequest* request = NULL;
+    XQApplicationManager appManager;
 
     int contactId = mMsgList->currentIndex().data(ContactId).toInt();
 
-    args << contactId;
-
-    //service stuff.
-    QString service("phonebookservices");
-    QString interface("com.nokia.symbian.IContactsView");
-    QString operation("openContactCard(int)");
+    if (contactId < 0) {
+        // open temp contact card
+        request = appManager.create(XQI_CONTACTS_VIEW,
+            XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL, true); // Embedded
+        args << QContactPhoneNumber::DefinitionName; // Type
+        args << mMsgList->currentIndex().data(DisplayName).toString(); // Actual data
+    }
+    else {
+        // open existing contact card
+        request = appManager.create(XQI_CONTACTS_VIEW, XQOP_CONTACTS_VIEW_CONTACT_CARD, true); // Embedded
+        args << contactId;
+    }
 
-    XQAiwRequest* request;
-    XQApplicationManager appManager;
-    request = appManager.create(service, interface, operation, true); // embedded
-    if ( request == NULL )
-        {
-        return;       
-        }
+    if (request == NULL) {
+        return;
+    }
 
     request->setArguments(args);
     request->send();
-    
+
     delete request;
-    }
+}
 
 //---------------------------------------------------------------
 // MsgListView::onDialogDeleteMsg
--- a/messagingapp/msgui/msgapp/src/msglistviewitem.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msglistviewitem.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -244,7 +244,8 @@
         switch (sendState) {
         case ConvergedMessage::Resend:
         {
-            previewText = LOC_MSG_RESEND_AT.arg(dateTimeString);
+            previewText = LOC_MSG_RESEND_AT;
+	    previewText.append(" "+dateTimeString);	
             dateTimeString = QString();            
             setCommonIndicator(MSG_OUTGOING_ICON);
             break;
--- a/messagingapp/msgui/msgapp/src/msgmainwindow.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msgmainwindow.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -35,8 +35,10 @@
 // MsgMainWindow::MsgMainWindow
 // Constructor
 //---------------------------------------------------------------
-MsgMainWindow::MsgMainWindow(bool serviceRequest, QWidget *parent) :
-HbMainWindow(parent), mMsgSI(0), mMsgSendSI(0)
+MsgMainWindow::MsgMainWindow(bool serviceRequest,
+    MsgActivityHandler *handler,
+    QWidget *parent) :
+HbMainWindow(parent), mMsgSI(0), mMsgSendSI(0),mActivityHandler(handler)
 {
     initialize(serviceRequest);    
 }
@@ -49,10 +51,8 @@
 {
     int activityMsgId = INVALID_MSGID;
     
-    MsgActivityHandler* activityHandler = 
-            new MsgActivityHandler(this);
         
-    AfActivation *activation = new AfActivation( this );
+    AfActivation *activation = mActivityHandler->activation();
     
     Af::ActivationReason reason = activation->reason();      
     
@@ -63,12 +63,15 @@
         
         QString actName = activation->name();
                 
-        QVariant data = activityHandler->activitiyStorage()->activityData(actName);        
+        QVariant data = mActivityHandler->activitiyStorage()->
+                                                         activityData(actName);        
         
-        activityMsgId = activityHandler->parseActivityData(data);
+        activityMsgId = mActivityHandler->parseActivityData(data);
         }
     
     mViewManager = new MsgViewManager(serviceRequest,this,this,activityMsgId);
+    mViewManager->setActivityHandler(mActivityHandler);
+    
     mMsgSI = new MsgServiceInterface(NULL,mViewManager);
     mMsgSendSI = new MsgSendServiceInterface(NULL,mViewManager);
             
@@ -76,14 +79,14 @@
     ConversationsEngine::instance();
     
     // clear the old activities
-    activityHandler->clearActivities();
+    mActivityHandler->clearActivities();
     
     // Set the main window pointer to activity handler.
-    activityHandler->setMainWindow(this); 
+    mActivityHandler->setMainWindow(this); 
     
     // connect to aboutToQuit signal to save drafts content
     QObject::connect(qApp, SIGNAL(aboutToQuit()), 
-            activityHandler, SLOT(saveActivity()));
+        mActivityHandler, SLOT(saveActivity()));
 }
 
 //---------------------------------------------------------------
@@ -135,4 +138,16 @@
 
 }
 
+//---------------------------------------------------------------
+// MsgMainWindow::eventFilter
+// @see header
+//---------------------------------------------------------------
+bool MsgMainWindow::eventFilter(QObject *obj, QEvent *event)
+{
+    if (event->type() == QEvent::ApplicationActivate) {
+        mViewManager->handleApplicationActive();
+    }
+    return QObject::eventFilter(obj, event);
+}
+
 // End of file
--- a/messagingapp/msgui/msgapp/src/msgviewmanager.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgapp/src/msgviewmanager.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -27,6 +27,12 @@
 #include <xqappmgr.h>
 #include <hbmessagebox.h>
 #include <HbView>
+#include <tstasksettings.h>
+#include <hbinstance.h>
+#include <xqserviceutil.h>
+#include <apgtask.h>
+#include <eikenv.h>
+#include <afactivitystorage.h>
 
 #include "conversationsengine.h"
 #include "msglistview.h"
@@ -40,6 +46,7 @@
 #include "unidatamodelloader.h"
 #include "unidatamodelplugininterface.h"
 #include "msgcontacthandler.h"
+#include "msgactivityhandler.h"
 #include "debugtraces.h"
 
 // LOCALIZATION
@@ -47,11 +54,16 @@
 #define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone")
 
 const qint64 NULL_CONVERSATIONID = -1;
+const int INVALID_MSGID = -1;
 
-MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent,int activityMsgId) :
-    QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0),
-        mUniViewer(0), mDraftsListView(0), mSettingsView(0), mBackAction(0),
-        mServiceRequest(serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1)
+MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow,
+    QObject* parent, int activityMsgId) :
+    QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0),
+            mConversationView(0), mUniViewer(0), mDraftsListView(0),
+            mSettingsView(0), mBackAction(0), mActivityHandler(0), mClient(0),
+            mServiceRequest(serviceRequest), mConversationId(-1),
+            mViewServiceRequest(false), mMessageId(-1),
+            mBringtoForground(false)
 {
     //creating back action.
     mBackAction = new HbAction(Hb::BackNaviAction, this);
@@ -83,8 +95,6 @@
 
 MsgViewManager::~MsgViewManager()
 {
-    // TODO Auto-generated destructor stub
-    mEditorData.clear();
 }
 
 void MsgViewManager::onBackAction()
@@ -99,7 +109,7 @@
         }
 
         if (!mServiceRequest) {
-            HbApplication::quit();
+            handleSendToBackGround();
         }
         else {
             completeServiceRequest();
@@ -401,6 +411,10 @@
 {
     QVariantList param;
 
+    mClient->setVisibility(true);
+    mActivityHandler->clearActivities();
+    mBringtoForground = false;    
+    
     if (conversationId < 0) {
         param << MsgBaseView::CLV;
         param << MsgBaseView::SERVICE;
@@ -708,8 +722,7 @@
         }
 
         if (MsgBaseView::DLV == mPreviousView) {
-            //Populate editor after view ready indication 
-            populateUniEditorAfterViewReady(editorData);
+            mUniEditor->openDraftsMessage(editorData);
         }
         else {
             mUniEditor->populateContent(editorData);
@@ -990,37 +1003,6 @@
 }
 
 // ----------------------------------------------------------------------------
-// MsgViewManager::populateEditorAfterViewReady
-// @see header
-// ----------------------------------------------------------------------------
-void MsgViewManager::populateUniEditorAfterViewReady(const QVariantList& editorData)
-	{
-    QCRITICAL_WRITE("MsgViewManager::populateUniEditorAfterViewReady start.");
-	 //Save the editor data and use it in ViewReady handler
-	 mEditorData = editorData;	 
-	 connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(populateUniEditorView()));
-	QCRITICAL_WRITE("MsgViewManager::populateUniEditorAfterViewReady end.");
-	}
-
-// ----------------------------------------------------------------------------
-// MsgViewManager::populateUniEditorView
-// @see header
-// ----------------------------------------------------------------------------
-void MsgViewManager::populateUniEditorView()
-    {
-    QCRITICAL_WRITE("MsgViewManager::populateUniEditorView start.");
-    if (mUniEditor)
-        {
-        mUniEditor->openDraftsMessage(mEditorData);
-        }
-    mEditorData.clear();
-    
-    disconnect(mMainWindow, SIGNAL(viewReady()), this,
-            SLOT(populateUniEditorView()));
-    QCRITICAL_WRITE("MsgViewManager::populateUniEditorView end.");
-}
-
-// ----------------------------------------------------------------------------
 // MsgViewManager::onDialogDeleteMsg
 // @see header
 // ----------------------------------------------------------------------------
@@ -1166,4 +1148,126 @@
         return localId;
     }
 
+// ----------------------------------------------------------------------------
+// MsgViewManager::handleSendToBackGround
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::handleSendToBackGround()
+    {
+    if(mBringtoForground == false)
+        {
+        if (!mClient)
+            mClient = new TsTaskSettings;
+        mClient->setVisibility(false);
+
+
+        mServiceRequest = false;
+        mMainWindow->lower();
+
+        mActivityHandler->saveActivity();
+
+        mMainWindow->removeView(mListView);
+        delete mListView;
+        mListView = NULL;
+
+        if(mConversationView)
+            {
+            mMainWindow->removeView(mConversationView);
+            delete mConversationView;
+            mConversationView = NULL;
+            }
+        
+        if(mUniEditor)
+            {
+            mMainWindow->removeView(mUniEditor);
+            delete mUniEditor;
+            mUniEditor = NULL;
+            }
+
+        mBringtoForground = true;
+
+        TUid appUid = RProcess().SecureId();
+        TApaTaskList taskList(CEikonEnv::Static()->WsSession());
+        TApaTask task = taskList.FindApp(appUid);
+        if(task.Exists())
+            {
+            task.SendToBackground();
+            }
+        }
+    mPreviousView = MsgBaseView::DEFAULT;
+    mCurrentView = MsgBaseView::DEFAULT;      
+    }
+
+// ----------------------------------------------------------------------------
+// MsgViewManager::handleApplicationActive
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::handleApplicationActive()
+    {
+    if(mBringtoForground)
+        {
+        mServiceRequest = false;
+        mClient->setVisibility(true);
+        mActivityHandler->clearActivities();
+
+        mBringtoForground = false;        
+
+        QVariantList param;
+        param << MsgBaseView::CLV;
+        param << MsgBaseView::CLV;
+        switchView(param);
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// MsgViewManager::setActivityHandler
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::setActivityHandler(MsgActivityHandler* activityHandler)
+    {
+    mActivityHandler = activityHandler;
+    connect(mActivityHandler, 
+        SIGNAL(activated(Af::ActivationReason, QString, QVariantHash)), 
+        this, 
+        SLOT(handleActivated(Af::ActivationReason, QString, QVariantHash)));
+    }
+
+// ----------------------------------------------------------------------------
+// MsgViewManager::handleActivated
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::handleActivated(Af::ActivationReason reason, 
+        QString name, 
+        QVariantHash parameters)
+    {
+        Q_UNUSED(parameters)
+        mClient->setVisibility(true);
+        mBringtoForground = false;        
+        mServiceRequest = false;
+
+        if( reason == Af::ActivationReasonActivity)
+            {
+            QVariant data;
+            if(name == EditorActivityName)
+                {               
+                bool ok = QMetaObject::invokeMethod(
+                    mActivityHandler->activitiyStorage(),"activityData",
+                    Q_RETURN_ARG(QVariant,data),Q_ARG(QString,name));
+                }
+            int activityMsgId = mActivityHandler->parseActivityData(data);
+            if(activityMsgId == INVALID_MSGID)
+                {
+                QVariantList param;
+                param << MsgBaseView::CLV;
+                param << MsgBaseView::CLV;
+                switchView(param);
+                }
+            else 
+                {
+                openUniEditorActivity(activityMsgId);
+                }
+            }        
+        mActivityHandler->clearActivities();
+    }
+
 //EOF
--- a/messagingapp/msgui/msgaudiofetcher/tsrc/tsrc.pri	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgaudiofetcher/tsrc/tsrc.pri	Tue Oct 19 11:30:16 2010 +0530
@@ -13,7 +13,12 @@
 # 
 # Description:
 #
-#
+
+QT += testlib
+QT -= gui
+
+CONFIG += hb
+CONFIG += symbian_test
 
 TEMPLATE = app
 TARGET.CAPABILITY  = All -TCB
@@ -37,22 +42,11 @@
 # msgui tsrc
 INCLUDEPATH += ../../../tsrc/shared
 
-# messaging inc 
-#INCLUDEPATH += ../../../../../inc
 
-#INCLUDEPATH += ../../../msguiutils/inc
-#INCLUDEPATH += ../../../../msgutils/unieditorutils/editorgenutils/inc
-#INCLUDEPATH += ../../../appengine/inc
-#INCLUDEPATH += ../../../../smartmessaging/ringbc/inc
-#INCLUDEPATH += ../../../../msgsettings/settingsview/inc
-#INCLUDEPATH += ../../../../msgutils/unidatamodel/univcaldataplugin/inc
 
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
-QT += testlib
-QT -= gui
-CONFIG += hb
-CONFIG += symbian_test
+
 
 
 #HEADERS
--- a/messagingapp/msgui/msgaudiofetcher/tsrc/unittest_msgaudiofetchermodel/unittest_msgaudiofetchermodel.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgaudiofetcher/tsrc/unittest_msgaudiofetchermodel/unittest_msgaudiofetchermodel.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -25,6 +25,32 @@
     "./resources/Esp.rng	c:/data/testAudioFetcher/Esp.rng" \
     "./resources/Desk.rng	c:/data/testAudioFetcher/Desk.rng"
     
+symbian: {
+
+	addnondrm.sources = ./resources/nondrm.amr
+	addnondrm.path = C:/data/testAudioFetcher
+	DEPLOYMENT += addnondrm
+
+	adddrm.sources = ./resources/drm.amr
+	adddrm.path = C:/data/testAudioFetcher
+	DEPLOYMENT += adddrm
+
+	addDRM_DM.sources = ./resources/DRM_DM.dm
+	addDRM_DM.path = C:/data/testAudioFetcher
+	DEPLOYMENT += addDRM_DM
+	
+	addDRM_ARM.sources = ./resources/DRM_AMR.dcf
+	addDRM_ARM.path = C:/data/testAudioFetcher
+	DEPLOYMENT += addDRM_ARM
+
+	addEsp_Rng.sources = ./resources/Esp.rng
+	addEsp_Rng.path = C:/data/testAudioFetcher
+	DEPLOYMENT += addEsp_Rng
+		
+	addDesk_Rng.sources = ./resources/Desk.rng
+	addDesk_Rng.path = C:/data/testAudioFetcher
+	DEPLOYMENT += addDesk_Rng
+	}
 include(../tsrc.pri)
 
 RESOURCES += unittest_msgaudiofetchermodel.qrc
--- a/messagingapp/msgui/msgaudiofetcher/tsrc/unittest_msgaudiopreview/unittest_msgaudiopreview.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msgaudiofetcher/tsrc/unittest_msgaudiopreview/unittest_msgaudiopreview.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -22,6 +22,14 @@
 
 #RESOURCES += unittest_msgaudiopreview.qrc
 
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "./resources/drm.amr		c:/data/testAudioFetcher/drm.amr" 
+symbian: {
+	adddrm.sources = ./resources/drm.amr
+	adddrm.path = C:/data/testAudioFetcher
+	DEPLOYMENT += adddrm
+	}
+
 # Input
 HEADERS += unittest_msgaudiopreview.h
 SOURCES += unittest_msgaudiopreview.cpp
\ No newline at end of file
--- a/messagingapp/msgui/msguiutils/src/msgservicelaunchutil.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/msguiutils/src/msgservicelaunchutil.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -21,6 +21,7 @@
 #include <xqappmgr.h>
 #include <hbglobal.h>
 #include <xqconversions.h>
+#include <hbdevicemessagebox.h>
 
 #include "msgservicelaunchutil.h"
 #include "msgcontactsutil.h"
@@ -29,6 +30,7 @@
 
 // LOCAL CONSTANTS
 #define LOC_TITLE   hbTrId("txt_messaging_title_messaging")
+#define LOC_FILE_NOT_OPEN	hbTrId("txt_messages_dialog_file_cannot_be_opened")
 const QString VCARD_MIMETYPE("text/X-vCard");
 
 //--------------------------------------------------------------
@@ -124,11 +126,13 @@
         request = appManager.create(sf, d);
 
         if (!request) {
+        	HbDeviceMessageBox::information(LOC_FILE_NOT_OPEN);
             sf.close();
             return;
         }
     }
     else {
+    	HbDeviceMessageBox::information(LOC_FILE_NOT_OPEN);
         sf.close();
         return;
     }
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h	Tue Oct 19 11:30:16 2010 +0530
@@ -38,8 +38,7 @@
     /**
      * Constructor
      */
-    MsgUnifiedEditorAddress(const QString& label,
-                            QGraphicsItem *parent = 0);
+    MsgUnifiedEditorAddress(const QString& label, QGraphicsItem *parent = 0);
 
     /**
      * Destructor
@@ -62,7 +61,7 @@
      * setter method to set address
      * @param addrlist, list of addresses to be set in address editor
      */
-    void setAddresses(ConvergedMessageAddressList addrlist,bool aSkipCheck=FALSE);
+    void setAddresses(ConvergedMessageAddressList addrlist,bool aSkipCheck=false);
 
     /**
      * Get amount of digits to be used in contact matching
@@ -85,17 +84,6 @@
      */
     void setFocus();
 
-signals:
-    /**
-     * Emitted when send button from virtual ITUT is pressed.
-     */
-    void sendMessage();
-
-    /**
-     * Emitted when content is added or removed
-     */
-    void contentChanged();
-
 private slots:
 
     /**
@@ -158,6 +146,16 @@
      * Reset the addresslist to previous list
      */
     void resetToPrevious();
+    
+    /**
+     * emits contentsChanged signal on address count change.
+     */
+    void emitContentsChanged();
+    
+    /**
+     * Checks if address field has a valid email id.
+     */
+    bool hasValidEmailAddress();
 
 private:
 
@@ -205,6 +203,14 @@
      * limit e.g. multiple selection from contact selection dialog
      */
     int mExceedsMaxMmsRecipientsBy;
+    
+    /**
+     * Number of addresses present.
+     */
+    int mAddressCount;
+#ifdef UNIEDITOR_UNIT_TEST
+    friend class TestMsgUnifiedEditorAddress;
+#endif
     };
 
 #endif //MSG_UNIFIED_EDITOR_ADDRESS_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h	Tue Oct 19 11:30:16 2010 +0530
@@ -172,7 +172,7 @@
      */
     MsgUnifiedEditorUtils *mEditorUtils;
 
-#ifdef MSGUI_UNIT_TEST
+#ifdef UNIEDITOR_UNIT_TEST
     /**
      * Unit Testing
      */
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h	Tue Oct 19 11:30:16 2010 +0530
@@ -17,13 +17,13 @@
 #ifndef MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H
 #define MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H
 
-#include <HbWidget>
+#include <msgunieditorbasewidget.h>
 #include "msgunieditorattachment.h"
 
 class QGraphicsLinearLayout;
 class MmsConformanceCheck;
 
-class MsgAttachmentContainer : public HbWidget
+class MsgAttachmentContainer : public MsgUnifiedEditorBaseWidget
     {
     Q_OBJECT
 
@@ -78,12 +78,15 @@
      * @return size
      */
     int containerSize();
+    
+    /**
+     * check if given file name is in use or not.
+     * @param fileName, file name under queation
+     * @return true/false if in use/not use.
+     */
+    bool fileNameInUse(const QString& fileName);
 
 signals:
-    /**
-     * emit when container content changes
-     */
-    void contentChanged();
 
     /**
      * emit to indicate view that container is now empty
@@ -98,12 +101,6 @@
     void deleteAttachment(MsgUnifiedEditorAttachment* attachment);
     
 private:
-    /**
-     * size of the msg
-     */
-    int messageSize();
-    
-private:
     
     /**
      * container's layout
@@ -124,6 +121,10 @@
      * flag to tell, if container is holding MM content
      */
     bool mIsMMContent;
+    
+#ifdef UNIEDITOR_UNIT_TEST
+    friend class TestMsgAttachmentContainer;
+#endif
     };
 
 #endif // MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditoraudiowidget.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraudiowidget.h	Tue Oct 19 11:30:16 2010 +0530
@@ -122,7 +122,7 @@
      */
     bool mValidMediaDuration;
     
-#ifdef MSGUI_UNIT_TEST
+#ifdef UNIEDITOR_UNIT_TEST
     /**
      * Unit Testing
      */
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbasewidget.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbasewidget.h	Tue Oct 19 11:30:16 2010 +0530
@@ -29,6 +29,9 @@
     MsgUnifiedEditorBaseWidget(QGraphicsItem *parent = 0):HbWidget(parent){}
     virtual void setFocus(){}
     
+signals:
+    void contentsChanged(const QVariant& data);
+    
 };
 
 
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h	Tue Oct 19 11:30:16 2010 +0530
@@ -22,14 +22,9 @@
 #include <f32file.h>
 #include "msgunieditorprocessimageoperation.h"
 
-class HbTextEdit;
-class HbTextItem;
-class HbFrameItem;
 class CMsgMediaResolver;
 class CMsgImageInfo;
 class MmsConformanceCheck;
-class UniEditorPluginInterface;
-class UniEditorPluginLoader;
 class MsgUnifiedEditorPixmapWidget;
 class MsgUniFiedEditorAudioWidget;
 
@@ -56,11 +51,6 @@
     /**
      * Seeker method to return back data to editor's view
      */
-    QString text();
-
-    /**
-     * Seeker method to return back data to editor's view
-     */
     const QStringList mediaContent();
     
     /**
@@ -69,27 +59,6 @@
      */
     int bodySize();
     
-    /*
-     * Returns value of mUnicode 
-     * @return mUnicode   
-     */
-     bool isUnicode();
-
-     /*
-      * Disables char counter
-      */
-     void disableCharCounter();
-
-     /*
-      * Enables char counter
-      */
-     void enableCharCounter();
-     
-     /**
-      * To set focus on editable field.
-      */
-     void setFocus();
-
      /**
       * Get to find body already contains an image
       * @return bool
@@ -108,13 +77,6 @@
      */ 
     void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent,
                                TFileName& aFileName );
-    /**
-	 * Function which tells whether the image resize process is in progress
-	 */
-    bool isImageResizing()
-        {
-        return mIsImageResizing;
-        }
 
     /**
      * remove media content.called when file is not avaialable
@@ -128,37 +90,13 @@
      * @param medialist list of absolute paths of media.
      * @param draftMessage specifies draft message
      */
-    void setImage(QString& imagefile, bool draftMessage = false);
+    void setImage(const QString& imagefile, bool draftMessage = false);
 
     /**
      * Called to insert audio content in editor.
      * @param medialist list of absolute paths of media.
      */
-    void setAudio(QString& audiofile);
-
-    /**
-     * Called to insert body text in editor.
-     * @param text body text.
-     */
-    void setText(QString& text);
-
-signals:
-    /**
-     * Emitted when send button from virtual ITUT is pressed.
-     */
-    void sendMessage();
-
-    /**
-     * Emitted when msg-body content changes
-     */
-    void contentChanged();
-	
-    /**
-     * Emitted when image is being processed.
-     * @param enable, true to enable/ false to disable.
-     */
-   void enableSendButton(bool enable) const;
-
+    void setAudio(const QString& audiofile);
 
 
 protected: // from HbWidget
@@ -169,6 +107,10 @@
      */
     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
 
+signals:
+    //emitted to enable or disable menu options.
+    void enableMenuAction(int action, bool enable);
+    
 private slots:
 
     /**
@@ -176,11 +118,6 @@
      */
     void removeMedia();
     
-    /**
-     * handle text changes in body field
-     */
-    void onTextChanged();
-
 private:
 
     /**
@@ -193,11 +130,6 @@
      * Set that body now contains an audio
      */
 	void setAudio(bool audio = false);
-
-    /**
-     * size of the msg
-     */
-    int messageSize();    
     
     /**
      * Handler for set image function 
@@ -228,11 +160,6 @@
     bool mHasAudio;
 
     /**
-     * editor to in put text.
-     */
-    HbTextEdit* mTextEdit;
-
-    /**
      * icon item to preview images.
      */
     MsgUnifiedEditorPixmapWidget* mPixmapItem;
@@ -276,11 +203,6 @@
      * Size of audio in body
      */
     int mAudioSize;
-    
-    /**
-     * Size of video in body
-     */
-    int mVideoSize;
 
     /**
      * CUniEditorProcessImageOperation object
@@ -298,49 +220,6 @@
     CMsgImageInfo *mImageInfo;    
     
     /**
-     * Instance of HbTextItem
-     * Will be deleted automatically by parent.
-     * Own.
-     */
-    HbTextItem *mCharCounter;
-
-    /**
-     * Instance of HbFrameItem
-     * Will be deleted automatically by parent.
-     * Own.
-     */
-    HbFrameItem* mBackgroundItem;
-    
-    /**
-     * Holds the previous buffer inside msgeditor
-     */
-    QString mPrevBuffer;
-
-    /**
-     * Holds char type supported
-     */
-    int mCharSupportType;
-
-    /**
-     * Instance of UniEditorPluginInterface
-     * Will be deleted automatically by parent.
-     * Own.
-     */
-    UniEditorPluginInterface* mPluginInterface;
-
-    /**
-     * Instance of UniEditorPluginLoader
-     * Will be deleted when UniEditorPluginInterface object is deleted
-     * Not Own.
-     */
-    UniEditorPluginLoader* mPluginLoader;
-
-    /*
-     * Maintains information if any unicode character has been entered or not
-     */
-    bool mUnicode;
-    
-    /**
      * Content widget for processing animation.
      */
     HbWidget* mProcessingWidget;
@@ -350,11 +229,11 @@
      */
     bool mDraftMessage ;
     
-    /*
-     * Flag to indicate the state of image resizing process. 
-	 * true - resize in progress. false - resize is not underway.
-     */
-    bool mIsImageResizing;
+#ifdef UNIEDITOR_UNIT_TEST
+    friend class TestMsgUnifiedEditorBody;
+#endif
+    
+   
 };
 
 #endif //MSG_UNIFIED_EDITOR_BODY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbodyeditor.h	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef MSG_UNIFIED_EDITOR_BODY_EDITOR_H
+#define MSG_UNIFIED_EDITOR_BODY_EDITOR_H
+
+// SYSTEM INCLUDES
+#include <msgunieditorbasewidget.h>
+#include <HbTextEdit>
+
+// FORWARD DECLARATIONS
+class HbPushButton;
+class HbFrameItem;
+class HbTextItem;
+class UniEditorPluginLoader;
+class UniEditorPluginInterface;
+class UniEditorGenUtils;
+class ConvergedMessage;
+
+/**
+ * Custom editor class
+ */
+class MsgEditor : public HbTextEdit
+{
+    Q_OBJECT
+    
+public:    
+    /**
+     * Constructor
+     */
+    MsgEditor(QGraphicsItem *parent = 0);
+    
+protected:
+    /**
+     * reimplemented from base class.
+     */
+    void inputMethodEvent(QInputMethodEvent *event);
+};
+
+/**
+ * This class is a custom layout widget for Msg Editor.
+ */
+
+class MsgUnifiedEditorBodyEditor : public MsgUnifiedEditorBaseWidget
+{
+    Q_OBJECT
+
+public:
+
+    /**
+     * Constructor
+     */
+    MsgUnifiedEditorBodyEditor(QGraphicsItem *parent = 0);
+
+    /**
+     * Destructor
+     */
+    virtual ~MsgUnifiedEditorBodyEditor();
+
+public:
+    /* Setter/Getter methods */
+
+    /**
+     * Returns the editor's contents.
+     * @return Editor contents
+     */
+    QString content() const;
+
+    /**
+     * Set the editor's content.
+     * @param contentText content text to set.
+     */
+    void setContent(const QString &contentText);
+
+    /**
+     * This function does initialisations needed for character counter
+     */
+    void setEncodingSettingsL();
+    
+    /**
+     * Packs body editor data to ConvergedMessage object.
+     * @param msg. ConvergedMessage object.(out parameter)
+     */
+    void packMessage(ConvergedMessage &msg);
+    
+    /**
+     * Populate data into body editor from ConvergedMessage.
+     * @param msg, ConvergedMessage object.
+     */
+    void populateContent(const ConvergedMessage& msg);
+   
+signals:
+
+    /**
+     * Emitted when send button is pressed.
+     */
+    void sendMessage();
+    
+public slots:
+
+    /**
+     * Enables/Disables send button based on message rediness for send.
+     */
+    void enableSendButton(bool enable);
+    
+private slots:
+
+    /**
+     * Called when editor content is chaged.
+     */
+    void onContentsChanged();
+    
+    /**
+     * called when send button is pressed/released.
+     */  
+    void onPressed();
+    void onReleased();
+
+private:
+
+    /**
+     * Initialization function.
+     */
+    void init();
+    
+	 /**
+	  * To update back ground.
+	  */
+    void updateButtonBackgroundAndColor(const QString& bg,const QString& iconColor);
+
+private:
+
+    /**
+     * Instance of message edit.
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    MsgEditor *mMsgEditor;
+
+    /**
+     * Instance of push button.
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbPushButton *mSendButton;
+
+    /**
+     * Instance of HbTextItem
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbTextItem *mCharCounter;
+
+    /**
+     * Instance of HbFrameItem
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbFrameItem* mBackgroundItem;
+    
+    /**
+     * Holds char type supported
+     */
+    int mCharSupportType;
+
+    /**
+     * Instance of UniEditorPluginInterface
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    UniEditorPluginInterface* mPluginInterface;
+
+    /**
+     * Instance of UniEditorPluginLoader
+     * Will be deleted when UniEditorPluginInterface object is deleted
+     * Not Own.
+     */
+    UniEditorPluginLoader* mPluginLoader;
+
+    /**
+     * Instance of UniEditorGenUtils
+     * Own.
+     */
+    UniEditorGenUtils* mEditorUtils;
+
+#ifdef UNIEDITOR_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgUnifiedEditorBodyEditor;
+#endif
+};
+
+#endif // MSG_UNIFIED_EDITOR_BODY_EDITOR_H
+// EOF
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorimageprocessor.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorimageprocessor.h	Tue Oct 19 11:30:16 2010 +0530
@@ -408,6 +408,12 @@
         TInt iQFactorCalculated;
         TInt iMPixFactor;
         TInt iOriginalQualityFactor;
+#ifdef UNIEDITOR_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestCUniImageProcessor;
+#endif
     };
 
 #include <msgunieditorimageprocessor.inl>
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h	Tue Oct 19 11:30:16 2010 +0530
@@ -18,11 +18,11 @@
 #ifndef MSG_UNIFIED_EDITOR_LINEEDIT_H
 #define MSG_UNIFIED_EDITOR_LINEEDIT_H
 
-#include <HbLineEdit>
+#include <HbTextEdit>
 #include<QBasicTimer>
 
 
-class MsgUnifiedEditorLineEdit : public HbLineEdit
+class MsgUnifiedEditorLineEdit : public HbTextEdit
 {
     Q_OBJECT
 
@@ -89,6 +89,7 @@
     void setHighlight(int currentPos);
     QString text() const;
     void handleTap();
+    void setSelection(int start, int length);
 
 private:
     QRegExp mLabelExpr;
@@ -99,7 +100,7 @@
     int mSelectionEnd;
     bool mDefaultBehaviour;
     
-#ifdef MSGUI_UNIT_TEST
+#ifdef UNIEDITOR_UNIT_TEST
     friend class TestMsgUnifiedEditorLineEdit;
 #endif
 };
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.h	Tue Oct 19 11:30:16 2010 +0530
@@ -20,6 +20,7 @@
 
 #include <QObject>
 #include "convergedmessage.h"
+
 class MsgUnifiedEditorView;
 class HbWidget;
 class UniEditorGenUtils;
@@ -48,62 +49,100 @@
      * Set to skip showing note for first time
      * @param skip true/false
      */
-    inline void setSkipNote(bool skip = true);
+    inline void setSkipNote(bool skip = true)
+    {
+        mSkipNote = skip;
+    }
     
     /**
      * Seeker method to access current message type
      */
-    static inline ConvergedMessage::MessageType messageType();
+    static inline ConvergedMessage::MessageType messageType()
+    {
+        return mMessageType;
+    }
 
     /**
      * seeker function to get current msg size in bytes
      */
-    static inline int messageSize();
+    static inline int messageSize()
+    {
+        return mBodyContentSize + mContainerSize + mSubjectSize;
+    }
 
     /**
      * seeker function to get current msg's body size 
      * in bytes
      */
-    static inline int bodySize();
+    static inline int bodySize()
+    {
+        return mBodyContentSize;
+    }
 
     /**
      * seeker function to get current msg's attachment
      * container size in bytes
      */
-    static inline int containerSize();
+    static inline int containerSize()
+    {
+        return mContainerSize;
+    }
 
     /**
      * seeker function to get current msg's subject
      * size in bytes
      */
-    static inline int subjectSize();
+    static inline int subjectSize()
+    {
+        return mSubjectSize;
+    }
 
     /**
      * seeker function to get max possible mms size
      * in bytes
      */
-    static inline int maxMmsSize();
+    static inline int maxMmsSize()
+    {
+        return mMaxMmsSize;
+    }
     
     /**
      * seeker funtion to get max recipient count for sms
      */
-    static inline int maxSmsRecipients();
+    static inline int maxSmsRecipients()
+    {
+        return mMaxSmsRecipients;
+    }
 
     /**
      * seeker funtion to get max recipient count for mms
      */
-    static inline int maxMmsRecipients();
+    static inline int maxMmsRecipients()
+    {
+        return mMaxMmsRecipients;
+    }
     
     /**
      * get total address count in To, Cc & Bcc fields
      */
-    static inline int msgAddressCount();
+    static inline int msgAddressCount()
+    {
+        return  mToAddressCount + mCcAddressCount + mBccAddressCount;
+    }
+    
+    /**
+     * tells if message is ready for send.
+     */
+    static inline bool readyForSend()
+    {
+        return mReadyForSend;
+    }
 
 public slots:
     /**
      * slot to handle content change in any editor component
      */
-    void handleContentChange();
+    void handleContentsChanged(const QVariant& data);
 
 signals:
     /**
@@ -111,6 +150,11 @@
      * @param enable true if send is possible else false.
      */
     void enableSend(bool enable);
+    
+    /**
+     * Emitte when contents are changed, to set drafts flag.
+     */
+    void contentsChanged();
 
 private:
     /**
@@ -124,22 +168,11 @@
     ConvergedMessage::MessageType projectedMsgType();
 
     /**
-     * update various msg info changes during editing
-     * @param senderWidget, Editor widget which triggered 
-     * content change slot
-     */
-    void updateMsgInfo(HbWidget* senderWidget);
-    
-    /**
      * show type change discreet note
      */
     void showPopup(const QString& text);
     
-    /**
-     * accessor for view
-     */
-    MsgUnifiedEditorView* view();
-    
+  
     /**
      * check editor body for MMS content
      * @return true if MMS content is present
@@ -168,6 +201,16 @@
      * Checks if composed message can be sent and emits a signal.
      */
     void updateSend();
+    
+    /**
+     * Updates body content size.
+     */
+    void updateBodyContentSize();
+    
+    /**
+     * resets value of static member variables.
+     */
+    void reset();
 
 private:
 
@@ -176,6 +219,31 @@
      * Note need to be skipped when an mms is opened from draft.
      */
     bool mSkipNote;
+    
+    /**
+     * Flag to keep information, if attachment container has mms content.
+     */
+    bool mContainerHasMmsContent;
+    
+    /**
+     * Priority.
+     */
+    ConvergedMessage::Priority mPriority;
+    
+    /**
+     * Email id is present in to field or not.
+     */
+    bool mEmailPresent;
+    
+    /**
+     * Body text has uni code char(s).
+     */
+    bool mUniCode;
+    
+    /**
+     * Flag to hold state of image resizing
+     */
+    bool mImageResizing;
 
     /**
      * Type of msg under composition in the editor 
@@ -188,6 +256,16 @@
     static int mBodySize;
     
     /**
+     * msg body text size in bytes
+     */
+    static int mBodyTextSize;
+    
+    /**
+     * msg body content (mBodySize + mBodyTextSize + mime headers) size in bytes.
+     */
+    static int mBodyContentSize;
+    
+    /**
      * msg container size in bytes
      */
     static int mContainerSize;
@@ -213,17 +291,29 @@
     static int mMaxMmsRecipients;
     
     /**
-     * current msg address count (to + cc + bcc)
+     * Address count in various fields.
      */
-    static int mMsgCurrAddressCount;
+    static int mToAddressCount;
+    static int mCcAddressCount;
+    static int mBccAddressCount;
+    
+    /**
+     * flag to check if message is ready for send.
+     */
+    static bool mReadyForSend;
 
     /**
      * UniEditorGenUtils object
      * Owned
      */
     UniEditorGenUtils* mUniEditorGenUtils;
+#ifdef UNIEDITOR_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgUnifiedEditorView;
+    friend class TestMsgUnifiedEditorMonitor;
+#endif
     };
 
-#include "msgunieditormonitor.inl"
-
 #endif //MSG_UNIFIED_EDITOR_MONITOR_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.inl	Tue Oct 05 13:58:47 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* Copyright (c) 2007 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: msgmonitor.inl
-*/
-
-
-
-// ========== INLINE METHODS ===============================
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::setSkipNote
-// @see header file
-//---------------------------------------------------------------
-inline void MsgUnifiedEditorMonitor::setSkipNote(bool skip)
-{
-    mSkipNote = skip;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::messageType
-// @see header file
-//---------------------------------------------------------------
-inline ConvergedMessage::MessageType MsgUnifiedEditorMonitor::messageType()
-{
-    return mMessageType;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::messageSize
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::messageSize()
-{
-    return mBodySize + mContainerSize + mSubjectSize;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::bodySize
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::bodySize()
-{
-    return mBodySize;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::containerSize
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::containerSize()
-{
-    return mContainerSize;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::subjectSize
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::subjectSize()
-{
-    return mSubjectSize;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::maxMmsSize
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::maxMmsSize()
-{
-    return mMaxMmsSize;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::maxSmsRecipients
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::maxSmsRecipients()
-{
-    return mMaxSmsRecipients;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::maxMmsRecipients
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::maxMmsRecipients()
-{
-    return mMaxMmsRecipients;
-}
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::msgAddressCount
-// @see header file
-//---------------------------------------------------------------
-inline int MsgUnifiedEditorMonitor::msgAddressCount()
-{
-    return mMsgCurrAddressCount;
-}
-
-//  End of File
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h	Tue Oct 19 11:30:16 2010 +0530
@@ -120,7 +120,7 @@
      */
     QString mPixmapPath;
 
-#ifdef MSGUI_UNIT_TEST
+#ifdef UNIEDITOR_UNIT_TEST
     /**
      * Unit Testing
      */
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h	Tue Oct 19 11:30:16 2010 +0530
@@ -260,6 +260,9 @@
         TInt                        iMmsCreationMode;
         RFs                         iFs;
         TBool largeImageQuery;
+#ifdef UNIEDITOR_UNIT_TEST
+    friend class TestCUniEditorProcessImageOperation;
+#endif
     };
 
 #endif //MSG_UNIFIED_EDITOR_PROCESS_IMAGEOPERATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorscrollarea.h	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: manages scrollable portion of view.
+ *
+ */
+
+#ifndef MSGUNIEDITORSCROLLAREA_H_
+#define MSGUNIEDITORSCROLLAREA_H_
+
+#include <HbScrollArea>
+#include "convergedmessageaddress.h"
+
+class QGraphicsLinearLayout;
+class MsgUnifiedEditorAddress;
+class MsgUnifiedEditorSubject;
+class MsgUnifiedEditorBody;
+class MsgUnifiedEditorBaseWidget;
+class ConvergedMessage;
+class MsgAttachmentContainer;
+class MsgUnifiedEditorMonitor;
+
+class MsgUnifiedEditorScrollArea : public HbScrollArea
+{
+    Q_OBJECT
+    
+public:
+    MsgUnifiedEditorScrollArea(MsgUnifiedEditorMonitor* msgMonitor,QGraphicsItem *parent = 0);
+    ~MsgUnifiedEditorScrollArea();
+    
+    /**
+     * Tells if contacts in "To" "Cc" , "Bcc" field are valid or not
+     */
+    bool contactsValid();
+
+    /**
+     * First address of "To" field.
+     */
+    ConvergedMessageAddress* currentAddress();
+    
+    /**
+     * Packs the content inside editor into converged message
+     * @param [OUT]msg, converged message to hold editor data
+     * @param isSave, flag to indicate that msg needs to be packed
+     * for saving to draft or not
+     * @return returns error if something fails
+     */
+    int packMessage(ConvergedMessage &msg, bool isSave);
+    
+    /**
+     * add attachments to the editor
+     * @param files list of file paths
+     */
+    void addAttachments(const QStringList files);
+    
+    /**
+     * Checks if vcf file name is already in use or not.
+     */
+    bool fileNameInUse(const QString& fileName);
+    
+    /**
+     * Enables/Disables scrolling based on parameter passed.
+     */
+    void enableScrolling(bool enable);
+    
+    /**
+     * Populate data into various fields from ConvergedMessage.
+     * @param msg, ConvergedMessage object.
+     * @param draftMessage, true if message is opened from drafts.
+     */
+    void populateContent(const ConvergedMessage& msg, bool draftMessage, bool checkForInline);
+    
+protected:
+    /**
+     * Reimplemented from base class.
+     */
+    virtual bool scrollByAmount(const QPointF &delta);
+    
+
+    
+private:
+    void init();
+    void setFocus(MsgUnifiedEditorBaseWidget* item);
+    void formatAddresses(ConvergedMessageAddressList& addresses);
+    
+signals:
+    //emitted to enable or disable attach submenu options.
+    void enableMenuAction(int action, bool enable);
+    
+public slots:
+
+    /**
+     * Posts event to launch key pad.
+     */
+    void postInputPanelEvent();
+    
+    /**
+     * slot to add Cc,Bcc field.
+     */
+    void addCcBcc(bool needFocus = false);
+    
+    /**
+     * slot to add subject field.
+     */
+    void addSubject(bool needFocus = false);
+    
+    /**
+     * slot to change priority.
+     */
+    void changePriority();
+    
+    void setImage(const QString& path, bool draftMessage = false);
+    
+    void setAudio(const QString& filePath);
+    
+private slots:
+
+    /**
+     * slot to handle Cc, Bcc group-box's toggle action
+     */
+    void updateOtherRecipientCount(bool state);
+    
+    /**
+     * slot to tell view to remove the attachment's container
+     */
+    void removeAttachmentContainer();
+
+    /**
+     * add an attachment to the editor
+     * @return addition operation status
+     */
+    int addAttachment(const QString& filepath);
+
+
+private:
+
+    MsgUnifiedEditorMonitor* mMsgMonitor;
+    QGraphicsLinearLayout* mMainLayout;
+    MsgUnifiedEditorAddress* mToField;
+    MsgUnifiedEditorAddress* mCcField;
+    MsgUnifiedEditorAddress* mBccField;
+    MsgUnifiedEditorSubject* mSubjectField;
+    MsgUnifiedEditorBody* mBody;    
+    MsgAttachmentContainer* mAttachmentContainer;
+    
+    bool mEnableScrolling;
+#ifdef UNIEDITOR_UNIT_TEST
+    friend class TestMsgUnifiedEditorScrollArea;
+#endif
+};
+
+#endif /* MSGUNIEDITORSCROLLAREA_H_ */
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h	Tue Oct 19 11:30:16 2010 +0530
@@ -73,12 +73,6 @@
      */
     void setFocus();
 
-signals:
-    /**
-     * Emitted when subject/priority content is added or removed
-     */
-    void contentChanged();
-    
 private slots:
     /**
      * called when contentsChanged signal is emitted by the line edit
@@ -119,7 +113,7 @@
      */
     QString mPrevBuffer;
     
-#ifdef MSGUI_UNIT_TEST
+#ifdef UNIEDITOR_UNIT_TEST
     friend class TestMsgUnifiesEditorSubject;
 #endif
     };
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorutils.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorutils.h	Tue Oct 19 11:30:16 2010 +0530
@@ -83,6 +83,9 @@
      * @param filePath Absolute path of content.
      */
     void launchViaSharableFile(const QString &filePath);
+#ifdef UNIEDITOR_UNIT_TEST
+    friend class TestMsgUnifiedEditorUtils;
+#endif
 
 };
 
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h	Tue Oct 19 11:30:16 2010 +0530
@@ -18,7 +18,7 @@
 #ifndef MSG_UNIFIED_EDITOR_VIEW_H
 #define MSG_UNIFIED_EDITOR_VIEW_H
 
-#ifdef MSGUI_UNIT_TEST
+#ifdef UNIEDITOR_UNIT_TEST
  #define UNIFIEDEDITOR_EXPORT
 #else
  #ifdef UNIFIEDEDITOR_DLL
@@ -31,23 +31,59 @@
 #include "msgbaseview.h"
 #include "convergedmessage.h"
 #include "convergedmessageid.h"
+#include <HbStaticVkbHost>
 
-class HbWidget;
 class HbAction;
-class HbGroupBox;
 class QGraphicsLinearLayout;
-class MsgUnifiedEditorSubject;
-class MsgUnifiedEditorAddress;
-class MsgUnifiedEditorBody;
 class MsgUnifiedEditorMonitor;
-class MsgAttachmentContainer;
 class UniEditorPluginLoader;
-class HbListWidgetItem;
-class HbAbstractVkbHost;
 class MsgUnifiedEditorBaseWidget;
-class HbListWidget;
 class MsgAudioFetcherDialog;
+class MsgUnifiedEditorScrollArea;
+class MsgUnifiedEditorBodyEditor;
 
+/**
+ * options in menu.
+ */
+enum MENU_ACTIONS
+{
+    PHOTO = 0x00,
+    SOUND = 0x01,
+    VCARD = 0x02,
+    SUBJECT = 0x03,
+    CCBCC = 0x04
+};
+
+/**
+ * Custom vkb host specific to unifiededitor.
+ */
+class MsgUniEditorVkbHost: public HbStaticVkbHost
+{
+    Q_OBJECT
+    
+public:
+    MsgUniEditorVkbHost(HbWidget *target) : HbStaticVkbHost(target){}
+    
+signals:
+    /**
+     * emitted when focus changes.
+     */
+    void focusChanged();
+    
+protected:
+    /**
+     * Reimpleted from base class.
+     */
+    void refresh()
+    {
+        emit focusChanged();
+        HbStaticVkbHost::refresh();
+    }
+};
+
+/**
+ * unified editor view class.
+ */
 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView
     {
     Q_OBJECT
@@ -76,7 +112,6 @@
      */
     void openDraftsMessage(const QVariantList& editorData);
 
-
     /**
      * Saves the content inside editor to save
      */
@@ -89,12 +124,7 @@
      * @see MsgBaseView
      */
     bool handleKeyEvent(int key);
-
-protected:
-    /**
-     * reimplemented from base class to provide proper geometry for scrolling.
-     */
-    void resizeEvent( QGraphicsSceneResizeEvent * event );
+    
 
 private:
 
@@ -104,11 +134,6 @@
     void addMenu();
 
     /**
-     * helper method to add tool bar.
-     */
-    void addToolBar();
-
-    /**
      * Packs the content inside editor into converged message
      * @param [OUT]msg, converged message to hold editor data
      * @param isSave, flag to indicate that msg needs to be packed
@@ -122,8 +147,9 @@
      * @param messageDetails message details
      * @param draftMessage boolean for specifying draft message
      */
-    void populateContentIntoEditor(
-        const ConvergedMessage& messageDetails, bool draftMessage = false);
+    void populateContentIntoEditor(const ConvergedMessage& messageDetails, 
+                                   bool draftMessage,
+                                   bool checkForInline);
     
     /**
      * Populate the editor with the message's content
@@ -133,8 +159,8 @@
      * @param editorOperation, forward or reply or replyAll etc
      */
     void fetchMessageFromStore(ConvergedMessageId& messageId,
-        ConvergedMessage::MessageType messageType,
-        int editorOperation);
+                               ConvergedMessage::MessageType messageType,
+                               int editorOperation);
     
     /**
      * Create VCards for all the contacts available in the list
@@ -151,20 +177,6 @@
      */
     QString generateFileName(QString& suggestedName);
     
-    /**
-     * Fetch images 
-     */
-    void fetchImages();
-
-    /**
-     * Fetch contacts
-     */
-    void fetchContacts();
-
-    /**
-     * Fetch audio
-     */
-    void fetchAudio();
 
     /**
      * To hide/show chrome.
@@ -185,52 +197,18 @@
      * Removes editors temp folder.
      */
     void removeTempFolder();
-
-    /**
-     * Attachment options in TBE
-     * Row number of the TBE actions
-     */
-    enum TBE_AttachOption
-    {
-        TBE_PHOTO = 0x00, TBE_SOUND = 0x01, TBE_VCARD = 0x02
-    };
-
-    /**
-     * Enable/Disable attachment options for slide-conformance
-     * @param opt, row number of action in TBE
-     * @param isEnabled, true/false
-     */
-    void setAttachOptionEnabled(MsgUnifiedEditorView::TBE_AttachOption opt,
-            bool enable);
-
-    /**
-     * Addresses are all ok. Now parse not allowed chars away 
-	 * before giving it to MTM
-	 * @param addresses, list of ConvergedMessageAddress
-     */
-    void formatAddresses(ConvergedMessageAddressList& addresses);
     
 private slots:
 
     /**
      * slot to add subject field.
      */
-    void addSubject();
+    void addSubject(bool needFocus = false);
 
     /**
      * slot to add Cc,Bcc field.
      */
-    void addCcBcc();
-
-    /**
-     * slot to handle Cc, Bcc group-box's toggle action
-     */
-    void updateOtherRecipientCount(bool state);
-
-    /**
-     * slot to change priority.
-     */
-    void changePriority();
+    void addCcBcc(bool needFocus = false);
 
     /**
      * slot to current delete message.
@@ -253,26 +231,10 @@
     void send();
 	
     /**
-     * slot to tell view to remove the attachment's container
-     */
-    void removeAttachmentContainer();
-
-    /**
      * add attachments to the editor
      * @param files list of file paths
      */
     void addAttachments(QStringList files);
-
-    /**
-     * add an attachment to the editor
-     * @return addition operation status
-     */
-    int addAttachment(const QString& filepath);
-
-	/**
-     * called when extention item is clicked.
-     */
-    void handleViewExtnActivated(HbListWidgetItem* item);
     
     /**
      * Signal emitted when an error is generated.
@@ -314,7 +276,7 @@
     void setFocus(MsgUnifiedEditorBaseWidget* item);
     
     /**
-     * Listens to contentChanged signal of various fields.
+     * Listens to contentChanged signal for various editor fields.
      */
     void onContentChanged();
 
@@ -335,22 +297,6 @@
      * @param action selected action (yes or no).
      */
     void onDialogMmsSettings(HbAction* action);    
-	
-	/**
-     * Enable/Disable send tool button.
-     * @param true/false to enable/disable.
-     */
-     void enableSendButton(bool enable);
-     
-     /**
-      * This slot is triggered when vkb is about to be opened.
-      */
-     void vkbAboutToOpen();
-     
-     /**
-      * This slot is triggered when vkb is about to be closed.
-      */
-     void vkbAboutToClose();
      
      /** 
       * This slot is called after sound clip is 
@@ -363,38 +309,73 @@
       * @return bool, true if reply-path constraints are broken
       */
      bool isReplyPathBroken();
+     
+     /**
+      * Fetch images 
+      */
+     void fetchImages();
+
+     /**
+      * Fetch contacts
+      */
+     void fetchContacts();
+
+     /**
+      * Fetch audio
+      */
+     void fetchAudio();
+     
+     /**
+      * Enable/Disable/removes menu actions.
+      * @param opt, submenu actions.
+      * @param isEnabled, true/false
+      */
+     void enableMenuAction(int action, bool enable);
+     
+     /**
+      * Resets layout when vkb is cosed.
+      */
+     void resetLayout();     
+     
+     /**
+      * Perform layouting when vkb is opened.
+      */
+     void doLayout();
+     
+     /**
+      * Ensures visibility of editor widget in to visible area.
+      */
+     void ensureVisibility();
+     
+     /**
+      * Updates focus widget when editor gains focus.
+      */
+     void focusChanged();
+     
     
 private:
      
-    HbAction* mSubjectAction;
-    HbAction* mCcBccAction;
-    HbAction* mSendAction;
+     /**
+      * main layout of view.
+      */
     QGraphicsLinearLayout* mMainLayout;
-    MsgUnifiedEditorSubject* mSubjectField;
-    MsgUnifiedEditorAddress* mToField;
-    MsgUnifiedEditorAddress* mCcField;
-    MsgUnifiedEditorAddress* mBccField;
-    MsgUnifiedEditorBody*   mBody;
-
-    HbWidget* mContentWidget;
-
     MsgUnifiedEditorMonitor* mMsgMonitor;
-    MsgAttachmentContainer* mAttachmentContainer;
     UniEditorPluginLoader* mPluginLoader;
+    
+    /**
+     * Message id of current opened message.
+     */
     ConvergedMessageId mOpenedMessageId;
-    ConvergedMessage::MessageType mmOpenedMessageType;
+    
+    /**
+     * flag to check if message can be saved to drafts.
+     */
 	bool mCanSaveToDrafts;
-	HbAction *mAttachAction;
-    
-	/**
-	 * TBE's content widget
-	 */
-	HbListWidget* mTBExtnContentWidget;
 	
     /**
      * Instance of VKB host
      */
-	HbAbstractVkbHost* mVkbHost;
+	MsgUniEditorVkbHost* mVkbHost;
 	
 	/**
 	 * Instance of Audio Fetcher Dialog
@@ -418,8 +399,47 @@
      * Flag to tell if reply-path is available
      */
     bool mReplyPath;	
-
-	friend class MsgUnifiedEditorMonitor;
+    
+    /**
+     * Scrollable conatiner.
+     */
+    MsgUnifiedEditorScrollArea* mScrollArea;
+    
+    /**
+     * Body text editor.
+     */
+    MsgUnifiedEditorBodyEditor* mBodyEditor;
+    
+    /**
+     * Various actions.
+     */
+    HbAction* mSubjectAction;
+    HbAction* mCcBccAction;
+    HbAction* mPhotoAction;
+    HbAction* mSoundAction;
+     
+    /**
+     * Widget currently focussed.
+     */
+    QGraphicsWidget* mFocusedWidget;
+    
+    /**
+     * Min height of foucssed widget.
+     */
+    qreal mMinHeight;
+    
+    /**
+     * Max height of focussed widget.
+     */
+    qreal mMaxHeight;
+	
+#ifdef UNIEDITOR_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgUnifiedEditorView;
+#endif
+	
     };
 
 #endif //MSG_UNIFIED_EDITOR_VIEW_H
--- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css	Tue Oct 19 11:30:16 2010 +0530
@@ -16,48 +16,6 @@
 	layout: layout-landscape-image;
 }
 
-/**************************** Text field margin ******************************/
-MsgUnifiedEditorBody::textEdit:portrait {
-    left: -var(hb-param-margin-gene-left);
-    right: var(hb-param-margin-gene-right);
-}
-
-MsgUnifiedEditorBody[hasImage="true"][hasAudio="true"]::textEdit:portrait {
-    top: -var(hb-param-margin-gene-middle-vertical);
-}
-
-MsgUnifiedEditorBody[hasImage="true"][hasAudio="false"]::textEdit:portrait {
-    top: -var(hb-param-margin-gene-middle-vertical);
-}
-
-MsgUnifiedEditorBody[hasImage="false"][hasAudio="true"]::textEdit:portrait {
-    top: -var(hb-param-margin-gene-middle-vertical);
-}
-
-MsgUnifiedEditorBody[hasImage="false"][hasAudio="false"]::textEdit:portrait {
-    top: 0.0un;
-}
-
-MsgUnifiedEditorBody::textEdit:landscape {
-    right: var(hb-param-margin-gene-right);
-}
-
-MsgUnifiedEditorBody[hasImage="true"]::textEdit:landscape {
-    left: -1.0un;
-}
-
-MsgUnifiedEditorBody[hasImage="false"]::textEdit:landscape {
-    left: -var(hb-param-margin-gene-left);
-}
-
-MsgUnifiedEditorBody[hasAudio="true"]::textEdit:landscape {
-    top: -var(hb-param-margin-gene-middle-vertical);
-}
-
-MsgUnifiedEditorBody[hasAudio="false"]::textEdit:landscape {
-    top: 0.0un;
-}
-
 /*************************** Image field margin ******************************/
 MsgUnifiedEditorBody::pixmap {
     left: -var(hb-param-margin-gene-left);
@@ -68,7 +26,7 @@
 }
 
 MsgUnifiedEditorBody::pixmap:landscape {
-    right: 1.0un;
+    right: var(hb-param-margin-gene-right);
 }
 
 MsgUnifiedEditorBody[hasAudio="true"]::pixmap {
@@ -86,19 +44,3 @@
     right: var(hb-param-margin-gene-right);
 }
 
-/*************************** Character Counter ******************************/
-
-MsgUnifiedEditorBody::charCounter
-{
-    text-height:var(hb-param-text-height-tiny);
-    text-align:centre;
-    text-line-count-min: 1;
-    text-line-count-max: 1;
-}
-
-MsgUnifiedEditorBody::charCounterFrame
-{
-    size-policy: fixed, fixed ;
-    pref-height: expr(var(hb-param-text-height-tiny)+2*var(hb-param-margin-gene-middle-vertical));
-    pref-width: expr(var(hb-param-text-height-tiny)*3 + 2*var(hb-param-margin-gene-middle-horizontal));
-}
--- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml	Tue Oct 19 11:30:16 2010 +0530
@@ -7,19 +7,8 @@
      <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
      
      <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
-     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT"  />  
-     <meshitem src="pixmap" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />  
-     
-     <meshitem src="textEdit" srcEdge="TOP" dst="pixmap" dstEdge="BOTTOM" />
-     <meshitem src="textEdit" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-     <meshitem src="textEdit" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-     <meshitem src="textEdit" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-           
-     <meshitem src="charCounter" srcEdge="CENTERH" dst="charCounterFrame" dstEdge="CENTERH" />
-     <meshitem src="charCounter" srcEdge="CENTERV" dst="charCounterFrame" dstEdge="CENTERV" />
-
-     <meshitem src="charCounterFrame" srcEdge="TOP" dst="textEdit" dstEdge="TOP" />
-     <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
+     <meshitem src="pixmap" srcEdge="CENTERH" dst="" dstEdge="CENTERH"  />  
+     <meshitem src="pixmap" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  />    
      
   </layout>
   
@@ -28,18 +17,8 @@
      <meshitem src="audioItem" srcEdge="TOP" dst="" dstEdge="TOP"  />
      <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
      <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
-
-     <meshitem src="textEdit" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM" />
-     <meshitem src="textEdit" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-     <meshitem src="textEdit" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-     <meshitem src="textEdit" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-     
-     <meshitem src="charCounter" srcEdge="CENTERH" dst="charCounterFrame" dstEdge="CENTERH" />
-     <meshitem src="charCounter" srcEdge="CENTERV" dst="charCounterFrame" dstEdge="CENTERV" />
-
-     <meshitem src="charCounterFrame" srcEdge="TOP" dst="textEdit" dstEdge="TOP" />
-     <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
-  
+     <meshitem src="audioItem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  />
+ 
   </layout>
   
   <layout name="layout-landscape-image" type="mesh">     
@@ -47,21 +26,10 @@
      <meshitem src="audioItem" srcEdge="TOP" dst="" dstEdge="TOP"  />
      <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
      <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
-
-     <meshitem src="textEdit" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM" />
-     <meshitem src="textEdit" srcEdge="LEFT" dst="" dstEdge="CENTERH" />
-     <meshitem src="textEdit" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-     <meshitem src="textEdit" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
      
-     <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />    
-     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-     <meshitem src="pixmap" srcEdge="RIGHT" dst="textEdit" dstEdge="LEFT" />
-
-     <meshitem src="charCounter" srcEdge="CENTERH" dst="charCounterFrame" dstEdge="CENTERH" />
-     <meshitem src="charCounter" srcEdge="CENTERV" dst="charCounterFrame" dstEdge="CENTERV" />
-
-     <meshitem src="charCounterFrame" srcEdge="TOP" dst="textEdit" dstEdge="TOP" />
-     <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
+     <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
+     <meshitem src="pixmap" srcEdge="CENTERH" dst="" dstEdge="CENTERH"  />  
+     <meshitem src="pixmap" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  /> 
 
   </layout>
   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbodyeditor.css	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,49 @@
+MsgUnifiedEditorBodyEditor
+{
+  layout:layout-msg-editor;
+}
+
+MsgUnifiedEditorBodyEditor::msgEditor
+{
+  left: -var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  bottom:var(hb-param-margin-gene-middle-vertical);
+  top:-var(hb-param-margin-gene-middle-vertical); 
+  min-height:7.46un;
+}
+
+MsgUnifiedEditorBodyEditor::msgEditor:portrait
+{
+   max-height: expr(var(hb-param-screen-long-edge)/4);
+}
+
+MsgUnifiedEditorBodyEditor::msgEditor:landscape
+{
+    max-height: expr(var(hb-param-screen-short-edge)/3);
+}
+
+MsgUnifiedEditorBodyEditor::sendButton
+{
+  top:-var(hb-param-margin-gene-middle-vertical);
+  right: var(hb-param-margin-gene-right);
+  bottom:var(hb-param-margin-gene-middle-vertical);
+  fixed-width: 9.34un;
+  fixed-height: 7.46un;
+}
+
+MsgUnifiedEditorBodyEditor::charCounter
+{
+    text-height:var(hb-param-text-height-tiny);
+    text-align:centre;
+    text-line-count-min: 1;
+    text-line-count-max: 1;
+}
+
+MsgUnifiedEditorBodyEditor::charCounterFrame
+{
+    right:var(hb-param-margin-gene-middle-horizontal);
+    top:-var(hb-param-margin-gene-middle-vertical); 
+    size-policy: fixed, fixed ;
+    pref-height: expr(var(hb-param-text-height-tiny)+2*var(hb-param-margin-gene-middle-vertical));
+    pref-width: expr(var(hb-param-text-height-tiny)*3 + 2*var(hb-param-margin-gene-middle-horizontal));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbodyeditor.widgetml	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,19 @@
+<hbwidget version="0.1">
+  <layout name="layout-msg-editor" type="mesh">
+
+    <meshitem src="msgEditor" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="msgEditor" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="msgEditor" srcEdge="RIGHT" dst="sendButton" dstEdge="LEFT" />
+    <meshitem src="msgEditor" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    
+    <meshitem src="sendButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    <meshitem src="sendButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    
+    <meshitem src="charCounter" srcEdge="CENTERH" dst="charCounterFrame" dstEdge="CENTERH" />
+    <meshitem src="charCounter" srcEdge="CENTERV" dst="charCounterFrame" dstEdge="CENTERV" />
+
+    <meshitem src="charCounterFrame" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    
+  </layout>
+</hbwidget>
\ No newline at end of file
--- a/messagingapp/msgui/unifiededitor/resources/qtg_anim_loading.axml	Tue Oct 05 13:58:47 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<animations>
-<icon name="qtg_anim_loading" frame_duration="50" playmode="loop">
-<frame>qtg_anim_loading_1</frame>
-<frame>qtg_anim_loading_2</frame>
-<frame>qtg_anim_loading_3</frame>
-<frame>qtg_anim_loading_4</frame>
-<frame>qtg_anim_loading_5</frame>
-<frame>qtg_anim_loading_6</frame>
-<frame>qtg_anim_loading_7</frame>
-<frame>qtg_anim_loading_8</frame>
-<frame>qtg_anim_loading_9</frame>
-<frame>qtg_anim_loading_10</frame>
-</icon>
-</animations>
--- a/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -63,7 +63,8 @@
 mSkipMaxRecipientQuery(false),
 mAboutToExceedMaxSmsRecipients(false),
 mAboutToExceedMaxMmsRecipients(false),
-mExceedsMaxMmsRecipientsBy(0)
+mExceedsMaxMmsRecipientsBy(0),
+mAddressCount(0)
 {
     this->setContentsMargins(0,0,0,0);
 
@@ -75,8 +76,6 @@
 
     mAddressEdit = new MsgUnifiedEditorLineEdit(label,this);
     HbStyle::setItemName(mAddressEdit,"addressField");
-
-    mAddressEdit->setMaxRows(40);
     connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)),
             this, SLOT(onContentsChanged(const QString&)));
 
@@ -89,9 +88,6 @@
 
 MsgUnifiedEditorAddress::~MsgUnifiedEditorAddress()
 {
-	//TODO: Should remove this code depending on orbit's reply whether it is needed
-	//to unregister the same plugin registered on two different widgets twice.
-    //style()->unregisterPlugin(mPluginPath);
 }
 
 void MsgUnifiedEditorAddress::fetchContacts()
@@ -330,6 +326,9 @@
 
 void MsgUnifiedEditorAddress::onContentsChanged(const QString& text)
 {
+
+    emitContentsChanged();
+    
     // Max MMS recipient count check
     if( mAboutToExceedMaxMmsRecipients ||
         (MsgUnifiedEditorMonitor::msgAddressCount() >= MsgUnifiedEditorMonitor::maxMmsRecipients()) )
@@ -345,20 +344,18 @@
         }
         else
         {
-            // update monitor data
-            emit contentChanged();
             if(MsgUnifiedEditorMonitor::msgAddressCount() > MsgUnifiedEditorMonitor::maxMmsRecipients())
             {
                 HbMessageBox::information(LOC_MMS_RECIPIENT_LIMIT_REACHED, 0, 0, HbMessageBox::Ok);
                 resetToPrevious();
-                // reset monitor data
-                emit contentChanged();
             }
             else
             {
                 mPrevBuffer = text;
             }
         }
+        
+        emitContentsChanged();
         return;
     }
 
@@ -379,8 +376,8 @@
         {// remember addresses before the block insertion started
             mPrevBuffer = text;
         }
-        emit contentChanged();
     }
+    emitContentsChanged();
 }
 
 void MsgUnifiedEditorAddress::handleRecipientLimitReached()
@@ -529,14 +526,15 @@
 {
     HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender());
     if (action == dlg->actions().at(0)) {
-        // accept new content, update prev-buffer
-        emit contentChanged();
         mPrevBuffer = mAddressEdit->content();
     }
     else {
         // reject the new content, keep the old
         resetToPrevious();
     }
+    
+    emitContentsChanged();
+    
 }
 
 // ----------------------------------------------------------------------------
@@ -593,6 +591,36 @@
     mLaunchBtn->blockSignals(false);
 }
 
+void  MsgUnifiedEditorAddress::emitContentsChanged()
+{
+    int currentAddressCount = addressCount();
+    bool hasEmail = hasValidEmailAddress();
+    
+    if(mAddressCount != currentAddressCount || hasEmail)
+    {
+        mAddressCount = currentAddressCount;       
+        QVariantList data;
+        data << mAddressCount << hasEmail;
+        emit contentsChanged(data);
+    }
+}
+
+bool MsgUnifiedEditorAddress::hasValidEmailAddress()
+{
+    bool result = false;
+    QStringList addressList = mAddressEdit->addresses();
+    QRegExp emailExp("\\S+@\\S+");
+    int i = addressList.indexOf(emailExp);//getting item index having @ symbol.
+    
+    //check if index is valid.
+    if(i >= 0 )
+    {
+        result = true;
+    }
+        
+    return result;
+}
+
 Q_IMPLEMENT_USER_METATYPE(CntServicesContact)
 Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList)
 
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorattachmentcontainer.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorattachmentcontainer.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -35,13 +35,15 @@
 // @see header file
 //---------------------------------------------------------------
 MsgAttachmentContainer::MsgAttachmentContainer( QGraphicsItem *parent ) :
-HbWidget(parent),
+MsgUnifiedEditorBaseWidget(parent),
 mIsMMContent(false)
 {
+    this->setObjectName("attachmentContainer");
+    
     mLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
     mLayout->setContentsMargins(0,0,0,0);
     mLayout->setSpacing(0);
-    mMmsConformanceCheck = new MmsConformanceCheck;
+    mMmsConformanceCheck = new MmsConformanceCheck;   
 }
 
 //---------------------------------------------------------------
@@ -64,7 +66,8 @@
     if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(filepath))
         return EAddNotSupported;
 
-    int msgSize = messageSize();
+    int msgSize = MsgUnifiedEditorMonitor::messageSize();
+    
     QFileInfo fileinfo(filepath);
     int fileSize = fileinfo.size() + KEstimatedMimeHeaderSize;
     
@@ -81,10 +84,12 @@
         int index = mLayout->count();
         mLayout->insertItem(index,att);
         connect(att, SIGNAL(deleteMe(MsgUnifiedEditorAttachment*)),
-            this, SLOT(deleteAttachment(MsgUnifiedEditorAttachment*)));
+                this, SLOT(deleteAttachment(MsgUnifiedEditorAttachment*)));
 
         // emit to signal that container content & size changed
-        emit contentChanged();
+        QVariantList data;
+        data << containerSize() << mIsMMContent;        
+        emit contentsChanged(data);
     }
     else
     {
@@ -111,7 +116,10 @@
     }
 
     // emit to indicate change in container content & size
-    emit contentChanged();
+    QVariantList data;
+    data << containerSize() << mIsMMContent;
+    emit contentsChanged(data);
+    
     if(mAttachmentList.count() == 0)
     {
         emit emptyAttachmentContainer();
@@ -153,15 +161,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgAttachmentContainer::messageSize
-// @see header file
-//---------------------------------------------------------------
-int MsgAttachmentContainer::messageSize()
-{
-    return containerSize() + MsgUnifiedEditorMonitor::bodySize() + MsgUnifiedEditorMonitor::subjectSize();
-}
-
-//---------------------------------------------------------------
 // MsgAttachmentContainer::hasMMContent
 // @see header file
 //---------------------------------------------------------------
@@ -170,5 +169,26 @@
     return mIsMMContent;
 }
 
+//---------------------------------------------------------------
+// MsgAttachmentContainer::fileNameInUse
+// @see header file
+//---------------------------------------------------------------
+bool MsgAttachmentContainer::fileNameInUse(const QString& fileName)
+{
+    bool alreadyExists = false;
+    
+    for(int i=0; i<mAttachmentList.count(); i++)
+    {
+        QFileInfo fileinfo(mAttachmentList.at(i)->path());
+        if(fileName == fileinfo.fileName())
+        {
+            alreadyExists = true;
+            break;
+        }
+    } 
+    
+    return alreadyExists;
+}
+
 //EOF
 
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -16,12 +16,8 @@
  */
 
 // INCLUDES
-#include <HbTextEdit>
 #include <HbTextItem>
-#include <HbFrameItem>
-#include <HbFrameDrawer>
 #include <HbIconItem>
-#include <HbAction>
 #include <HbMainWindow>
 #include <HbDeviceProfile>
 #include <QImageReader>
@@ -30,51 +26,36 @@
 #include <MsgImageInfo.h>
 #include <HbIconAnimationManager>
 #include <HbIconAnimator>
-#include <HbIcon>
 #include <QGraphicsLinearLayout>
 #include <HbNotificationDialog>
 
-#include <csmsaccount.h>
-#include <smutset.h>
 #include <xqaiwrequest.h>
 #include <xqrequestinfo.h>
 #include <xqsharablefile.h>
 #include <xqappmgr.h>
 #include <xqconversions.h>
 #include <hbmessagebox.h>
-#include <hbcolorscheme.h>
-#include <QColor>
+
 // USER INCLUDES
 #include "msgunieditorbody.h"
 #include "UniEditorGenUtils.h"
-#include "UniSendingSettings.h"
 #include "msgunieditormonitor.h"
 
 #include "mmsconformancecheck.h"
-#include "unieditorpluginloader.h"
-#include "unieditorplugininterface.h"
-#include "convergedmessage.h"
-#include "msgmediautil.h"
 #include "msgunieditorpixmapwidget.h"
 #include "msgunieditoraudiowidget.h"
+#include "msgunieditorview.h"
 
 // Constants
-const QString BACKGROUND_FRAME("qtg_fr_messaging_char_count");
-const QString CHAR_COUNTER_COLOR("qtc_messaging_char_count");
-
-const int KShowCounterLimit = 10;
 const int BYTES_TO_KBYTES_FACTOR = 1024; 
 
 //Localized Constants for item specific menu
-#define LOC_TITLE   hbTrId("txt_messaging_title_messaging")
-#define LOC_UNABLE_TO_ADD_CONTENT hbTrId("txt_messaging_dpopinfo_unable_to_add_more_content")
 #define LOC_UNABLE_TO_ATTACH_ITEM hbTrId("txt_messaging_dpopinfo_unable_to_attach_item_avai")
 #define LOC_PROCESSING hbTrId("txt_messaging_formlabel_loading")
-#define LOC_HINT_TEXT hbTrId("txt_messaging_formlabel_enter_message_here")
 #define LOC_ATTACHED_PHOTO_SIZE hbTrId("txt_messaging_dpopinfo_attached_photo_size_is_l1")
 
 const QString ANIMATION_ICON("qtg_anim_loading");
-const QString ANIMATION_FILE(":/qtg_anim_loading.axml");
+const QString ANIMATION_FILE("qtg_anim_loading.axml");
 // LOCAL FUNCTIONS
 
 //---------------------------------------------------------------
@@ -84,10 +65,10 @@
 void showInsertFailureNote()
 {
     int availableSize =
-            (MsgUnifiedEditorMonitor::maxMmsSize() - MsgUnifiedEditorMonitor::messageSize())
-            /BYTES_TO_KBYTES_FACTOR;
+        (MsgUnifiedEditorMonitor::maxMmsSize() - MsgUnifiedEditorMonitor::messageSize())
+        /BYTES_TO_KBYTES_FACTOR;
     QString displayStr = QString(LOC_UNABLE_TO_ATTACH_ITEM)
-            .arg(availableSize);
+                .arg(availableSize);
 
     HbMessageBox::information(displayStr, 0, 0, HbMessageBox::Ok);
 }
@@ -97,67 +78,18 @@
 MsgUnifiedEditorBaseWidget(parent),
 mHasImage(false),
 mHasAudio(false),
-mTextEdit(0),
 mPixmapItem(0),
 mAudioItem(0),
 mImageSize(0),
 mAudioSize(0),
-mVideoSize(0),
 mProcessImageOperation(0),
 mMediaResolver(0),
 mImageInfo(0),
 mProcessingWidget(0),
-mDraftMessage(false),
-mIsImageResizing(false)
+mDraftMessage(false)
 {
-    mTextEdit = new HbTextEdit(this);
-    mTextEdit->setPlaceholderText(LOC_HINT_TEXT);
-    mTextEdit->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
-    HbStyle::setItemName(mTextEdit,"textEdit");
-    connect(mTextEdit, SIGNAL(contentsChanged()), this, SLOT(onTextChanged()));
-
-    mMmsConformanceCheck = new MmsConformanceCheck;
-    
-    mCharCounter = new HbTextItem(this);
-    HbStyle::setItemName(mCharCounter, "charCounter");
-    mCharCounter->setZValue(1.5);
-
-    QColor color = HbColorScheme::color(CHAR_COUNTER_COLOR);
-    mCharCounter->setTextColor(color);
-
-    mBackgroundItem = new HbFrameItem(this);
-    HbStyle::setItemName(mBackgroundItem, "charCounterFrame");
-
-    mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
-    mBackgroundItem->frameDrawer().setFillWholeRect(true);
-    
-    mBackgroundItem->frameDrawer().setFrameGraphicsName(BACKGROUND_FRAME);
-    
-    mPluginLoader = new UniEditorPluginLoader(this);
-
-    mPluginInterface =
-                        mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);    
-    
-    TRAP_IGNORE(
-    CSmsSettings* settings = CSmsSettings::NewLC();
-    CSmsAccount* account = CSmsAccount::NewLC();
-    account->LoadSettingsL( *settings );
-
-    if( settings->CharacterSet() == TSmsDataCodingScheme::ESmsAlphabetUCS2)
-    {
-    mCharSupportType = TUniSendingSettings::EUniCharSupportFull;
-    }
-    else
-    {
-    mCharSupportType = TUniSendingSettings::EUniCharSupportReduced;
-    }
-    
-    CleanupStack::PopAndDestroy( account );
-    CleanupStack::PopAndDestroy( settings );                
-    );
-
-    mCharCounter->setVisible(false);
-    mBackgroundItem->setVisible(false);
+    this->setObjectName("body");
+    mMmsConformanceCheck = new MmsConformanceCheck;    
 }
 
 MsgUnifiedEditorBody::~MsgUnifiedEditorBody()
@@ -168,18 +100,17 @@
     delete mImageInfo;
 }
 
-QString MsgUnifiedEditorBody::text()
-{
-    return mTextEdit->toPlainText();
-}
-
-void MsgUnifiedEditorBody::setImage(QString& imagefile, bool draftMessage)
+void MsgUnifiedEditorBody::setImage(const QString& imagefile, bool draftMessage)
     {
-    // do nothing if filepath is empty
+    
+   // do nothing if filepath is empty
     if (imagefile.isEmpty())
         {
         return;
         }
+    
+    //disable image option in menu.
+    emit enableMenuAction(PHOTO,false);
 
     mDraftMessage = draftMessage;
     if (!mImageInfo)
@@ -233,7 +164,10 @@
             {
             mSavedImageFile = imagefile;
             startResizeAnimation();
-            mIsImageResizing = true;
+            
+            // image resize is started. set the image resize flag.
+            emit contentsChanged(true);
+            
             mProcessImageOperation->Process(mImageInfo);
             }
         else
@@ -254,9 +188,13 @@
 {   
     //check for insert conformance
     if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(mImageFile))
+    {
+        //enable image option in menu as insertion failed.
+        emit enableMenuAction(PHOTO,true);
         return;
+    }
     
-    int msgSize = messageSize();
+    int msgSize = MsgUnifiedEditorMonitor::messageSize();
     QFileInfo fileinfo(mImageFile);
     int imageSize = fileinfo.size() + KEstimatedMimeHeaderSize;
     if ( (imageSize + msgSize) <= MsgUnifiedEditorMonitor::maxMmsSize())
@@ -269,6 +207,10 @@
         setImage(false);
         //Show appropriate note and leave
         showInsertFailureNote();
+        
+        //enable image option in menu as insertion failed.
+        emit enableMenuAction(PHOTO,true);
+        
         return;
     }
 
@@ -283,10 +225,10 @@
     this->repolish();
 
     // emit signal to indicate addition of image
-    emit contentChanged();
+    emit contentsChanged(bodySize());    
 }
 
-void MsgUnifiedEditorBody::setAudio(QString& audiofile)
+void MsgUnifiedEditorBody::setAudio(const QString& audiofile)
 {
     // do nothing if filepath is empty
     if(audiofile.isEmpty())
@@ -308,7 +250,7 @@
         mAudioSize = 0;
     }
 
-    int msgSize = messageSize();
+    int msgSize = MsgUnifiedEditorMonitor::messageSize();
     QFileInfo fileinfo(mAudioFile);
     int audioSize = fileinfo.size() + KEstimatedMimeHeaderSize;
     if((audioSize + msgSize) <= MsgUnifiedEditorMonitor::maxMmsSize() )
@@ -334,15 +276,10 @@
     this->repolish();
 
     // emit signal to indicate addition of audio
-    emit contentChanged();
-}
-
-void MsgUnifiedEditorBody::setText(QString& text)
-{
-    if(!text.isEmpty())
-    {    
-        mTextEdit->setPlainText(text);
-    }
+    emit contentsChanged(bodySize());
+    
+    //disable sound option in menu.
+    emit enableMenuAction(SOUND,false);
 }
 
 const QStringList MsgUnifiedEditorBody::mediaContent()
@@ -383,23 +320,10 @@
     HbDeviceProfile prf = HbDeviceProfile::profile(mMainWindow);
     qreal unt = prf.unitValue();
 
-    // Note: With NGA, the orientation change does not cause HW to switch orientation.
-    // So, the HW resolution also remains unchanged. We need to swap values of width &
-    // height to map portrait resolution to landscape resolution.
-    qreal maxWidth = 0.0, maxHeight = 0.0;
-    
-    // Landscape
-    if(mMainWindow->orientation() == Qt::Horizontal)
-        {
-        maxHeight = mMainWindow->width()-chromeHeight-toolbarHeight;
-        maxWidth = (mMainWindow->height()-leftMargin-rightMargin-(2*unt))/2;
-        }
-    else
-    {
-        maxWidth = mMainWindow->width()-leftMargin-rightMargin;
-        maxHeight = mMainWindow->height()-chromeHeight-toolbarHeight;
-    }
-    szHint.setHeight(maxHeight);
+    qreal maxWidth = mMainWindow->width()-leftMargin-rightMargin;
+    qreal maxHeight = mMainWindow->height()-chromeHeight-toolbarHeight;
+
+    szHint.setHeight(0);
     
     // add space for audio
     if(mAudioItem)
@@ -455,12 +379,6 @@
             {
             mPixmapItem->setPreferredSize(imageSize);
             mPixmapItem->setSize(imageSize);
-            if(mMainWindow->orientation() == Qt::Horizontal)
-            {
-                QPointF currPos = mPixmapItem->pos();
-                currPos.setX(leftMargin+((maxWidth-imageSize.width())/2));
-                mPixmapItem->setPos(currPos);
-            }
             mPixmapItem->show();
             }
             
@@ -474,8 +392,6 @@
         }
     }
     
-
-    mTextEdit->setMinimumHeight(maxHeight);
     szHint.rheight() += bodyItemSpacing;
     return szHint;
 }
@@ -501,6 +417,10 @@
         }
         setImage(false);
         mImageSize = 0;
+        
+        //enable photo option in menu.
+        emit enableMenuAction(PHOTO,true);
+        
     }
     else if(audio)//remove audio item
         {
@@ -513,11 +433,14 @@
             }
             setAudio(false);
             mAudioSize = 0;
+            
+            //enable sound option in menu.
+            emit enableMenuAction(SOUND,true);
         }
 
     this->repolish();
 
-	emit contentChanged();
+	emit contentsChanged(bodySize());
 }
 
 bool MsgUnifiedEditorBody::hasImage()
@@ -542,109 +465,14 @@
 
 int MsgUnifiedEditorBody::bodySize()
 {
-	int bodysize = 0;
-	
-	if( mImageSize || mTextEdit->toPlainText().size() || 
-	    mAudioSize || mVideoSize )
-	{
-	     
-	    UniEditorGenUtils* genUtils = q_check_ptr(new UniEditorGenUtils);
-	    
-        bodysize +=  mImageSize + mAudioSize + mVideoSize +
-            genUtils->UTF8Size(mTextEdit->toPlainText()) +
-            KEstimatedMimeHeaderSize + KEstimatedMmsSmilHeaderSize;
-        delete genUtils;
-	}
-	return bodysize;
-}
-
-int MsgUnifiedEditorBody::messageSize()
-{
-    int estimatedMediaSize = bodySize();
-    if(!estimatedMediaSize)
-    {
-        // This is the first media content to be inserted
-        estimatedMediaSize = KEstimatedMmsSmilHeaderSize;
-    }
-    
-    return estimatedMediaSize + MsgUnifiedEditorMonitor::subjectSize() + MsgUnifiedEditorMonitor::containerSize();
-}
-
-void MsgUnifiedEditorBody::onTextChanged()
-{   
-    QString string = text();
-
-    if( string.size() > mPrevBuffer.size() &&
-        MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms )
-    {
-        // reject any text input if mms size limit is reached
-        int futureSize = bodySize() +
-                MsgUnifiedEditorMonitor::containerSize() + MsgUnifiedEditorMonitor::subjectSize();
-        if(futureSize > MsgUnifiedEditorMonitor::maxMmsSize())
-        {
-            mTextEdit->setPlainText(mPrevBuffer);
-            HbMessageBox::information(LOC_UNABLE_TO_ADD_CONTENT, 0, 0, HbMessageBox::Ok);
-            mTextEdit->setCursorPosition(mPrevBuffer.length());
-            return;
-        }
-        else if(!mPrevBuffer.isEmpty())
-        {
-            //Save the previous buffer
-            mPrevBuffer = string;
-            // emit signal to indicate change in content
-            emit contentChanged();
-            return;
-        }
-    }
-
-    //Check done for optimization
-    //Only if content is deleted we need to call encodingsettings again
-    if (mPrevBuffer.isEmpty() || string.size() <= mPrevBuffer.size())
-    {
-        mPluginInterface->setEncodingSettings(EFalse, ESmsEncodingNone,
-            mCharSupportType);
-    }
-
-    TInt numOfRemainingChars;
-    TInt numOfPDUs;
-    TBool unicodeMode;
-    TSmsEncoding alternativeEncodingType;
-    mPluginInterface->getNumPDUs(string, numOfRemainingChars, numOfPDUs,
-        unicodeMode, alternativeEncodingType);
-
-    //Save the unicode value returned
-    mUnicode = unicodeMode;
-    //Save the old buffer
-    mPrevBuffer = string;
-    
-    // emit signal to indicate change in content
-    emit contentChanged();
-    
-    if(MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Sms)
-    {
-        //Set char counter value
-        QString display = QString("%1(%2)").arg(numOfRemainingChars).arg(
-            numOfPDUs);
-        mCharCounter->setText(display);
-        
-        if (numOfPDUs > 1 || numOfRemainingChars <= KShowCounterLimit)
-        {
-            mCharCounter->setVisible(true);
-            mBackgroundItem->setVisible(true);
-        }
-        else
-        {
-            mCharCounter->setVisible(false);
-            mBackgroundItem->setVisible(false);
-        }
-    }
+    return mImageSize + mAudioSize;
 }
 
 void MsgUnifiedEditorBody::EditorOperationEvent(
     TUniEditorProcessImageOperationEvent aEvent, TFileName& aFileName)
 {
     delete mImageInfo;
-    mImageInfo = NULL; 
+    mImageInfo = NULL;
 
     if (aEvent == EUniEditorProcessImageOperationComplete && 
             aFileName.Length() > 0)
@@ -662,7 +490,8 @@
     mSavedImageFile.clear();
 
    // image resize is complete. reset the image resize flag
-    mIsImageResizing = false;
+    emit contentsChanged(false);
+    
     //handle the processed image from ProcessImage Operation
     handleSetImage();
     
@@ -671,10 +500,6 @@
 
 void MsgUnifiedEditorBody::startResizeAnimation()
 {
-    // emit signal to indicate disable the send tool button.
-    emit enableSendButton(false);
-    
-	
     QGraphicsLinearLayout* processingLayout = new QGraphicsLinearLayout(Qt::Vertical);
     
     mProcessingWidget = new HbWidget(this);
@@ -710,73 +535,6 @@
 	
 }
 
-// ---------------------------------------------------------
-// MsgUnifiedEditorBody::isUnicode
-// ---------------------------------------------------------
-//
-bool MsgUnifiedEditorBody::isUnicode()
-{
-    return mUnicode;
-}
-
-// ---------------------------------------------------------
-// MsgUnifiedEditorBody::disableCharCounter
-// ---------------------------------------------------------
-//
-void MsgUnifiedEditorBody::disableCharCounter()
-{
-    mCharCounter->setVisible(false);
-    mBackgroundItem->setVisible(false);
-}
-
-// ---------------------------------------------------------
-// MsgUnifiedEditorBody::enableCharCounter
-// ---------------------------------------------------------
-//
-void MsgUnifiedEditorBody::enableCharCounter()
-    {
-    mPluginInterface->setEncodingSettings(EFalse, ESmsEncodingNone,
-            mCharSupportType);
-
-    TInt numOfRemainingChars;
-    TInt numOfPDUs;
-    TBool unicodeMode;
-    TSmsEncoding alternativeEncodingType;
-    QString string = mTextEdit->toPlainText();
-    mPluginInterface->getNumPDUs(string,
-            numOfRemainingChars, numOfPDUs, unicodeMode,
-            alternativeEncodingType);
-
-    //Save the unicode value returned
-    mUnicode = unicodeMode;
-
-    //Set char counter value
-    QString display = QString("%1(%2)").arg(numOfRemainingChars).arg(
-            numOfPDUs);
-    mCharCounter->setText(display);
-
-    if (numOfPDUs > 1 || numOfRemainingChars <= KShowCounterLimit)
-        {
-        mCharCounter->setVisible(true);
-        mBackgroundItem->setVisible(true);
-        }
-    else
-        {
-        mCharCounter->setVisible(false);
-        mBackgroundItem->setVisible(false);
-        }
-
-    }
-
-//---------------------------------------------------------------
-// MsgUnifiedEditorBody :: setFocus
-// @see header file
-//---------------------------------------------------------------
-void MsgUnifiedEditorBody::setFocus()
-{
-    mTextEdit->setFocus(Qt::MouseFocusReason);
-}
-
 //---------------------------------------------------------------
 // MsgUnifiedEditorBody :: removeMediaContent
 // @see header file
@@ -810,6 +568,6 @@
 
     this->repolish();
 
-    emit contentChanged();
+    emit contentsChanged(bodySize());
 }
 // EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbodyeditor.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "msgunieditorbodyeditor.h"
+
+// SYSTEM INCLUDES
+#include <HbStyle>
+#include <HbPushButton>
+#include <HbTextItem>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
+#include <csmsaccount.h>
+#include <smutset.h>
+#include <hbmessagebox.h>
+#include <hbcolorscheme.h>
+#include <QColor>
+
+#include "unieditorpluginloader.h"
+#include "unieditorplugininterface.h"
+#include "UniSendingSettings.h"
+#include "UniEditorGenUtils.h"
+#include "msgunieditormonitor.h"
+#include "debugtraces.h"
+
+// LOCAL CONSTANTS
+
+const QString SEND_ICON("qtg_mono_send");
+const QString BACKGROUND("qtg_fr_input_v_bg");
+const QString BACKGROUND_FRAME("qtg_fr_messaging_char_count");
+const QString CHAR_COUNTER_COLOR("qtc_messaging_char_count");
+
+const QString SEND_BUTTON_NORMAL("qtg_fr_btn_green_normal");
+const QString SEND_BUTTON_PRESSED("qtg_fr_btn_green_pressed");
+const QString SEND_BUTTON_DISABLED("qtg_fr_btn_disabled");
+
+const QString SEND_BUTTON_NORMAL_COLOR("qtc_callhandling_answer_normal");
+const QString SEND_BUTTON_PRESSED_COLOR("qtc_callhandling_answer_pressed");
+const QString SEND_BUTTON_DISABLED_COLOR("qtc_button_disabled");
+
+#define LOC_SMS_CHAR_LIMIT_REACHED hbTrId("txt_messaging_dialog_sms_character_count_exceeded")
+#define LOC_HINT_TEXT hbTrId("txt_messaging_formlabel_enter_message_here")
+#define LOC_UNABLE_TO_ADD_CONTENT hbTrId("txt_messaging_dpopinfo_unable_to_add_more_content")
+
+  
+const TInt KShowCounterLimit = 10;
+
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::MsgUnifiedEditorBodyEditor
+// @see header
+//---------------------------------------------------------------
+MsgUnifiedEditorBodyEditor::MsgUnifiedEditorBodyEditor(QGraphicsItem *parent) :
+MsgUnifiedEditorBaseWidget(parent),
+mMsgEditor(NULL),
+mSendButton(NULL),
+mPluginLoader(NULL)
+{
+    this->setObjectName("bodyText");
+    
+    setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
+    
+    //setting background.
+    HbFrameItem* backGround = new HbFrameItem(this);
+    backGround->frameDrawer().setFrameGraphicsName(BACKGROUND);
+    backGround->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
+    backGround->frameDrawer().setFillWholeRect(true);
+    //fixing to 2 pixel to avoid extra line on top of frame.
+    backGround->frameDrawer().setBorderWidth(2);
+    this->setBackgroundItem(backGround); 
+
+    // Initialize the widget.
+    init();
+    
+    setEncodingSettingsL();
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::init
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::init()
+{
+    // Create mandatory element of mesh layout.
+    mMsgEditor = new MsgEditor(this);
+    HbStyle::setItemName(mMsgEditor, "msgEditor");
+
+	mSendButton = new HbPushButton(this); 
+    HbStyle::setItemName(mSendButton, "sendButton"); 
+    mSendButton->setEnabled(false); 
+    
+    HbFrameItem* backGround = new HbFrameItem(this); 
+    backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); 
+    mSendButton->setBackgroundItem(backGround); 
+    updateButtonBackgroundAndColor(SEND_BUTTON_DISABLED,SEND_BUTTON_DISABLED_COLOR); 
+    mSendButton->setIcon(HbIcon(SEND_ICON));
+    
+    mCharCounter = new HbTextItem(this);
+    HbStyle::setItemName(mCharCounter, "charCounter");
+    mCharCounter->setZValue(1.5);
+    
+    QColor color = HbColorScheme::color(CHAR_COUNTER_COLOR);
+    mCharCounter->setTextColor(color);
+    
+    mBackgroundItem = new HbFrameItem(this);
+    HbStyle::setItemName(mBackgroundItem, "charCounterFrame");
+
+    mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
+    mBackgroundItem->frameDrawer().setFillWholeRect(true);
+    
+    mBackgroundItem->frameDrawer().setFrameGraphicsName(BACKGROUND_FRAME);    
+    
+    //Create editor utils object
+    mEditorUtils = q_check_ptr(new UniEditorGenUtils());
+
+    connect(mSendButton, SIGNAL(clicked()),this, SIGNAL(sendMessage()));
+    connect(mSendButton, SIGNAL(pressed()),this, SLOT(onPressed()));
+    connect(mSendButton, SIGNAL(released()),this, SLOT(onReleased()));
+    connect(mMsgEditor,  SIGNAL(contentsChanged()),this,SLOT(onContentsChanged()));
+    
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::~MsgUnifiedEditorBodyEditor
+// @see header
+//---------------------------------------------------------------
+MsgUnifiedEditorBodyEditor::~MsgUnifiedEditorBodyEditor()
+{
+    delete mEditorUtils;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::content
+// @see header
+//---------------------------------------------------------------
+QString MsgUnifiedEditorBodyEditor::content() const
+{
+    return mMsgEditor->toPlainText();
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::setContent
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::setContent(const QString &text)
+{
+    mMsgEditor->setPlainText(text);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::enableSendButton
+// @see header
+//---------------------------------------------------------------
+void  MsgUnifiedEditorBodyEditor::enableSendButton(bool enable)
+{
+    if(enable)
+    {
+        if(!mSendButton->isEnabled())
+        {
+            mSendButton->setFocusProxy(mMsgEditor);
+            mSendButton->setEnabled(true);
+            updateButtonBackgroundAndColor(SEND_BUTTON_NORMAL,SEND_BUTTON_NORMAL_COLOR);
+        }
+    }
+    else
+    {
+        if(mSendButton->isEnabled())
+        {
+            mSendButton->setFocusProxy(0);
+            mSendButton->setEnabled(false);
+            updateButtonBackgroundAndColor(SEND_BUTTON_DISABLED,SEND_BUTTON_DISABLED_COLOR);
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::onContentsChanged
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::onContentsChanged()
+{
+    QString text = this->content();
+   
+    mPluginInterface->setEncodingSettings(EFalse, ESmsEncodingNone,mCharSupportType);
+
+    TInt numOfRemainingChars;
+    TInt numOfPDUs;
+    TBool unicodeMode;
+    TSmsEncoding alternativeEncodingType;
+    mPluginInterface->getNumPDUs(text, numOfRemainingChars, numOfPDUs,
+                                 unicodeMode, alternativeEncodingType);
+
+    // emit signal to indicate change in content
+    int contentSize = mEditorUtils->UTF8Size(text);    
+    QVariantList dataList;
+    dataList << contentSize << unicodeMode;
+    emit contentsChanged(dataList);    
+
+    if(MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Sms)
+    {
+        //Set char counter value
+        QString display = QString("%1(%2)").arg(numOfRemainingChars).arg(
+            numOfPDUs);
+        mCharCounter->setText(display);
+
+        if (numOfPDUs > 1 || numOfRemainingChars <= KShowCounterLimit)
+        {
+            mCharCounter->setVisible(true);
+            mBackgroundItem->setVisible(true);
+        }
+        else
+        {
+            mCharCounter->setVisible(false);
+            mBackgroundItem->setVisible(false);
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::updateButtonBackgroundAndColor
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::updateButtonBackgroundAndColor(const QString& bg,const QString& iconColor) 
+{ 
+    HbFrameItem* drawer = static_cast<HbFrameItem*>(mSendButton->backgroundItem()); 
+    if(drawer) 
+    { 
+        drawer->frameDrawer().setFrameGraphicsName(bg);   
+    } 
+    QColor color = HbColorScheme::color(iconColor);
+
+    if(color.isValid())
+    {
+        mSendButton->icon().setColor(color);
+    }	    
+} 
+    
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::onPressed
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::onPressed()
+{
+    updateButtonBackgroundAndColor(SEND_BUTTON_PRESSED,SEND_BUTTON_PRESSED_COLOR);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::onReleased
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::onReleased()
+{
+    updateButtonBackgroundAndColor(SEND_BUTTON_NORMAL,SEND_BUTTON_NORMAL_COLOR);
+}
+	
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::setEncodingSettingsL
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::setEncodingSettingsL()
+{ 
+    mPluginLoader = new UniEditorPluginLoader(this);
+
+    mPluginInterface =
+        mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);    
+
+    QT_TRAP_THROWING( CSmsSettings* settings = CSmsSettings::NewLC();
+    CSmsAccount* account = CSmsAccount::NewLC();
+    account->LoadSettingsL( *settings );
+
+    if( settings->CharacterSet() == TSmsDataCodingScheme::ESmsAlphabetUCS2)
+    {
+        mCharSupportType = TUniSendingSettings::EUniCharSupportFull;
+    }
+    else
+    {
+        mCharSupportType = TUniSendingSettings::EUniCharSupportReduced;
+    }
+
+    CleanupStack::PopAndDestroy( account );
+    CleanupStack::PopAndDestroy( settings ));
+
+
+    mCharCounter->setVisible(false);
+    mBackgroundItem->setVisible(false);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::packMessage
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::packMessage(ConvergedMessage &msg)
+{
+    msg.setBodyText(mMsgEditor->toPlainText());
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBodyEditor::populateContent
+// @see header
+//---------------------------------------------------------------
+void MsgUnifiedEditorBodyEditor::populateContent(const ConvergedMessage& msg)
+{
+    QString bodyTxt = msg.bodyText();
+    mMsgEditor->setPlainText(msg.bodyText());
+}
+
+//---------------------------------------------------------------
+// MsgEditor::MsgEditor
+// @see header
+//---------------------------------------------------------------
+MsgEditor::MsgEditor(QGraphicsItem *parent) :
+HbTextEdit(parent)
+{
+    this->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
+    this->setPlaceholderText(LOC_HINT_TEXT);
+    this->setSmileysEnabled(true);
+}
+
+//---------------------------------------------------------------
+// MsgEditor::inputMethodEvent
+// @see header
+//---------------------------------------------------------------
+void MsgEditor::inputMethodEvent(QInputMethodEvent *event)
+{
+    bool showNote = false;
+    
+    if( MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms && 
+        !event->commitString().isEmpty())
+    {
+        QString str = event->commitString();
+        int comitStrSize = str.toUtf8().size();
+        
+        if(MsgUnifiedEditorMonitor::messageSize()+ comitStrSize > MsgUnifiedEditorMonitor::maxMmsSize())
+        {
+            showNote = true;  
+            // reject any text input if mms size limit is reached
+            event->setCommitString(QString());             
+        }
+    }
+    
+    HbTextEdit::inputMethodEvent(event); 
+
+    if(showNote)
+    {
+        HbMessageBox* mb = new HbMessageBox(LOC_UNABLE_TO_ADD_CONTENT,HbMessageBox::MessageTypeInformation);
+        mb->setStandardButtons(HbMessageBox::Ok);
+        mb->setAttribute(Qt::WA_DeleteOnClose);
+        mb->setFocusPolicy(Qt::NoFocus);
+        mb->show();
+    }
+}
+
+// EOF
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorlineedit.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorlineedit.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -37,7 +37,7 @@
 #define LOC_PASTE hbTrId("txt_common_menu_paste")
 
 MsgUnifiedEditorLineEdit::MsgUnifiedEditorLineEdit(const QString& label,QGraphicsItem *parent):
-HbLineEdit(parent),
+HbTextEdit(parent),
 mSelectionStart(-1),
 mSelectionEnd(-1),
 mDefaultBehaviour(false)
@@ -80,7 +80,7 @@
     //let it go in default way.
     if(mDefaultBehaviour)
     {
-        HbAbstractEdit::inputMethodEvent(event);
+        HbTextEdit::inputMethodEvent(event);
         event->accept();
         return;
     }
@@ -102,13 +102,13 @@
 
             event->setCommitString(str, event->replacementStart(), event->replacementLength());            
         }
-        else if(this->hasSelectedText())
+        else if(this->textCursor().hasSelection())
         {// all user inputs get appended at the end
             this->setCursorPosition(this->text().length());
         }
     }
     
-    HbAbstractEdit::inputMethodEvent(event);
+    HbTextEdit::inputMethodEvent(event);
     event->accept();
 }
 
@@ -120,7 +120,7 @@
     {
         if(mDefaultBehaviour)
         {
-            HbAbstractEdit::keyReleaseEvent(event);
+            HbTextEdit::keyReleaseEvent(event);
             event->accept();
             return;
         }
@@ -132,7 +132,7 @@
         this->setCursorPosition(this->text().length());
         str = replacementStr;
         QKeyEvent eve(event->type(), Qt::Key_Any, event->modifiers(), str);
-        HbAbstractEdit::keyPressEvent(&eve);
+        HbTextEdit::keyPressEvent(&eve);
         event->accept();
         return;
     }
@@ -142,7 +142,7 @@
         int pos = this->cursorPosition();
         bool pbkContact = true;
 
-        if(!this->hasSelectedText())
+        if(!this->textCursor().hasSelection())
         {
             this->setCursorPosition(pos-2);
             pbkContact = this->textCursor().charFormat().fontUnderline();
@@ -161,18 +161,18 @@
         if(pbkContact)
         {
             //if already selected delete it.
-            if(this->hasSelectedText())
+            if(this->textCursor().hasSelection())
             {
                 // deleting phbkContact is an atomic operation
                 // ensure that the signal is emitted only once
                 disconnect(this, SIGNAL(contentsChanged()), 
                         this, SLOT(onContentsChanged()));
-                HbLineEdit::keyPressEvent(event);
+                HbTextEdit::keyPressEvent(event);
                 event->accept();
                 //delete seperator (i.e."; ").
                 QKeyEvent eve(event->type(), Qt::Key_Delete, Qt::NoModifier);
-                HbLineEdit::keyPressEvent(&eve);
-                HbLineEdit::keyPressEvent(&eve);
+                HbTextEdit::keyPressEvent(&eve);
+                HbTextEdit::keyPressEvent(&eve);
                 connect(this, SIGNAL(contentsChanged()), 
                         this, SLOT(onContentsChanged()));
                 onContentsChanged();
@@ -194,15 +194,15 @@
                         this, SLOT(onContentsChanged()));
                 //delete seperator (i.e."; ").
                 QKeyEvent eve(event->type(), Qt::Key_Backspace, Qt::NoModifier);
-                HbLineEdit::keyPressEvent(&eve);
-                HbLineEdit::keyPressEvent(&eve);
+                HbTextEdit::keyPressEvent(&eve);
+                HbTextEdit::keyPressEvent(&eve);
                 connect(this, SIGNAL(contentsChanged()), 
                         this, SLOT(onContentsChanged()));
                 onContentsChanged();
             }
             else
             {
-                HbLineEdit::keyPressEvent(event);
+                HbTextEdit::keyPressEvent(event);
             }
             event->accept();
         }
@@ -213,7 +213,7 @@
 
     if (event->key() == Qt::Key_Left )
     {
-        bool selectedText = this->hasSelectedText();
+        bool selectedText = this->textCursor().hasSelection();
 
         //look ahead left.
         int pos = this->cursorPosition();
@@ -266,7 +266,7 @@
                 this->setCursorPosition(newPos+1);
             }
 
-            HbLineEdit::keyPressEvent(event);
+            HbTextEdit::keyPressEvent(event);
 
         }
         event->accept();
@@ -275,7 +275,7 @@
 
     if (event->key() == Qt::Key_Right)
     {
-        bool selectedText = this->hasSelectedText();
+        bool selectedText = this->textCursor().hasSelection();
 
         //look ahead.
         int pos = this->cursorPosition();
@@ -301,7 +301,7 @@
                 this->setCursorPosition(pos+1);
                 this->deselect();
             }
-            HbAbstractEdit::keyPressEvent(event);
+            HbTextEdit::keyPressEvent(event);
         }
         event->accept();
         return;
@@ -311,7 +311,7 @@
     {
         if(mDefaultBehaviour)
         {
-            HbAbstractEdit::keyPressEvent(event);
+            HbTextEdit::keyPressEvent(event);
             event->accept();
             return;
         }
@@ -334,11 +334,11 @@
 
             str.replace(expr, replacementStr);
             QKeyEvent eve(event->type(), event->key(), event->modifiers(), str);
-            HbAbstractEdit::keyPressEvent(&eve);
+            HbTextEdit::keyPressEvent(&eve);
         }
         else
         {
-            HbAbstractEdit::keyPressEvent(event);
+            HbTextEdit::keyPressEvent(event);
             event->accept();
             return;
         }
@@ -359,15 +359,15 @@
 
     if(labelPos >= 0 )//pressed on label.
     {
-        this->setCursorPosition(currentPos + labelPos + 2);
+        HbTextEdit::setCursorPosition(currentPos + labelPos + 2);
     }
     else if(seperatorPos == currentPos-1 || seperatorPos == currentPos)//pressed just on seperator.
     {
-        this->setCursorPosition(seperatorPos+2);
+        HbTextEdit::setCursorPosition(seperatorPos+2);
     }
     else
     {
-        this->setCursorPosition(currentPos+1);
+        HbTextEdit::setCursorPosition(currentPos);
         bool pbkContact = this->textCursor().charFormat().fontUnderline();
         if(pbkContact)
         {
@@ -381,7 +381,7 @@
 void MsgUnifiedEditorLineEdit::gestureEvent(QGestureEvent* event)
 {
     //passing gesture event to base class.
-    HbLineEdit::gestureEvent(event);
+    HbTextEdit::gestureEvent(event);
     
     
     if(HbTapGesture *tap = qobject_cast<HbTapGesture*>(event->gesture(Qt::TapGesture)))
@@ -462,14 +462,14 @@
 
 void MsgUnifiedEditorLineEdit::focusInEvent(QFocusEvent* event)
 {    
-    HbLineEdit::focusInEvent(event);
-    this->setCursorVisibility(Hb::TextCursorVisible);
+    HbTextEdit::focusInEvent(event);
+//    this->setCursorVisibility(Hb::TextCursorVisible);
 }
 
 void MsgUnifiedEditorLineEdit::focusOutEvent(QFocusEvent* event)
 {    
-    HbLineEdit::focusOutEvent(event);
-    this->setCursorVisibility(Hb::TextCursorHidden);
+    HbTextEdit::focusOutEvent(event);
+//    this->setCursorVisibility(Hb::TextCursorHidden);
 }
 
 void MsgUnifiedEditorLineEdit::setHighlight(int currentPos)
@@ -533,7 +533,7 @@
 void MsgUnifiedEditorLineEdit::timerEvent(QTimerEvent *event)
 {
     //passing event to base class.
-    HbLineEdit::timerEvent(event);
+    HbTextEdit::timerEvent(event);
 
     if (event->timerId() == mSelectionSnapTimer.timerId())
     {
@@ -571,7 +571,7 @@
 
 QString MsgUnifiedEditorLineEdit::text() const
 {
-    return HbLineEdit::text();
+   return this->toPlainText();
 }
 
 QString MsgUnifiedEditorLineEdit::content() const
@@ -637,4 +637,27 @@
     }
 
 }
+
+void MsgUnifiedEditorLineEdit::setSelection(int start, int length)
+{
+    int textLength = text().count();
+    QString test = text();
+    Q_UNUSED(test)
+    if (start < 0 || start > textLength) {
+        return;
+    }
+
+    int end(start+length);
+    if (end > textLength) {
+        end = textLength;
+    } else if (end < 0) {
+        end = 0;
+    }
+
+    QTextCursor cursor = textCursor();
+    cursor.setPosition(start, QTextCursor::MoveAnchor);
+    cursor.setPosition(end, QTextCursor::KeepAnchor);
+    setTextCursor(cursor);
+
+}
 // eof
--- a/messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -18,28 +18,27 @@
 // INCLUDES
 #include "debugtraces.h"
 #include <HbNotificationDialog>
-#include <HbWidget>
 
 // USER INCLUDES
 #include "msgunieditormonitor.h"
-#include "msgunieditorview.h"
-#include "msgunieditoraddress.h"
-#include "msgunieditorsubject.h"
-#include "msgunieditorbody.h"
-#include "msgunieditorattachmentcontainer.h"
 #include "UniEditorGenUtils.h"
 
 // Constants
 
 // Define static
-ConvergedMessage::MessageType MsgUnifiedEditorMonitor::mMessageType;
-int MsgUnifiedEditorMonitor::mBodySize;
-int MsgUnifiedEditorMonitor::mContainerSize;
-int MsgUnifiedEditorMonitor::mSubjectSize;
-int MsgUnifiedEditorMonitor::mMaxMmsSize;
-int MsgUnifiedEditorMonitor::mMaxSmsRecipients;
-int MsgUnifiedEditorMonitor::mMaxMmsRecipients;
-int MsgUnifiedEditorMonitor::mMsgCurrAddressCount;
+ConvergedMessage::MessageType MsgUnifiedEditorMonitor::mMessageType = ConvergedMessage::Sms;
+int MsgUnifiedEditorMonitor::mBodySize = 0;
+int MsgUnifiedEditorMonitor::mBodyTextSize = 0;
+int MsgUnifiedEditorMonitor::mContainerSize = 0;
+int MsgUnifiedEditorMonitor::mBodyContentSize = 0;
+int MsgUnifiedEditorMonitor::mSubjectSize = 0;
+int MsgUnifiedEditorMonitor::mMaxMmsSize = 0;
+int MsgUnifiedEditorMonitor::mMaxSmsRecipients = 0;
+int MsgUnifiedEditorMonitor::mMaxMmsRecipients = 0;
+int MsgUnifiedEditorMonitor::mToAddressCount = 0;
+int MsgUnifiedEditorMonitor::mCcAddressCount = 0;
+int MsgUnifiedEditorMonitor::mBccAddressCount = 0;
+bool MsgUnifiedEditorMonitor::mReadyForSend = false;
 
 //Localized strings
 #define LOC_POP_MESSAGE_CHANGE_MUL hbTrId("txt_messaging_dpopinfo_message_type_changed_to_mul")
@@ -51,7 +50,12 @@
 //---------------------------------------------------------------
 MsgUnifiedEditorMonitor::MsgUnifiedEditorMonitor(QObject* parent) :
 QObject(parent),
-mSkipNote(false)
+mSkipNote(false),
+mContainerHasMmsContent(false),
+mPriority(ConvergedMessage::Normal),
+mEmailPresent(false),
+mUniCode(false),
+mImageResizing(false)
 {    
     mUniEditorGenUtils = q_check_ptr( new UniEditorGenUtils);
     init(); 
@@ -63,22 +67,39 @@
 //---------------------------------------------------------------
 MsgUnifiedEditorMonitor::~MsgUnifiedEditorMonitor()
 {
+    reset();
     delete mUniEditorGenUtils;
 }
 
 //---------------------------------------------------------------
+// MsgUnifiedEditorMonitor::reset
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorMonitor::reset()
+{
+    mMessageType = ConvergedMessage::Sms;
+    mBodySize = 0;
+    mBodyTextSize = 0;
+    mContainerSize = 0;
+    mBodyContentSize = 0;
+    mSubjectSize = 0;
+    mMaxMmsSize = 0;
+    mMaxSmsRecipients = 0;
+    mMaxMmsRecipients = 0;
+    mToAddressCount = 0;
+    mCcAddressCount = 0;
+    mBccAddressCount = 0;
+    mReadyForSend = false;
+}
+
+//---------------------------------------------------------------
 // MsgUnifiedEditorMonitor::init
 // @see header file
 //---------------------------------------------------------------
 void MsgUnifiedEditorMonitor::init()
 {
-    mMessageType = ConvergedMessage::Sms;
-    mBodySize = 0;
-    mContainerSize = 0;
-    mSubjectSize = 0;
-    mMsgCurrAddressCount = 0;
-
     mMaxMmsSize = KDefaultMaxSize;
+   
     TRAP_IGNORE(mMaxMmsSize = mUniEditorGenUtils->MaxMmsMsgSizeL());
 
     mMaxSmsRecipients = KDefaultSmsRecipients;
@@ -89,11 +110,69 @@
 }
 
 //---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::handleContentChange
+// MsgUnifiedEditorMonitor::handleContentsChanged
 // @see header file
 //---------------------------------------------------------------
-void MsgUnifiedEditorMonitor::handleContentChange()
+void MsgUnifiedEditorMonitor::handleContentsChanged(const QVariant& data)
 {
+    QString objectName = sender()->objectName();
+    
+    if(objectName == "attachmentContainer")
+    {
+        QVariantList dataList = data.toList();
+        mContainerSize = dataList.at(0).toInt();
+        mContainerHasMmsContent = dataList.at(1).toBool();        
+    }
+
+    if(objectName == "body")
+    {
+        if(data.type() == QVariant::Bool)
+        {
+          mImageResizing = data.toBool();
+        }
+        else
+        {
+        mBodySize = data.toInt();
+        updateBodyContentSize();
+        }
+    }
+    
+    if(objectName == "bodyText")
+    {
+        QVariantList dataList = data.toList();
+        mBodyTextSize = dataList.at(0).toInt();
+        mUniCode = dataList.at(1).toBool(); 
+        updateBodyContentSize();
+        
+    }
+    
+    if(objectName == "subject")
+    {
+        QVariantList dataList = data.toList();
+        mSubjectSize = dataList.at(0).toInt();
+        mPriority = ConvergedMessage::Priority(dataList.at(1).toInt());
+        
+    }
+    
+    if(objectName == "to")
+    {
+        QVariantList dataList = data.toList();
+        mToAddressCount = dataList.at(0).toInt();
+        mEmailPresent = dataList.at(1).toBool();        
+    }
+    
+    if(objectName == "cc")
+    {
+        QVariantList dataList = data.toList();
+        mCcAddressCount = dataList.at(0).toInt();
+    }
+    
+    if(objectName == "bcc")
+    {
+        QVariantList dataList = data.toList();
+        mBccAddressCount = dataList.at(0).toInt(); 
+    }
+    
     // get the projected message type & show the type change note
     ConvergedMessage::MessageType newMsgType = projectedMsgType();    
     if(mMessageType != newMsgType)
@@ -110,10 +189,14 @@
         }
         showPopup(noteStr);
     }
-
-    HbWidget* senderWidget = qobject_cast<HbWidget*>(sender());
-    updateMsgInfo(senderWidget);
+    
     updateSend();
+    
+    //emit when content is modified after opening a draft message.
+    if(!mSkipNote)
+    {
+    emit contentsChanged();
+    }
 }
 
 //---------------------------------------------------------------
@@ -136,66 +219,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::updateMsgInfo
-// @see header file
-//---------------------------------------------------------------
-void MsgUnifiedEditorMonitor::updateMsgInfo(HbWidget* senderWidget)
-{
-    if(mMessageType == ConvergedMessage::Mms)
-    {
-        //Disable char counter & add subject
-        view()->mBody->disableCharCounter();
-        view()->addSubject();
-    }
-    else
-    {
-        //Enable char counter
-        view()->mBody->enableCharCounter();    
-    }
-
-    // check if sent by body widget
-    MsgUnifiedEditorBody* body = NULL;
-    body = qobject_cast<MsgUnifiedEditorBody*>(senderWidget);
-    if(body)
-    {
-        mBodySize = view()->mBody->bodySize();
-        view()->setAttachOptionEnabled(
-                MsgUnifiedEditorView::TBE_PHOTO, !view()->mBody->hasImage());
-        view()->setAttachOptionEnabled(
-                MsgUnifiedEditorView::TBE_SOUND, !view()->mBody->hasAudio());
-        return;
-    }
-    
-    // check if sent by subject widget
-    MsgUnifiedEditorSubject* subject = NULL;
-    subject = qobject_cast<MsgUnifiedEditorSubject*>(senderWidget);
-    if(subject)
-    {
-        mSubjectSize = view()->mSubjectField->subjectSize();
-        return;
-    }
-
-    // check if sent by attachment container widget
-    MsgAttachmentContainer* container = NULL;
-    container = qobject_cast<MsgAttachmentContainer*>(senderWidget);
-    if(container)
-    {
-        mContainerSize = view()->mAttachmentContainer->containerSize();
-        return;
-    }
-
-    // handle content change from other widgets e.g. To, Cc, Bcc address field
-    int totalAddressCount = view()->mToField->addressCount();
-    if(view()->mCcField && view()->mBccField)
-    {
-        totalAddressCount += view()->mCcField->addressCount() +
-                view()->mBccField->addressCount();
-    }
-    mMsgCurrAddressCount = totalAddressCount;
-    return;
-}
-
-//---------------------------------------------------------------
 // MsgUnifiedEditorMonitor::showPopup
 // @see header file
 //---------------------------------------------------------------
@@ -215,37 +238,23 @@
 }
 
 //---------------------------------------------------------------
-// MsgUnifiedEditorMonitor::view
-// @see header file
-//---------------------------------------------------------------
-MsgUnifiedEditorView* MsgUnifiedEditorMonitor::view()
-{
-    return static_cast<MsgUnifiedEditorView*>(this->parent());
-}
-
-//---------------------------------------------------------------
 // MsgUnifiedEditorMonitor::bodyHasMMSContent
 // @see header file
 //---------------------------------------------------------------
 bool MsgUnifiedEditorMonitor::bodyHasMMSContent()
 {
-    MsgUnifiedEditorBody* edBody = view()->mBody;
-    // If any media-object is present inside body
-    if(!edBody->mediaContent().isEmpty())
-    {
-        return true;
-    }
-    
-    int bodyTextSize = mUniEditorGenUtils->UTF8Size(edBody->text());
+    bool result = false;
+
     int maxSmsSize = 0;
-    TRAP_IGNORE(maxSmsSize = 
-           mUniEditorGenUtils->MaxSmsMsgSizeL(edBody->isUnicode()));
+    TRAP_IGNORE(maxSmsSize = mUniEditorGenUtils->MaxSmsMsgSizeL(mUniCode));
+
     // If body text size exceeds sms text-size limit
-    if(bodyTextSize > maxSmsSize)
+    if( mBodyTextSize > maxSmsSize || mBodySize)
     {
-        return true;
+        result = true;
     }
-    return false;
+
+    return result;
 }
 
 //---------------------------------------------------------------
@@ -254,22 +263,13 @@
 //---------------------------------------------------------------
 bool MsgUnifiedEditorMonitor::subjectHasMMSContent()
 {
-    MsgUnifiedEditorSubject* edSubject = view()->mSubjectField;
-    ConvergedMessage::Priority priority = ConvergedMessage::Normal;
-    QString subjectText;
-    if(edSubject)
+    bool result = false;
+    if(mPriority != ConvergedMessage::Normal || mSubjectSize)
     {
-        priority = edSubject->priority();
-        subjectText = edSubject->text();
+        result =  true;
     }
-    // If priority is set to other than Normal or
-    // If subject has some content
-    if( (priority != ConvergedMessage::Normal) ||
-        !subjectText.isEmpty() )
-    {
-        return true;
-    }
-    return false;
+    
+    return result;
 }
 
 //---------------------------------------------------------------
@@ -278,23 +278,14 @@
 //---------------------------------------------------------------
 bool MsgUnifiedEditorMonitor::containerHasMMSContent()
 {
-    QString bodyText = view()->mBody->text();
-    MsgAttachmentContainer* edContainer = view()->mAttachmentContainer;
-    bool hasMMAttachmentContent = false;
-    int attachmentCount = 0;
-    if(edContainer)
+    bool result = false;
+    
+    if(mContainerHasMmsContent || mContainerSize && mBodyTextSize)
     {
-        hasMMAttachmentContent = edContainer->hasMMContent();
-        attachmentCount = edContainer->count();
+        result = true;
     }
-    // If MM attachments are present or
-    // If only one non-MM attachment is present e.g. vcf along with body text
-    if( hasMMAttachmentContent ||
-        ((attachmentCount == 1) && !bodyText.isEmpty()) )
-    {
-        return true;
-    }
-    return false;
+    
+    return result;
 }
 
 //---------------------------------------------------------------
@@ -303,32 +294,14 @@
 //---------------------------------------------------------------
 bool MsgUnifiedEditorMonitor::otherMMSCriteriaMet()
 {
-    MsgUnifiedEditorAddress* edCc = view()->mCcField;
-    MsgUnifiedEditorAddress* edBcc = view()->mBccField;
-    int ccCount = 0;
-    int bccCount = 0;
-    if(edCc && edBcc)
+    bool result = false;
+    
+    if(mCcAddressCount || mBccAddressCount || mEmailPresent ||
+       mToAddressCount > mMaxSmsRecipients)
     {
-        ccCount = edCc->addressCount();
-        bccCount = edBcc->addressCount();
+        result = true;
     }
-    // If CC/BCC has some content or
-    // If to-recipients count exceeds max sms recipient count
-    if( ccCount || bccCount ||
-        (view()->mToField->addressCount() > mMaxSmsRecipients) )
-    {
-        return true;
-    }
-    
-    // If to-field contains an email address
-    bool isEmailPresent = false;
-    ConvergedMessageAddressList addrList = view()->mToField->addresses();
-    TRAP_IGNORE(isEmailPresent = mUniEditorGenUtils->VerifyEmailAddressesL(addrList));
-    if(isEmailPresent)
-    {
-        return true;
-    }
-    return false;
+    return result;
 }
 
 //---------------------------------------------------------------
@@ -337,15 +310,33 @@
 //---------------------------------------------------------------
 void MsgUnifiedEditorMonitor::updateSend()
 {
-    if (mMsgCurrAddressCount > 0 && (mSubjectSize + mBodySize + mContainerSize) > 0 && !view()->mBody->isImageResizing())
+
+    if ( (mToAddressCount + mCcAddressCount + mBccAddressCount) > 0 &&
+         (mSubjectSize + mBodyContentSize + mContainerSize) > 0 &&
+         !mImageResizing )
     {
         emit enableSend(true);
+        mReadyForSend = true;
     }
     else
     {
         emit enableSend(false);
+        mReadyForSend = false;
+    }
+
+}
+
+void MsgUnifiedEditorMonitor::updateBodyContentSize()
+{
+    if(mBodySize || mBodyTextSize)
+    {
+        mBodyContentSize = mBodySize + mBodyTextSize + KEstimatedMimeHeaderSize 
+                           + KEstimatedMmsSmilHeaderSize;
+    }
+    else
+    {
+        mBodyContentSize = 0; 
     }
 }
 
-
 //EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorscrollarea.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,741 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: manages scrollable portion of view.
+ *
+ */
+
+#include "msgunieditorscrollarea.h"
+
+#include <QGraphicsLinearLayout>
+#include <HbGroupBox>
+#include <HbAction>
+#include <QInputContext>
+#include <qfile.h>
+#include <qapplication.h>
+#include <xqconversions.h>
+#include <commonphoneparser.h> 
+#include <HbNotificationDialog>
+#include <hbmainwindow.h>
+
+#include "msgunieditoraddress.h"
+#include "msgunieditorsubject.h"
+#include "msgunieditorbody.h"
+#include "msgunieditorsubject.h"
+#include "msgunieditorbody.h"
+#include "msgunieditormonitor.h"
+#include "msgunieditorattachmentcontainer.h"
+#include "UniEditorGenUtils.h"
+#include "msgunieditorview.h"
+
+// LOCALIZED CONSTANTS
+//To,Cc.Bcc
+#define LOC_TO  hbTrId("txt_messaging_formlabel_to")
+#define LOC_CC  hbTrId("txt_messaging_formlabel_cc")
+#define LOC_BCC hbTrId("txt_messaging_formlabel_bcc")
+//group box
+#define LOC_OTHER_RECIPIENTS(n) hbTrId("txt_messaging_title_ln_other_recipients",n)
+#define LOC_OTHER_RECIPIENTS_EXPAND hbTrId("txt_messaging_title_other_recipients")
+
+// attachment addition failure note
+#define LOC_UNABLE_TO_ADD_ATTACHMENTS hbTrId("txt_messaging_dpopinfo_unable_to_attach_l1_of_l2")
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::MsgUnifiedEditorScrollArea
+//
+//---------------------------------------------------------------
+MsgUnifiedEditorScrollArea::MsgUnifiedEditorScrollArea(MsgUnifiedEditorMonitor* msgMonitor,QGraphicsItem *parent) :
+HbScrollArea(parent),
+mMsgMonitor(msgMonitor),
+mMainLayout(0),
+mToField(0),
+mCcField(0),
+mBccField(0),
+mSubjectField(0),
+mBody(0),
+mAttachmentContainer(0),
+mEnableScrolling(true)
+{
+    init();
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::~MsgUnifiedEditorScrollArea
+//
+//---------------------------------------------------------------
+MsgUnifiedEditorScrollArea::~MsgUnifiedEditorScrollArea()
+{
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::init
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::init()
+{
+    HbWidget* contentWidget = new HbWidget(this);
+    this->setContentWidget(contentWidget);
+
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, contentWidget);
+    qreal vTopSpacing = 0.0;
+    qreal vItemSpacing = 0.0;
+    style()->parameter("hb-param-margin-gene-top",vTopSpacing);    
+    style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);
+    
+    mMainLayout->setContentsMargins(0,0,0,0);
+    mMainLayout->setSpacing(vItemSpacing);
+
+    mToField = new MsgUnifiedEditorAddress( LOC_TO, this ); 
+    mToField->setObjectName("to");
+    
+    mBody =  new MsgUnifiedEditorBody(this);
+        
+    mMainLayout->addItem(mToField);
+    mMainLayout->addItem(mBody);
+    mMainLayout->addStretch(2);
+ 
+    connect(mToField, SIGNAL(contentsChanged(const QVariant&)),
+            mMsgMonitor, SLOT(handleContentsChanged(const QVariant&)));
+    
+    connect(mBody, SIGNAL(contentsChanged(const QVariant&)),
+            mMsgMonitor, SLOT(handleContentsChanged(const QVariant&))); 
+    
+    connect(mBody,SIGNAL(enableMenuAction(int,bool)),this,SIGNAL(enableMenuAction(int,bool)));
+    
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::addCcBcc
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::addCcBcc(bool needFocus)
+{
+    if(mCcField && mBccField)
+    { // do nothing if already present
+        return;
+    }
+
+    mCcField    = new MsgUnifiedEditorAddress( LOC_CC, this );
+    mCcField->setObjectName("cc");
+
+    mBccField   = new MsgUnifiedEditorAddress( LOC_BCC, this );
+    mBccField->setObjectName("bcc");
+
+    mCcField->skipMaxRecipientQuery(true);
+    mBccField->skipMaxRecipientQuery(true);
+
+    connect(mCcField, SIGNAL(contentsChanged(const QVariant&)),
+        mMsgMonitor, SLOT(handleContentsChanged(const QVariant&)));
+
+    connect(mBccField, SIGNAL(contentsChanged(const QVariant&)),
+        mMsgMonitor, SLOT(handleContentsChanged(const QVariant&)));
+
+    HbWidget* groupWidget = new HbWidget(this);
+    groupWidget->setContentsMargins(0,0,0,0);
+
+    QGraphicsLinearLayout* ccBccLayout = new QGraphicsLinearLayout(Qt::Vertical, groupWidget);
+    ccBccLayout->setContentsMargins(0,0,0,0);
+
+    qreal vItemSpacing = 0.0;    
+    style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);
+    ccBccLayout->setSpacing(vItemSpacing);
+    ccBccLayout->addItem(mCcField);
+    ccBccLayout->addItem(mBccField);
+
+    HbGroupBox* groupBox = new HbGroupBox(0);  
+    groupBox->setObjectName("groupBox");
+
+    groupBox->setContentWidget(groupWidget);
+    groupBox->setHeading(LOC_OTHER_RECIPIENTS_EXPAND);
+    mMainLayout->insertItem(1,groupBox);
+    connect(groupBox, SIGNAL(toggled(bool)), this, SLOT(updateOtherRecipientCount(bool)));
+
+    //emit signal to remove CcBcc action
+    emit enableMenuAction(CCBCC, false);
+
+    this->updateGeometry();
+    
+    if(needFocus)
+    {
+        setFocus(mCcField);
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::addSubject
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::addSubject(bool needFocus)
+{
+    // do nothing if already present
+    if(mSubjectField)
+    { 
+        return;
+    }
+
+    mSubjectField = new MsgUnifiedEditorSubject(this);
+
+    int index = 0;
+    if(mCcField && mBccField)
+    {
+        index = 2;
+    }
+    else
+    {
+        index = 1;
+    }
+
+    mMainLayout->insertItem(index,mSubjectField);
+    connect(mSubjectField, SIGNAL(contentsChanged(const QVariant&)),
+            mMsgMonitor, SLOT(handleContentsChanged(const QVariant&)));
+
+    //emit signal to remove CcBcc action
+    emit enableMenuAction(SUBJECT, false); 
+    
+    if(needFocus)
+    {
+        setFocus(mSubjectField);
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::setImage
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::setImage(const QString& path, bool draftMessage)
+{
+    mBody->setImage(path,draftMessage);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::setAudio
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::setAudio(const QString& filePath)
+{
+    mBody->setAudio(filePath);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::setFocus
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::setFocus(MsgUnifiedEditorBaseWidget* item)
+{
+    if(item)
+    {
+        item->setFocus();  
+    }
+    
+    //open vkb
+    postInputPanelEvent();
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::changePriority
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::changePriority()
+{
+    HbAction* action = qobject_cast<HbAction*>(sender());
+
+    ConvergedMessage::Priority priority = ConvergedMessage::Normal;
+   if(action)
+        {
+        int data = action->data().toInt();
+        priority = ConvergedMessage::Priority(data);
+        }
+
+    addSubject();
+    mSubjectField->setPriority(priority);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::updateOtherRecipientCount
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::updateOtherRecipientCount(bool state)
+{
+    HbGroupBox* groupBox = qobject_cast<HbGroupBox*>(sender());
+    if(groupBox)
+    {
+        if(!state)
+        {
+           groupBox->setHeading(LOC_OTHER_RECIPIENTS_EXPAND);
+        }
+        else
+        {
+            int addrCount = mCcField->addressCount();
+            addrCount += mBccField->addressCount();
+            if(addrCount > 0)
+            {
+                groupBox->setHeading(LOC_OTHER_RECIPIENTS(addrCount));    
+            }
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::contactsValid
+//
+//---------------------------------------------------------------
+bool MsgUnifiedEditorScrollArea::contactsValid()
+{
+        bool res = ( !mToField->validateContacts() ||
+                    (mCcField && !mCcField->validateContacts()) ||
+                    (mBccField && !mBccField->validateContacts()) );
+        
+        return !res;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::currentAddress
+//
+//---------------------------------------------------------------
+ConvergedMessageAddress* MsgUnifiedEditorScrollArea::currentAddress()
+{
+    ConvergedMessageAddress* currentAdd = NULL;
+    
+    ConvergedMessageAddressList addList = mToField->addresses();
+    int count = addList.count();
+    if(count)
+    {
+        currentAdd = addList.takeFirst();
+    }
+    
+    while(addList.count())
+    {
+        ConvergedMessageAddress* obj =  addList.takeFirst();
+        delete obj;
+    }
+    
+    return currentAdd;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::packMessage
+//
+//---------------------------------------------------------------
+int MsgUnifiedEditorScrollArea::packMessage(ConvergedMessage &msg, bool isSave)
+{
+    // If isSave is true (save to draft usecase), then don't remove duplicates
+    // If isSave is false (send usecase), then remove duplicates
+    bool removeDuplicates = !isSave;
+    ConvergedMessageAddressList addresses = mToField->addresses(removeDuplicates);
+    
+    ConvergedMessageAddressList ccAddresses;
+    ConvergedMessageAddressList bccAddresses;
+    ConvergedMessageAttachmentList mediaList;
+    int errorCode = 0;
+    //Don't format the addresses for save to drfats case
+    if(!isSave)
+    {
+       formatAddresses(addresses);
+    }
+    
+    msg.addToRecipients(addresses);
+
+    if(MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms)
+    {
+        if(mCcField)
+        {
+            ccAddresses = mCcField->addresses(removeDuplicates);
+        }
+
+        if(mBccField)
+        {
+            bccAddresses = mBccField->addresses(removeDuplicates);
+        }
+
+        if(removeDuplicates)
+        {
+            int matchDigitsCount = MsgUnifiedEditorAddress::contactMatchDigits();
+            //comapre cc and to field,remove duplicate from cc
+            foreach(ConvergedMessageAddress *ccAddress,ccAddresses)
+            {
+                foreach(ConvergedMessageAddress *toAddress,addresses)
+                {
+                    if(0 == ccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount)))
+                    {
+                        ccAddresses.removeOne(ccAddress);
+                    }
+                }
+            }
+            //comapre bcc and cc field,remove duplicate from bcc
+            foreach(ConvergedMessageAddress *bccAddress,bccAddresses)
+            {
+                foreach(ConvergedMessageAddress *ccAddress,ccAddresses)
+                {
+                    if(0 == bccAddress->address().right(matchDigitsCount).compare(ccAddress->address().right(matchDigitsCount)))
+                    {
+                        bccAddresses.removeOne(bccAddress);
+                    }
+                }
+            }
+            //comapre bcc and to field,remove duplicate from bcc
+            foreach(ConvergedMessageAddress *bccAddress,bccAddresses)
+            {
+                foreach(ConvergedMessageAddress *toAddress,addresses)
+                {
+                    if(0 == bccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount)))
+                    {
+                        bccAddresses.removeOne(bccAddress);
+                    }
+                }
+            }
+        }
+
+        if(ccAddresses.count()>0)
+        {
+        //Don't format the addresses for save to drfats case
+        if(!isSave)
+        {
+           formatAddresses(ccAddresses);
+        }        
+        msg.addCcRecipients(ccAddresses);
+        }
+        if(bccAddresses.count()>0)
+        {
+        //Don't format the addresses for save to drfats case
+        if(!isSave)
+        {
+           formatAddresses(bccAddresses);        
+        }
+        msg.addBccRecipients(bccAddresses);
+        }
+        if(mSubjectField)
+        {
+            msg.setSubject(mSubjectField->text());
+            msg.setPriority(mSubjectField->priority());
+        }
+
+        QStringList mediafiles(mBody->mediaContent());
+        if (!mediafiles.isEmpty())
+        {
+            for (int i = 0; i < mediafiles.size(); ++i)
+            {
+                if(QFile::exists(mediafiles.at(i)))
+                {
+                ConvergedMessageAttachment* attachment =
+                    new ConvergedMessageAttachment(
+                        mediafiles.at(i),
+                        ConvergedMessageAttachment::EInline);
+                mediaList << attachment;
+                }
+                else
+                {   mBody->removeMediaContent(mediafiles.at(i));
+                    errorCode = KErrNotFound;
+                }
+            }
+
+        }
+        if(mediaList.count() > 0)
+        {
+            msg.addAttachments(mediaList);
+        }
+    }
+
+    // sms/mms attachment list
+    ConvergedMessageAttachmentList attachmentList;
+        if(mAttachmentContainer)
+        {
+            MsgUnifiedEditorAttachmentList editorAttachmentList =
+                mAttachmentContainer->attachmentList();
+                for (int i = 0; i < editorAttachmentList.count(); ++i)
+                {
+                    if(QFile::exists(editorAttachmentList.at(i)->path()))
+                    {
+                        ConvergedMessageAttachment* attachment =
+                                                new ConvergedMessageAttachment(
+                                                    editorAttachmentList.at(i)->path(),
+                                                    ConvergedMessageAttachment::EAttachment);
+                                            attachmentList << attachment;    
+                    }
+                    else
+                    {
+                        mAttachmentContainer->deleteAttachment(editorAttachmentList.at(i));
+                        errorCode = KErrNotFound;
+                    }   
+                }
+            }
+        if(attachmentList.count() > 0)
+        {
+            msg.addAttachments(attachmentList);
+        }
+        return errorCode;
+}
+
+// ----------------------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::formatAddresses
+// @see header
+// ----------------------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::formatAddresses(ConvergedMessageAddressList& addresses)
+{       
+    for(int i=0; i < addresses.count() ;i++ )
+    {
+        QString addr = addresses[i]->address();
+        
+        HBufC *tempAddr = XQConversions::qStringToS60Desc(addr);     
+            
+        TPtr ptr = tempAddr->Des();
+                    
+         // Note: This is just to parse spaces etc away from phonenumbers.
+         //       Ignore EFalse returned for email addresses.   
+        CommonPhoneParser::ParsePhoneNumber(ptr , 
+                                            CommonPhoneParser::ESMSNumber );        
+       
+        addr = XQConversions::s60DescToQString(tempAddr->Des()); 
+        
+        addresses[i]->setAddress(addr);
+        
+        delete tempAddr;                                                       
+    }       
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::addAttachment
+//
+//---------------------------------------------------------------
+int MsgUnifiedEditorScrollArea::addAttachment(const QString& filepath)
+{
+    // do nothing if filepath is empty
+    if(filepath.isEmpty())
+    {
+        return MsgAttachmentContainer::EAddSuccess;
+    }
+
+    if(!mAttachmentContainer)
+    {
+        mAttachmentContainer = new MsgAttachmentContainer(this);
+        connect(mAttachmentContainer, SIGNAL(emptyAttachmentContainer()),
+                this, SLOT(removeAttachmentContainer()));
+        connect(mAttachmentContainer, SIGNAL(contentsChanged(const QVariant&)),
+                mMsgMonitor, SLOT(handleContentsChanged(const QVariant&)));
+        
+        int index = mMainLayout->count() - 1;
+        mMainLayout->insertItem(index,mAttachmentContainer);
+    }
+
+    int ret = mAttachmentContainer->addAttachment(filepath);
+    if(ret != MsgAttachmentContainer::EAddSuccess)
+    {
+        // delete container, if it is empty
+        if(mAttachmentContainer->count() == 0)
+        {
+            removeAttachmentContainer();
+        }
+    }
+    return ret;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::removeAttachmentContainer
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::removeAttachmentContainer()
+{
+    if(mAttachmentContainer)
+    {
+        mMainLayout->removeItem(mAttachmentContainer);
+        mAttachmentContainer->setParent(NULL);
+        delete mAttachmentContainer;
+        mAttachmentContainer = NULL;
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::addAttachments
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::addAttachments(const QStringList files)
+{    
+    int fcount = files.count();
+    int i=0;
+    for(i=0; i<fcount; i++)
+    {
+        int status = addAttachment(files.at(i));
+        if(status == MsgAttachmentContainer::EAddSizeExceed)
+        {
+            QString displayStr = QString(LOC_UNABLE_TO_ADD_ATTACHMENTS)
+                    .arg(fcount-i).arg(fcount);
+            HbNotificationDialog::launchDialog(displayStr);
+            break;
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::fileNameInUse
+//
+//---------------------------------------------------------------
+bool MsgUnifiedEditorScrollArea::fileNameInUse(const QString& fileName)
+{
+    bool inUse = false;
+    
+    if(mAttachmentContainer)
+    {
+        inUse = mAttachmentContainer->fileNameInUse(fileName);
+    }
+    
+    return inUse;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::scrollByAmount
+//
+//---------------------------------------------------------------
+bool MsgUnifiedEditorScrollArea::scrollByAmount(const QPointF &delta)
+{
+    if(mEnableScrolling)
+    {
+        return HbScrollArea::scrollByAmount(delta);
+    }
+    else
+    {
+        return false;
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::enableScrolling
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::enableScrolling(bool enable)
+{
+    mEnableScrolling = enable;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::postInputPanelEvent
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::postInputPanelEvent()
+{
+    // This opens the VKB
+    QInputContext *ic = qApp->inputContext();
+    if (ic)
+    {
+        QEvent event(QEvent::RequestSoftwareInputPanel);
+        ic->filterEvent(&event);
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorScrollArea::populateContent
+//
+//---------------------------------------------------------------
+void MsgUnifiedEditorScrollArea::populateContent(const ConvergedMessage& msg, bool draftMessage, bool checkForInline)
+{
+    mToField->skipMaxRecipientQuery(true);
+
+    mToField->setAddresses(msg.toAddressList(),draftMessage);
+    
+    if(msg.ccAddressList().count() > 0 )
+    {
+        if(!mCcField)
+        {
+            addCcBcc();
+        }
+        mCcField->setAddresses(msg.ccAddressList(),draftMessage);
+    }
+    
+    if(msg.bccAddressList().count() > 0 )
+    {
+        if(!mBccField)
+        {
+            addCcBcc();
+        }
+        mBccField->setAddresses(msg.bccAddressList(),draftMessage);
+    }
+    
+    if(msg.subject().size() > 0)
+    {
+        if(!mSubjectField)
+        {
+            addSubject();
+        }
+        mSubjectField->setText(msg.subject());
+    }
+
+    if(msg.priority()==ConvergedMessage::High ||
+        msg.priority() == ConvergedMessage::Low)
+    {
+        if(!mSubjectField)
+        {
+            addSubject();
+        }
+        mSubjectField->setPriority(msg.priority());
+    }
+
+
+    ConvergedMessageAttachmentList attachmentList = msg.attachments();
+
+    UniEditorGenUtils* genUtils = q_check_ptr(new UniEditorGenUtils);
+
+    QStringList pendingAttList;
+
+    int attachmentCount = attachmentList.count();
+
+    for( int i=0; i < attachmentCount; i++ )
+    {
+        QString filePath = msg.attachments().at(i)->filePath();
+        
+        bool inlineContent = true;
+        
+        if(checkForInline)
+        {
+            inlineContent = (attachmentList.at(i)->attachmentType() == ConvergedMessageAttachment::EInline);
+        }
+
+        if (inlineContent)
+        {
+            int imageSize=0;
+            QString mimeType;            
+            TMsgMediaType mediaType = EMsgMediaUnknown;
+            
+            TRAP_IGNORE(genUtils->getFileInfoL(filePath,imageSize,
+                        mimeType,mediaType));
+
+            switch(mediaType)
+            {
+                case EMsgMediaImage:
+                {
+                    mBody->setImage(filePath,draftMessage);
+                    break;
+                }
+                case EMsgMediaAudio:
+                {
+                    mBody->setAudio(filePath);
+                    break;
+                }
+                default:
+                {
+                    pendingAttList << filePath;
+                    break;
+                }
+            }
+        }
+        else
+        {
+            pendingAttList << filePath;
+        }
+    }
+    // add pending attachments to editor
+    addAttachments(pendingAttList);
+
+    delete genUtils;
+    
+    // ensure that any msg-type change after this are shown
+    mToField->skipMaxRecipientQuery(false);
+
+}
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -45,16 +45,16 @@
 mPriority(ConvergedMessage::Normal),
 mGenUtils(0)
 {
-        mSubjectEdit = new MsgUnifiedEditorLineEdit(LOC_SUBJECT,this);
-        mSubjectEdit->setDefaultBehaviour(true);        
-        HbStyle::setItemName(mSubjectEdit,"subjectEdit");
-        mSubjectEdit->setMinRows(1);
-        mSubjectEdit->setMaxRows(10);
-        
-        mGenUtils = q_check_ptr(new UniEditorGenUtils());
-        
-        connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
-                this, SLOT(onContentsChanged(const QString&)));
+    this->setObjectName("subject");
+
+    mSubjectEdit = new MsgUnifiedEditorLineEdit(LOC_SUBJECT,this);
+    mSubjectEdit->setDefaultBehaviour(true);        
+    HbStyle::setItemName(mSubjectEdit,"subjectEdit");
+
+    mGenUtils = q_check_ptr(new UniEditorGenUtils());
+
+    connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
+        this, SLOT(onContentsChanged(const QString&)));
 }
 
 //---------------------------------------------------------------
@@ -98,7 +98,9 @@
         break;
     }
 
-    emit contentChanged();
+    QVariantList data;
+    data << subjectSize() << mPriority;  
+    emit contentsChanged(data);
     this->repolish();
 }
 
@@ -133,7 +135,9 @@
     mPrevBuffer = text;
     if(!subjectOkInSms())
     {
-        emit contentChanged();
+        QVariantList data;
+        data << subjectSize() << mPriority;  
+        emit contentsChanged(data);
     }
 }
 
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -19,29 +19,25 @@
 #include <e32base.h>
 #include <HbMenu>
 #include <HbAction>
-#include <HbToolBar>
 #include <QGraphicsLinearLayout>
-#include <HbGroupBox>
-#include <HbScrollArea>
 #include <QDateTime>
 #include <QDir>
 #include <QBuffer>
 #include <QFile>
 #include <QFileInfo>
+#include <QApplication>
 #include <xqconversions.h>
-#include <HbToolBarExtension>
-#include <HbListWidget>
-#include <HbFrameBackground>
-#include <HbListViewItem>
-#include <HbListWidgetItem>
 #include <HbNotificationDialog>
 #include <HbDeviceNotificationDialog>
 #include <HbMessageBox>
-#include <HbAbstractVkbHost>
 #include <HbMainWindow>
 #include <xqaiwrequest.h>
 #include <xqappmgr.h>
 #include <HbStyleLoader>
+#include<HbInputMethod>
+#include <QTimer>
+#include<QInputContext>
+
 // QT Mobility for fetching business card
 #include <qmobilityglobal.h>
 #include <qversitwriter.h>
@@ -55,11 +51,7 @@
 // USER INCLUDES
 #include "debugtraces.h"
 #include "msgunieditorview.h"
-#include "msgunieditoraddress.h"
-#include "msgunieditorsubject.h"
-#include "msgunieditorbody.h"
 #include "msgunieditormonitor.h"
-#include "msgunieditorattachmentcontainer.h"
 #include "msgsendutil.h"
 #include "convergedmessageaddress.h"
 #include "UniEditorGenUtils.h"
@@ -68,11 +60,12 @@
 #include "msgsettingsview.h"
 #include "msgcontacthandler.h"
 #include "msgaudiofetcherdialog.h"
+#include "msgunieditorscrollarea.h"
+#include "msgunieditorbodyeditor.h"
 
 QTM_USE_NAMESPACE
 // Constants
-const QString SEND_ICON("qtg_mono_send");
-const QString ATTACH_ICON("qtg_mono_attach");
+
 // temporary folder for unieditor
 const QString UNIFIED_EDITOR_TEMP_FOLDER("unifiededitor");
 // invalid chars in vcard
@@ -89,17 +82,14 @@
 
 // LOCALIZED CONSTANTS
 #define LOC_TITLE hbTrId("txt_messaging_title_messaging")
-//To,Cc.Bcc
-#define LOC_TO  hbTrId("txt_messaging_formlabel_to")
-#define LOC_CC hbTrId("txt_messaging_formlabel_cc")
-#define LOC_BCC hbTrId("txt_messaging_formlabel_bcc")
 
 //attach options
 #define LOC_PHOTO           hbTrId("txt_messaging_opt_attach_sub_photo")
 #define LOC_SOUND           hbTrId("txt_messaging_opt_attach_sub_sound")
 #define LOC_BUSINESS_CARD   hbTrId("txt_messaging_opt_sub_business_card")
 
-//options menu.
+////options menu.
+#define LOC_ATTACH          hbTrId("txt_messaging_opt_attach")
 #define LOC_ADD_SUBJECT     hbTrId("txt_messaging_opt_add_subject")
 #define LOC_ADD_CC_BCC      hbTrId("txt_messaging_opt_add_cc_bcc")
 #define LOC_PRIORITY        hbTrId("txt_messaging_opt_priority")
@@ -110,21 +100,12 @@
 #define LOC_NORMAL hbTrId("txt_messaging_opt_attach_sub_normal")
 #define LOC_LOW hbTrId("txt_messaging_opt_attach_sub_low")
 
-//group box
-#define LOC_OTHER_RECIPIENTS(n) hbTrId("txt_messaging_title_ln_other_recipients",n)
-#define LOC_OTHER_RECIPIENTS_EXPAND hbTrId("txt_messaging_title_other_recipients")
-
 //saved to draft note
 #define LOC_SAVED_TO_DRAFTS    hbTrId("txt_messaging_dpopinfo_saved_to_drafts")
 
 //delete confermation
 #define LOC_NOTE_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
 
-// attachment addition failure note
-#define LOC_UNABLE_TO_ADD_ATTACHMENTS hbTrId("txt_messaging_dpopinfo_unable_to_attach_l1_of_l2")
-
-//extension list item frame.
-const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal");
 
 //settings confirmation
 #define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_message_centre_does_not_e")
@@ -153,30 +134,26 @@
 //---------------------------------------------------------------
 MsgUnifiedEditorView::MsgUnifiedEditorView( QGraphicsItem *parent ) :
     MsgBaseView(parent),
-    mSubjectAction(0),
-    mCcBccAction(0),
-    mSendAction(0),
     mMainLayout(0),
-    mSubjectField(0),
-    mToField(0),
-    mCcField(0),
-    mBccField(0),
-    mBody(0),
-    mContentWidget(0),
     mMsgMonitor(0),    
-    mAttachmentContainer(0),
     mPluginLoader(0),
     mCanSaveToDrafts(true),
     mVkbHost(NULL),
 	mDialog(NULL),
     mOriginatingSC(0),
     mOriginatingSME(0),
-    mReplyPath(false)
-    {
-    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
-    
-    addToolBar();
+    mReplyPath(false),
+    mSubjectAction(0),
+    mCcBccAction(0),
+    mPhotoAction(0),
+    mSoundAction(0),
+    mFocusedWidget(0),
+    mMinHeight(0.0),
+    mMaxHeight(0.0)
+    {    
+    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));    
     initView();
+    addMenu();    
     }
 
 //---------------------------------------------------------------
@@ -201,64 +178,66 @@
     if (!HbStyleLoader::registerFilePath(":/layouts")) {
         QDEBUG_WRITE("ERROR: MsgUnifiedEditorView -> HbStyleLoader::registerFilePath");
     }
-    HbScrollArea* scrollArea = new HbScrollArea(this);
-    this->setWidget(scrollArea);
 
-    mContentWidget = new HbWidget(this);
-    scrollArea->setContentWidget(mContentWidget);
+    //message monitor.
+    mMsgMonitor = new MsgUnifiedEditorMonitor(this);
+    
+    //Set the invalid msg id
+    mOpenedMessageId.setId(-1);
 
-    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, mContentWidget);
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
     qreal vTopSpacing = 0.0;
     qreal vItemSpacing = 0.0;
     style()->parameter("hb-param-margin-gene-top",vTopSpacing);    
-    style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);
-    
+    style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);    
     mMainLayout->setContentsMargins(0,vTopSpacing,0,0);
-    mMainLayout->setSpacing(vItemSpacing);
-
-    mMsgMonitor = new MsgUnifiedEditorMonitor(this);
-    connect(mMsgMonitor, SIGNAL(enableSend(bool)), this, SLOT(enableSendButton(bool)));
-
-    mToField = new MsgUnifiedEditorAddress( LOC_TO, mContentWidget );
+    mMainLayout->setSpacing(vItemSpacing); 
+    
+    mScrollArea = new MsgUnifiedEditorScrollArea(mMsgMonitor,this);
+    mMainLayout->addItem(mScrollArea); 
+    
+    mBodyEditor = new MsgUnifiedEditorBodyEditor(this);
+    
+    connect(mScrollArea,SIGNAL(enableMenuAction(int,bool)),this,SLOT(enableMenuAction(int,bool)));
     
-    mBody = new MsgUnifiedEditorBody( mContentWidget);
-
-    mMainLayout->addItem(mToField);
-    mMainLayout->addItem(mBody);
- 
-    //Set the invalid msg id
-    mOpenedMessageId.setId(-1);
-
-    connect(mToField, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mToField, SIGNAL(contentChanged()),
-            mMsgMonitor, SLOT(handleContentChange()));
-    connect(mToField, SIGNAL(contentChanged()),this,SLOT(onContentChanged()));
+    connect(mBodyEditor, SIGNAL(contentsChanged(const QVariant&)),
+            mMsgMonitor,SLOT(handleContentsChanged(const QVariant&)));
+    
+    connect(mMsgMonitor,SIGNAL(enableSend(bool)),
+            mBodyEditor,SLOT(enableSendButton(bool)));
     
-    connect(mBody, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mBody, SIGNAL(contentChanged()),this,SLOT(onContentChanged()));
-    connect(mBody, SIGNAL(contentChanged()),
-            mMsgMonitor, SLOT(handleContentChange()));
-    connect(mBody, SIGNAL(enableSendButton(bool)), this, SLOT(enableSendButton(bool)));    
+    connect(mBodyEditor,SIGNAL(sendMessage()),this,SLOT(send()));
+    
+    connect(mMsgMonitor,SIGNAL(contentsChanged()),this,SLOT(onContentChanged()));
+    
+    mMainLayout->addItem(mBodyEditor);
     
 }
 
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::addMenu
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorView::addMenu()
 {
     //Create Menu Options
     HbMenu* mainMenu = this->menu();
-    mainMenu->setFocusPolicy(Qt::NoFocus);
-	
-    //if subject field / cc,bcc fields are already present don't add corresponding actions.
-    if(!mSubjectField)
-    {
-        mSubjectAction = mainMenu->addAction(LOC_ADD_SUBJECT);
-    }
+    mainMenu->setFocusPolicy(Qt::NoFocus); 
+    
+    //attach sub menu
+    HbMenu* attachMenu = mainMenu->addMenu(LOC_ATTACH);
+    mPhotoAction = attachMenu->addAction(LOC_PHOTO,this,SLOT(fetchImages()));
+    mSoundAction = attachMenu->addAction(LOC_SOUND,this,SLOT(fetchAudio()));
+    attachMenu->addAction(LOC_BUSINESS_CARD,this,SLOT(fetchContacts()));
     
-    if(!mCcField)
-    {
-        mCcBccAction = mainMenu->addAction(LOC_ADD_CC_BCC);
-    }
+    //subject action
+    mSubjectAction = mainMenu->addAction(LOC_ADD_SUBJECT);
+    //CcBcc action
+    mCcBccAction = mainMenu->addAction(LOC_ADD_CC_BCC);
+    connect(mSubjectAction,SIGNAL(triggered()),this, SLOT(addSubject()));
+    connect(mCcBccAction,SIGNAL(triggered()),this, SLOT(addCcBcc()));
     
+    //priority sub menu
     HbMenu* prioritySubMenu = mainMenu->addMenu(LOC_PRIORITY);
 
     HbAction* highPriorityAction = prioritySubMenu->addAction(LOC_HIGH);
@@ -268,19 +247,22 @@
     normalPriorityAction->setData(ConvergedMessage::Normal);
 
     HbAction* lowPriorityAction = prioritySubMenu->addAction(LOC_LOW);
-    lowPriorityAction->setData(ConvergedMessage::Low);
-
-    HbAction* deleteMsgAction = mainMenu->addAction(LOC_DELETE_MESSAGE);
+    lowPriorityAction->setData(ConvergedMessage::Low);    
 
-    connect(mSubjectAction,SIGNAL(triggered()),this, SLOT(addSubject()));
-    connect(mCcBccAction,SIGNAL(triggered()),this, SLOT(addCcBcc()));
-    connect(highPriorityAction, SIGNAL(triggered()), this, SLOT(changePriority()));
-    connect(normalPriorityAction, SIGNAL(triggered()), this, SLOT(changePriority()));
-    connect(lowPriorityAction, SIGNAL(triggered()), this, SLOT(changePriority()));
+    connect(highPriorityAction, SIGNAL(triggered()), mScrollArea, SLOT(changePriority()));
+    connect(normalPriorityAction, SIGNAL(triggered()), mScrollArea, SLOT(changePriority()));
+    connect(lowPriorityAction, SIGNAL(triggered()), mScrollArea, SLOT(changePriority()));
+    
+	
+    HbAction* deleteMsgAction = mainMenu->addAction(LOC_DELETE_MESSAGE);
     connect(deleteMsgAction,SIGNAL(triggered()),this, SLOT(deleteMessage()));
 
 }
 
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::openDraftsMessage
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorView::openDraftsMessage(const QVariantList& editorData)
 {
     // unpack editor's data
@@ -302,11 +284,9 @@
         mPluginLoader->getUniEditorPlugin(messageType);
 
     mOpenedMessageId.setId(messageId.getId());
-    mmOpenedMessageType = messageType;
 
     //Fetch the converged message from the msgId
-    ConvergedMessage* msg;
-    msg = pluginInterface->convertFrom(messageId.getId());
+    ConvergedMessage* msg = pluginInterface->convertFrom(messageId.getId());
 
     if( msg != NULL )
     {
@@ -317,17 +297,19 @@
             mOriginatingSME = msg->toAddressList().at(0)->address();
         }
         //Populate the content inside editor
-        populateContentIntoEditor(*msg,true); // true as it is  draft message
+        populateContentIntoEditor(*msg,true,true); // true as it is  draft message
         delete msg;
     }
     
     mCanSaveToDrafts = false;  
 }
 
-void MsgUnifiedEditorView::fetchMessageFromStore(
-        ConvergedMessageId& messageId,
-        ConvergedMessage::MessageType messageType,
-        int editorOperation)
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::fetchMessageFromStore
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::fetchMessageFromStore(ConvergedMessageId& messageId,
+    ConvergedMessage::MessageType messageType, int editorOperation)
 {
     if(!mPluginLoader)
     {
@@ -336,13 +318,11 @@
     UniEditorPluginInterface* pluginInterface = NULL;
     if( messageType == ConvergedMessage::Mms )
     {
-        pluginInterface =
-                mPluginLoader->getUniEditorPlugin(ConvergedMessage::Mms);
+        pluginInterface = mPluginLoader->getUniEditorPlugin(ConvergedMessage::Mms);
     }
     else // For sms,vcard,vcal cases
     {
-        pluginInterface =
-                mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);
+        pluginInterface = mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);
     }
 
     //Fetch the converged message from the msgId
@@ -361,11 +341,15 @@
             }
         }
         //Populate the content inside editor
-        populateContentIntoEditor(*msg);
+        populateContentIntoEditor(*msg,false,true);
         delete msg;
     }
 }
 
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::populateContent
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorView::populateContent(const QVariantList& editorData)
 {
     // unpack editor's data
@@ -387,8 +371,8 @@
     {
         case MsgBaseView::ADD_SUBJECT:
         {
-            addSubject();
-            setFocus(mSubjectField);
+            //setfocus also.
+            addSubject(true);
         }
         break;
         case MsgBaseView::ADD_VCARD:
@@ -401,373 +385,90 @@
             fetchMessageFromStore(*messageDetails->id(),
                                    messageDetails->messageType(),
                                    UniEditorPluginInterface::Forward);
+            return;
         }
-        break;
         case MsgBaseView::REPLY_MSG:
         {
             fetchMessageFromStore(*messageDetails->id(),
                                    messageDetails->messageType(),
                                    UniEditorPluginInterface::Reply);
+            return;
         }
-        break;
         case MsgBaseView::REPLY_ALL_MSG:
         {
             fetchMessageFromStore(*messageDetails->id(),
                                    messageDetails->messageType(),
                                    UniEditorPluginInterface::ReplyAll);
+            return;
         }
-        break;
         default:
         break;
     }
 
-    // additional common operations for non-forwarded messages
-    if(editorOp != MsgBaseView::FORWARD_MSG)
-    {
-        if(editorOp == MsgBaseView::ADD_RECIPIENTS)
-        {
-            // CV sends contact card address as the first address
-            ConvergedMessageAddressList toAddresses = 
-                    messageDetails->toAddressList();
-            int addrCount = toAddresses.count();
-            if(addrCount > 0)
-            {
-                // add contact card address first
-                ConvergedMessageAddress *firstAddress =
-                        new ConvergedMessageAddress();
-                firstAddress->setAlias(toAddresses.at(0)->alias());
-                firstAddress->setAddress(toAddresses.at(0)->address());
-                ConvergedMessageAddressList firstList;
-                firstList << firstAddress;
-                mToField->setAddresses(firstList);
-            
-                // add remaining contacts now
-                ConvergedMessageAddressList otherList;
-                for(int i=1; i<addrCount; i++)
-                {
-                    otherList << toAddresses.at(i);
-                }
-                mToField->setAddresses(otherList);
-            }
-        }
-        else
-        {
-            mToField->setAddresses(messageDetails->toAddressList());
-        }
-        QString bodyTxt = messageDetails->bodyText();
-        mBody->setText(bodyTxt);
+    populateContentIntoEditor(*messageDetails,false,false);
 
-        int attachmentCount = messageDetails->attachments().count();
-        QStringList pendingAttList;
-        for(int i=0; i<attachmentCount; i++)
-        {
-            int imageSize=0;
-            QString mimeType;
-            TMsgMediaType mediaType = EMsgMediaUnknown;
-            QString filePath = messageDetails->attachments().at(i)->filePath();
-            
-           
-            UniEditorGenUtils* genUtils = q_check_ptr(new UniEditorGenUtils);
-            
-            TRAP_IGNORE(genUtils->getFileInfoL(filePath,imageSize,
-                                           mimeType,mediaType));
-            delete genUtils;
-            switch(mediaType)
-            {
-                case EMsgMediaImage:
-                {
-                    mBody->setImage(filePath);
-                }
-                break;
-                 case EMsgMediaAudio:
-                {
-                    mBody->setAudio(filePath);
-                }
-                break;
-                default:
-                {
-                    pendingAttList << filePath;
-                }
-                break;
-            }
-        }
-        // add pending attachments in bulk
-        addAttachments(pendingAttList);
-    }
     delete messageDetails; 
 }
 
-void MsgUnifiedEditorView::populateContentIntoEditor(
-    const ConvergedMessage& messageDetails,bool draftMessage)
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::populateContentIntoEditor
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::populateContentIntoEditor(const ConvergedMessage& messageDetails,
+                                                     bool draftMessage,
+                                                     bool checkForInline)
 {
     // skip first-time MMS type switch note for draft
-    mMsgMonitor->setSkipNote(true);
-    mToField->skipMaxRecipientQuery(true);
-
-    mToField->setAddresses(messageDetails.toAddressList(),draftMessage);
-    if(messageDetails.ccAddressList().count() > 0 )
-    {
-        if(!mCcField)
-        {
-        addCcBcc();
-        }
-        mCcField->setAddresses(messageDetails.ccAddressList(),draftMessage);
-    }
-    if(messageDetails.bccAddressList().count() > 0 )
+    if(draftMessage)
     {
-        if(!mBccField)
-        {
-        addCcBcc();
-        }
-        mBccField->setAddresses(messageDetails.bccAddressList(),draftMessage);
-    }
-    if(messageDetails.subject().size() > 0)
-    {
-       if(!mSubjectField)
-       {
-           addSubject();
-       }
-       mSubjectField->setText(messageDetails.subject());
-    }
-
-    if(messageDetails.priority()==ConvergedMessage::High ||
-            messageDetails.priority() == ConvergedMessage::Low)
-    {
-        if(!mSubjectField)
-        {
-            addSubject();
-        }
-        mSubjectField->setPriority(messageDetails.priority());
+    mMsgMonitor->setSkipNote(true);
     }
 
-    QString bodyTxt = messageDetails.bodyText();
-    mBody->setText(bodyTxt);
-
-    ConvergedMessageAttachmentList attachmentList =
-        messageDetails.attachments();
-    int attachmentCount = attachmentList.count();
-     
-    UniEditorGenUtils* genUtils = q_check_ptr(new UniEditorGenUtils);
-
-    QStringList pendingAttList;
-    for( int i=0; i < attachmentCount; i++ )
-    {
-        QString filePath = messageDetails.attachments().at(i)->filePath();
-
-        if(attachmentList.at(i)->attachmentType() ==
-            ConvergedMessageAttachment::EInline)
-        {
-            int imageSize=0;
-            QString mimeType;
-            TMsgMediaType mediaType = EMsgMediaUnknown;
-            TRAP_IGNORE(genUtils->getFileInfoL(filePath,imageSize,
-                mimeType,mediaType));
+    //scrollarea populate contents
+    mScrollArea->populateContent(messageDetails,draftMessage,checkForInline);
 
-            switch(mediaType)
-            {
-                case EMsgMediaImage:
-                {
-                    mBody->setImage(filePath,draftMessage);
-                    break;
-                }
-                case EMsgMediaAudio:
-                {
-                    mBody->setAudio(filePath);
-                    break;
-                }
-                default:
-                {
-                    pendingAttList << filePath;
-                    break;
-                }
-            }
-        }
-        else
-        {
-            pendingAttList << filePath;
-        }
-    }
-    // add pending attachments to editor
-    addAttachments(pendingAttList);
+    //body editor populate contents
+    mBodyEditor->populateContent(messageDetails);
 
-    delete genUtils;
-    // ensure that any msg-type change after this are shown
-    mToField->skipMaxRecipientQuery(false);
     mMsgMonitor->setSkipNote(false);
 }
 
-void MsgUnifiedEditorView::addToolBar()
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::addSubject
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::addSubject(bool needFocus)
 {
-    //Create Tool Bar
-    HbToolBar *toolBar = new HbToolBar();
-    toolBar->setOrientation(Qt::Horizontal);
-    
-    //tool bar extension for attach action.
-    HbToolBarExtension* attachExtension = new HbToolBarExtension();
-    mAttachAction = toolBar->addExtension(attachExtension);    
-    mAttachAction->setIcon(HbIcon(ATTACH_ICON));
-    
-    mTBExtnContentWidget = new HbListWidget();
-    mTBExtnContentWidget->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
-    mTBExtnContentWidget->addItem(LOC_PHOTO);
-    mTBExtnContentWidget->addItem(LOC_SOUND);
-    mTBExtnContentWidget->addItem(LOC_BUSINESS_CARD);
-
-    HbListViewItem *prototype = mTBExtnContentWidget->listItemPrototype();
-    HbFrameBackground frame(POPUP_LIST_FRAME, HbFrameDrawer::NinePieces);
-    prototype->setDefaultFrame(frame);
-
-    connect(mTBExtnContentWidget, SIGNAL(activated(HbListWidgetItem*)),
-            this, SLOT(handleViewExtnActivated(HbListWidgetItem*)));
-    connect(mTBExtnContentWidget, SIGNAL(activated(HbListWidgetItem*)),
-            attachExtension, SLOT(close()));
-
-    attachExtension->setContentWidget(mTBExtnContentWidget);
-
-    //Add Action to the toolbar and show toolbar
-    mSendAction = toolBar->addAction(HbIcon(SEND_ICON),QString(),this,SLOT(send()));
-    mSendAction->setDisabled(true);
-
-    setToolBar(toolBar);
-}
-
-void MsgUnifiedEditorView::addSubject()
-{
-    if(mSubjectField)
-    { // do nothing if already present
-        return;
-    }
-
-    int index =0;
-    int offset = 1;
-    if(mAttachmentContainer)
-    {
-        ++offset;
-    }
-    index = mMainLayout->count() - offset;
-
-    mSubjectField = new MsgUnifiedEditorSubject( mContentWidget);
-    
-    mMainLayout->insertItem(index,mSubjectField);
-    connect(mSubjectField, SIGNAL(contentChanged()),
-            mMsgMonitor, SLOT(handleContentChange()));
-    connect(mSubjectField, SIGNAL(contentChanged()),this,SLOT(onContentChanged()));
-    
-    //set focus to subject field.
+    //triggered from menu so need a focus.
     HbAction* subjectAction = qobject_cast<HbAction*>(this->sender());
     if(subjectAction)
     {
-        setFocus(mSubjectField);
+        needFocus = true;
     }
-    
-    // remove mainmenu's "Add Subject" action
-    if(mSubjectAction)
-    {
-        HbMenu* mainMenu = this->menu();
-        mainMenu->removeAction(mSubjectAction);
-        mSubjectAction->setParent(NULL);
-        delete mSubjectAction;
-    }
+    mScrollArea->addSubject(needFocus);
 }
 
-void MsgUnifiedEditorView::addCcBcc()
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::addCcBcc
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::addCcBcc(bool needFocus)
 {
-    if(mCcField && mBccField)
-    { // do nothing if already present
-        return;
+    //set focus to Cc field.
+    HbAction* ccBccAction = qobject_cast<HbAction*>(this->sender());
+    if(ccBccAction)
+    {
+        needFocus = true;
     }
 
-    mCcField    = new MsgUnifiedEditorAddress( LOC_CC, mContentWidget );
-    mBccField   = new MsgUnifiedEditorAddress( LOC_BCC, mContentWidget );
-    mCcField->skipMaxRecipientQuery(true);
-    mBccField->skipMaxRecipientQuery(true);
-
-    connect(mCcField, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mCcField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(handleContentChange()));
-    connect(mCcField, SIGNAL(contentChanged()),this,SLOT(onContentChanged()));
-    
-    connect(mBccField, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mBccField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(handleContentChange()));
-    connect(mBccField, SIGNAL(contentChanged()),this,SLOT(onContentChanged()));
-
-    HbWidget* groupWidget = new HbWidget(mContentWidget);
-    groupWidget->setContentsMargins(0,0,0,0);
-    
-    QGraphicsLinearLayout* ccBccLayout = new QGraphicsLinearLayout(Qt::Vertical, groupWidget);
-    ccBccLayout->setContentsMargins(0,0,0,0);
-
-    qreal vItemSpacing = 0.0;    
-    style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);
-    ccBccLayout->setSpacing(vItemSpacing);
-    ccBccLayout->addItem(mCcField);
-    ccBccLayout->addItem(mBccField);
-
-    HbGroupBox* groupBox = new HbGroupBox(0);  
-    groupBox->setObjectName("groupBox");
-    
-    groupBox->setContentWidget(groupWidget);
-    groupBox->setHeading(LOC_OTHER_RECIPIENTS_EXPAND);
-    mMainLayout->insertItem(1,groupBox);
-    connect(groupBox, SIGNAL(toggled(bool)), this, SLOT(updateOtherRecipientCount(bool)));
-    
-    // add subject field too
+    mScrollArea->addCcBcc(needFocus);
     addSubject();
-
-    //set focus to Cc field.
-    HbAction* ccBccAction = qobject_cast<HbAction*>(this->sender());
-    if(mCcBccAction)
-    {
-        setFocus(mCcField);
-    }
-    
-    // remove mainmenu's "Add Cc/Bcc" & "Add Subject" actions
-    if(mCcBccAction)
-    {
-    HbMenu* mainmenu = this->menu();
-    mainmenu->removeAction(mCcBccAction);
-    mCcBccAction->setParent(NULL);
-    delete mCcBccAction;
-    }
-    
-    this->updateGeometry();
 }
 
-void MsgUnifiedEditorView::updateOtherRecipientCount(bool state)
-{
-    HbGroupBox* groupBox = qobject_cast<HbGroupBox*>(sender());
-    if(groupBox)
-    {
-        if(!state)
-        {
-           groupBox->setHeading(LOC_OTHER_RECIPIENTS_EXPAND);
-        }
-        else
-        {
-            int addrCount = mCcField->addressCount();
-            addrCount += mBccField->addressCount();
-            if(addrCount > 0)
-            {
-                groupBox->setHeading(LOC_OTHER_RECIPIENTS(addrCount));    
-            }
-        }
-    }
-}
-
-void MsgUnifiedEditorView::changePriority()
-{
-    HbAction* action = qobject_cast<HbAction*>(sender());
-
-    ConvergedMessage::Priority priority = ConvergedMessage::Normal;
-   if(action)
-        {
-        int data = action->data().toInt();
-        priority = ConvergedMessage::Priority(data);
-        }
-
-    addSubject();
-    mSubjectField->setPriority(priority);
-}
-
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::deleteMessage
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorView::deleteMessage()
 {
     HbMessageBox::question(LOC_NOTE_DELETE_MESSAGE,this,
@@ -775,76 +476,26 @@
                            HbMessageBox::Delete | HbMessageBox::Cancel);
 }
 
-void MsgUnifiedEditorView::removeAttachmentContainer()
-{
-    if(mAttachmentContainer)
-    {
-        mMainLayout->removeItem(mAttachmentContainer);
-        mAttachmentContainer->setParent(NULL);
-        delete mAttachmentContainer;
-        mAttachmentContainer = NULL;
-    }
-}
-
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::addAttachments
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorView::addAttachments(QStringList files)
 {    
-    int fcount = files.count();
-    int i=0;
-    for(i=0; i<fcount; i++)
-    {
-        int status = addAttachment(files.at(i));
-        if(status == MsgAttachmentContainer::EAddSizeExceed)
-        {
-            QString displayStr = QString(LOC_UNABLE_TO_ADD_ATTACHMENTS)
-                    .arg(fcount-i).arg(fcount);
-            HbNotificationDialog::launchDialog(displayStr);
-            break;
-        }
-    }
+    mScrollArea->addAttachments(files);
 }
 
-int MsgUnifiedEditorView::addAttachment(const QString& filepath)
-{
-    // do nothing if filepath is empty
-    if(filepath.isEmpty())
-    {
-        return MsgAttachmentContainer::EAddSuccess;
-    }
-
-    if(!mAttachmentContainer)
-    {
-        mAttachmentContainer = new MsgAttachmentContainer( mContentWidget);
-        connect(mAttachmentContainer, SIGNAL(emptyAttachmentContainer()),
-                this, SLOT(removeAttachmentContainer()));
-        connect(mAttachmentContainer, SIGNAL(contentChanged()),
-                mMsgMonitor, SLOT(handleContentChange()));
-        connect(mAttachmentContainer, SIGNAL(contentChanged()),
-                this,SLOT(onContentChanged()));
-        
-        int index = mMainLayout->count() - 1;
-        mMainLayout->insertItem(index,mAttachmentContainer);
-    }
-
-    int ret = mAttachmentContainer->addAttachment(filepath);
-    if(ret != MsgAttachmentContainer::EAddSuccess)
-    {
-        // delete container, if it is empty
-        if(mAttachmentContainer->count() == 0)
-        {
-            removeAttachmentContainer();
-        }
-    }
-    return ret;
-}
-
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::send
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorView::send()
 {
     activateInputBlocker();
-    
+
     // first run the address validation tests
-    if( !mToField->validateContacts() ||
-        (mCcField && !mCcField->validateContacts()) ||
-        (mBccField && !mBccField->validateContacts()) )
+    if(!mScrollArea->contactsValid() ||
+       !MsgUnifiedEditorMonitor::readyForSend())
     {
         deactivateInputBlocker();
         return;
@@ -855,38 +506,7 @@
     ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType();
     msg.setMessageType(messageType);
 
-    // we need to remove duplicate addresses
-    bool removeDuplicates = true;
-    ConvergedMessageAddressList addresses =
-            mToField->addresses(removeDuplicates);
-    if(messageType == ConvergedMessage::Sms &&
-       addresses.isEmpty())
-    {
-        // no recipient specified for sms, do not send msg
-        deactivateInputBlocker();
-        return;
-    }
 
-    ConvergedMessageAddressList ccAddresses;
-    ConvergedMessageAddressList bccAddresses;
-    if(mCcField)
-    {
-        ccAddresses = mCcField->addresses(removeDuplicates);
-    }
-    if(mBccField)
-    {
-        bccAddresses = mBccField->addresses(removeDuplicates);
-    }
-    if( messageType == ConvergedMessage::Mms &&
-            addresses.isEmpty() &&
-            ccAddresses.isEmpty() &&
-            bccAddresses.isEmpty())
-    {
-        // no recipient specified for mms, do not send msg
-        deactivateInputBlocker();
-        return;
-    }
-    
     //close vkb before switching view.
     mVkbHost->closeKeypad(true);
 
@@ -901,7 +521,7 @@
     MsgSendUtil *sendUtil = new MsgSendUtil(this);
     int sendResult = sendUtil->send(msg);
     delete sendUtil;
-    
+
     // all checks and validations happen before send
     if( sendResult == KErrNone)
     {
@@ -917,54 +537,34 @@
 
             UniEditorPluginInterface* pluginInterface =
                 mPluginLoader->getUniEditorPlugin(messageType);
-            //TODO delete the entry
+            //delete the entry
             pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
         }
 
-        ConvergedMessageAddressList addrList = addresses;
-        QString receipient;
-
+        ConvergedMessageAddressList addrList = msg.toAddressList() +
+                                               msg.ccAddressList() + 
+                                               msg.bccAddressList();
+        
         int recepientCount = addrList.count();
-        if(recepientCount)
-        {
-            receipient = addrList.at(0)->address();
-        }
 
-        if( mCcField && mBccField)
-        {
-            addrList = ccAddresses;
-            int ccCount = addrList.count();
-            recepientCount += ccCount;
-            if(ccCount)
-            {
-                receipient = addrList.at(0)->address();
-            }
+        QVariantList params;
 
-            addrList = bccAddresses;
-            int bccCount = addrList.count();
-            recepientCount += bccCount;
-            if(bccCount)
-            {
-                receipient = addrList.at(0)->address();
-            }
+        if(recepientCount == 1 )
+        {
+            params << MsgBaseView::CV;  // target view
+            params << MsgBaseView::UNIEDITOR; // source view
+            QString receipient = addrList.at(0)->address();
+            params << receipient;
         }
-        
-    QVariantList params;
-
-    if(recepientCount == 1 )
+        else
         {
-        params << MsgBaseView::CV;  // target view
-        params << MsgBaseView::UNIEDITOR; // source view
-
-        params << receipient;
-        }
-    else
-        {
-        params << MsgBaseView::CLV;// target view
-        params << MsgBaseView::UNIEDITOR; // source view
+            params << MsgBaseView::CLV;// target view
+            params << MsgBaseView::UNIEDITOR; // source view
         }
         deactivateInputBlocker();
         emit switchView(params);
+        
+        mCanSaveToDrafts = false;
     }
     else
     {
@@ -974,19 +574,23 @@
             if (messageType == ConvergedMessage::Sms)
             {
                 HbMessageBox::question(LOC_DIALOG_SMS_SETTINGS_INCOMPLETE,
-                                       this,SLOT(onDialogSmsSettings(HbAction*)),
-                                       HbMessageBox::Ok | HbMessageBox::Cancel);
+                    this,SLOT(onDialogSmsSettings(HbAction*)),
+                    HbMessageBox::Ok | HbMessageBox::Cancel);
             }
             else
             {
                 HbMessageBox::question(LOC_DIALOG_MMS_SETTINGS_INCOMPLETE,
-                                       this,SLOT(onDialogMmsSettings(HbAction*)),                             
-                                       HbMessageBox::Ok | HbMessageBox::Cancel);
+                    this,SLOT(onDialogMmsSettings(HbAction*)),                             
+                    HbMessageBox::Ok | HbMessageBox::Cancel);
             }
         }
     }
 }
 
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::packMessage
+// @see header file
+//---------------------------------------------------------------
 int MsgUnifiedEditorView::packMessage(ConvergedMessage &msg, bool isSave)
 {
     // reset reply-path if originating SME constraint is broken
@@ -1003,157 +607,24 @@
 
     ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType();
     msg.setMessageType(messageType);
-    // If isSave is true (save to draft usecase), then don't remove duplicates
-    // If isSave is false (send usecase), then remove duplicates
-    bool removeDuplicates = !isSave;
-    ConvergedMessageAddressList addresses = 
-            mToField->addresses(removeDuplicates);
-    ConvergedMessageAddressList ccAddresses;
-    ConvergedMessageAddressList bccAddresses;
-    ConvergedMessageAttachmentList mediaList;
-    int errorCode = 0;
-	//Don't format the addresses for save to drfats case
-	if(!isSave)
-	{
-       formatAddresses(addresses);
-    }
-	
-    msg.addToRecipients(addresses);
-    msg.setBodyText(mBody->text());
     msg.setDirection(ConvergedMessage::Outgoing);
     QDateTime time = QDateTime::currentDateTime();
     msg.setTimeStamp(time.toTime_t());
-
-    if(messageType == ConvergedMessage::Mms)
-    {
-        if(mCcField)
-        {
-            ccAddresses = mCcField->addresses(removeDuplicates);
-        }
-
-        if(mBccField)
-        {
-            bccAddresses = mBccField->addresses(removeDuplicates);
-        }
-
-        if(removeDuplicates)
-        {
-            int matchDigitsCount = MsgUnifiedEditorAddress::contactMatchDigits();
-            //comapre cc and to field,remove duplicate from cc
-            foreach(ConvergedMessageAddress *ccAddress,ccAddresses)
-            {
-                foreach(ConvergedMessageAddress *toAddress,addresses)
-                {
-                    if(0 == ccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount)))
-                    {
-                        ccAddresses.removeOne(ccAddress);
-                    }
-                }
-            }
-            //comapre bcc and cc field,remove duplicate from bcc
-            foreach(ConvergedMessageAddress *bccAddress,bccAddresses)
-            {
-                foreach(ConvergedMessageAddress *ccAddress,ccAddresses)
-                {
-                    if(0 == bccAddress->address().right(matchDigitsCount).compare(ccAddress->address().right(matchDigitsCount)))
-                    {
-                        bccAddresses.removeOne(bccAddress);
-                    }
-                }
-            }
-            //comapre bcc and to field,remove duplicate from bcc
-            foreach(ConvergedMessageAddress *bccAddress,bccAddresses)
-            {
-                foreach(ConvergedMessageAddress *toAddress,addresses)
-                {
-                    if(0 == bccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount)))
-                    {
-                        bccAddresses.removeOne(bccAddress);
-                    }
-                }
-            }
-        }
-
-        if(ccAddresses.count()>0)
-        {
-		//Don't format the addresses for save to drfats case
-	    if(!isSave)
-	    {
-           formatAddresses(ccAddresses);
-        }        
-        msg.addCcRecipients(ccAddresses);
-        }
-        if(bccAddresses.count()>0)
-        {
-		//Don't format the addresses for save to drfats case
-	    if(!isSave)
-	    {
-           formatAddresses(bccAddresses);        
-		}
-        msg.addBccRecipients(bccAddresses);
-        }
-        if(mSubjectField)
-        {
-            msg.setSubject(mSubjectField->text());
-            msg.setPriority(mSubjectField->priority());
-        }
-
-        QStringList mediafiles(mBody->mediaContent());
-        if (!mediafiles.isEmpty())
-        {
-            for (int i = 0; i < mediafiles.size(); ++i)
-            {
-                if(QFile::exists(mediafiles.at(i)))
-                {
-                ConvergedMessageAttachment* attachment =
-                    new ConvergedMessageAttachment(
-                        mediafiles.at(i),
-                        ConvergedMessageAttachment::EInline);
-                mediaList << attachment;
-                }
-                else
-                {   mBody->removeMediaContent(mediafiles.at(i));
-                    errorCode = KErrNotFound;
-                }
-            }
-
-        }
-        if(mediaList.count() > 0)
-        {
-            msg.addAttachments(mediaList);
-        }
-    }
-
-    // sms/mms attachment list
-    ConvergedMessageAttachmentList attachmentList;
-        if(mAttachmentContainer)
-        {
-            MsgUnifiedEditorAttachmentList editorAttachmentList =
-                mAttachmentContainer->attachmentList();
-                for (int i = 0; i < editorAttachmentList.count(); ++i)
-                {
-                    if(QFile::exists(editorAttachmentList.at(i)->path()))
-                    {
-                        ConvergedMessageAttachment* attachment =
-                                                new ConvergedMessageAttachment(
-                                                    editorAttachmentList.at(i)->path(),
-                                                    ConvergedMessageAttachment::EAttachment);
-                                            attachmentList << attachment;    
-                    }
-                    else
-                    {
-                        mAttachmentContainer->deleteAttachment(editorAttachmentList.at(i));
-                        errorCode = KErrNotFound;
-                    }   
-                }
-            }
-        if(attachmentList.count() > 0)
-        {
-            msg.addAttachments(attachmentList);
-        }
-        return errorCode;
+    
+    
+    //pack message data from mscrollarea.
+    int errorCode = mScrollArea->packMessage(msg,isSave);
+    
+    //pack message data from body editor.
+    mBodyEditor->packMessage(msg);
+    
+    return errorCode;
 }
 
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::saveContentToDrafts
+// @see header file
+//---------------------------------------------------------------
 int MsgUnifiedEditorView::saveContentToDrafts()
 {
     if(!mCanSaveToDrafts)
@@ -1164,8 +635,6 @@
     activateInputBlocker();
     ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType();
 
-    ConvergedMessageAddressList addresses = mToField->addresses();
-
     UniEditorPluginInterface* pluginInterface = NULL;
 
     if( mOpenedMessageId.getId() != -1)
@@ -1175,77 +644,29 @@
             mPluginLoader = new UniEditorPluginLoader(this);
         }
 
-        pluginInterface =
-            mPluginLoader->getUniEditorPlugin(messageType);
-    }
-
-    if(messageType == ConvergedMessage::Sms &&
-            addresses.isEmpty() &&
-            MsgUnifiedEditorMonitor::bodySize() <= 0 &&
-            MsgUnifiedEditorMonitor::containerSize() <= 0)
-    {
-        if(mOpenedMessageId.getId() != -1)
-        {
-        pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
-        }
-
-        // if empty msg, do not save
-        deactivateInputBlocker();
-        return INVALID_MSGID;
+        pluginInterface = mPluginLoader->getUniEditorPlugin(messageType);
     }
 
-    ConvergedMessageAddressList ccAddresses;
-    ConvergedMessageAddressList bccAddresses;
-    if(mCcField)
-    {
-        ccAddresses = mCcField->addresses();
-    }
-    if(mBccField)
-    {
-        bccAddresses = mBccField->addresses();
-    }
-    int subectSize =0;
-    if(mSubjectField)
-    {
-        subectSize = mSubjectField->text().size();
-    }
-
-    if( messageType == ConvergedMessage::Mms &&
-            addresses.isEmpty() &&
-            ccAddresses.isEmpty() &&
-            bccAddresses.isEmpty() &&
-            subectSize <= 0 &&
-            MsgUnifiedEditorMonitor::bodySize() <= 0 &&
-            MsgUnifiedEditorMonitor::containerSize() <= 0)
+    // if empty msg, do not save
+    if( MsgUnifiedEditorMonitor::messageSize() <= 0 && 
+        MsgUnifiedEditorMonitor::msgAddressCount() <= 0 )
     {
         if(mOpenedMessageId.getId() != -1)
         {
             pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
         }
-        // if empty msg, do not send
+        
         deactivateInputBlocker();
         return INVALID_MSGID;
     }
+    
     ConvergedMessage msg;
     int result = packMessage(msg, true);
     if(result == KErrNotFound)
         {
         HbNotificationDialog::launchDialog(LOC_NOTE_FILES_MISSED_DRAFTS);
-        if(messageType == ConvergedMessage::Sms &&
-                    addresses.isEmpty() &&
-                    MsgUnifiedEditorMonitor::bodySize() <= 0 &&
-                    MsgUnifiedEditorMonitor::containerSize() <= 0)
-            {
-                if(mOpenedMessageId.getId() != -1)
-                {
-                pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
-                }
-
-                // if empty msg, do not save
-                deactivateInputBlocker();
-                return INVALID_MSGID;
-            }
         }
+    
     // save to drafts
     MsgSendUtil *sendUtil = new MsgSendUtil(this);
     int msgId = sendUtil->saveToDrafts(msg);
@@ -1267,13 +688,21 @@
         {
         HbDeviceNotificationDialog::notification("", LOC_SAVED_TO_DRAFTS);
         }
+    
+    mCanSaveToDrafts = false;
+    
     return msgId;
 }
 
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::handleKeyEvent
+// @see header file
+//---------------------------------------------------------------
 bool MsgUnifiedEditorView::handleKeyEvent(int key)
 {
     bool eventHandled = false;
-    if (Qt::Key_Yes == key && mSendAction->isEnabled()) {
+    if (Qt::Key_Yes == key) {
         eventHandled = true;
         send();
     }
@@ -1281,16 +710,6 @@
     return eventHandled;
 }
 
-void MsgUnifiedEditorView::resizeEvent( QGraphicsSceneResizeEvent * event )
-{
- Q_UNUSED(event)
- #ifdef _DEBUG_TRACES_
- qDebug()<<"resize event";
-#endif
-
- mContentWidget->resize(this->rect().width(),this->rect().height()+1);
-}
-
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::createVCards
 // @see header file
@@ -1415,24 +834,7 @@
         searchFileName.append(FILE_EXTN);
 
         // check if filename is already used by an attachment in container
-        bool alreadyExists = false;
-        if(mAttachmentContainer)
-        {
-            MsgUnifiedEditorAttachmentList attList =
-                    mAttachmentContainer->attachmentList();
-            int attCount = attList.count();
-            for(int j=0; j<attCount; j++)
-            {
-                QFileInfo fileinfo(attList.at(j)->path());
-                if(searchFileName == fileinfo.fileName())
-                {
-                    alreadyExists = true;
-                    break;
-                }
-            }
-        }
-
-        if(!alreadyExists)
+        if(!mScrollArea->fileNameInUse(searchFileName))
         {
             if(i>0)
             {
@@ -1447,27 +849,6 @@
     return filepath;
 }
 
-void MsgUnifiedEditorView::handleViewExtnActivated(HbListWidgetItem* item)
-    {
-    QString itemText = item->text();
-    
-    if(itemText == LOC_PHOTO)
-        {
-        //launch photo picker.
-        fetchImages();  
-        }
-    else if(itemText == LOC_SOUND)
-        {
-        //launch audio picker
-        fetchAudio();
-        }
-    else if(itemText == LOC_BUSINESS_CARD)
-        {
-        //launch contact card picker.
-        fetchContacts();
-        }
-   
-}
 
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::fetchContacts
@@ -1488,7 +869,7 @@
         return;
     }
 	
-    request->setSynchronous(false); // synchronous
+    request->setSynchronous(false); // asynchronous
 	
     // Result handlers
     connect (request, SIGNAL(requestOk(const QVariant&)),
@@ -1524,7 +905,7 @@
         QCRITICAL_WRITE("AIW-ERROR: NULL request");
         return;
     }
-    request->setSynchronous(false); // synchronous
+    request->setSynchronous(false); // asynchronous
 
     connect(request, SIGNAL(requestOk(const QVariant&)),
         this, SLOT(imagesFetched(const QVariant&)));
@@ -1596,7 +977,7 @@
         if ( fileList.size()>0 )
         {
             QString filepath(QDir::toNativeSeparators(fileList.at(0)));
-            mBody->setImage(filepath);
+            mScrollArea->setImage(filepath);
         }
     }
 }
@@ -1637,14 +1018,57 @@
 }
 
 //---------------------------------------------------------------
-// MsgUnifiedEditorView::setAttachOptionEnabled
+// MsgUnifiedEditorView::enableMenuAction
 // @see header file
 //--------------------------------------------------------------
-void MsgUnifiedEditorView::setAttachOptionEnabled(
-        MsgUnifiedEditorView::TBE_AttachOption opt, bool enable)
+void MsgUnifiedEditorView::enableMenuAction(int action, bool enable)
 {
-    HbListWidgetItem* wgtItem = mTBExtnContentWidget->item(opt);
-    wgtItem->setEnabled(enable);
+    switch(action)
+    {
+    case SOUND:
+    {
+        if(mSoundAction)
+        {
+            mSoundAction->setEnabled(enable);
+        }
+        break;
+    }
+    case PHOTO:
+    {
+        if(mPhotoAction)
+        {
+            mPhotoAction->setEnabled(enable);
+        }
+        break;
+    }  
+    case SUBJECT: //subject action has to be removed
+    {
+        // remove mainmenu's "Add Subject" action
+        if(mSubjectAction)
+        {
+            this->menu()->removeAction(mSubjectAction);
+            mSubjectAction->setParent(NULL);
+            delete mSubjectAction;
+            mSubjectAction = NULL;
+        }
+        break;
+    }
+    case CCBCC: //CcBcc action has to be removed
+    {
+        // remove mainmenu's "Add Cc/Bcc" & "Add Subject" actions
+        if(mCcBccAction)
+        {
+            this->menu()->removeAction(mCcBccAction);
+            mCcBccAction->setParent(NULL);
+            delete mCcBccAction;
+            mCcBccAction = NULL;
+        }
+        break;
+    }
+    
+    default:
+        break;
+    }
 }
 
 //---------------------------------------------------------------
@@ -1655,55 +1079,220 @@
 {
     hideChrome(true); 
     
+    //get focussed object.
+    HbInputMethod* im =   HbInputMethod::activeInputMethod(); 
+    HbInputFocusObject* focusObj =   im->focusObject();
+    if(focusObj)
+    {
+        QObject* obj =   focusObj->object(); 
+        mFocusedWidget = qobject_cast<QGraphicsWidget*>(obj); 
+        HbAbstractEdit* editor = qobject_cast<HbAbstractEdit*>(obj);
+        if(editor)
+        {
+            connect(editor,SIGNAL(contentsChanged()),this,SLOT(ensureVisibility()));
+        }
+    }
+    
+    QRectF appRect = mVkbHost->applicationArea();
+    
+    if(this->mainWindow()->orientation() == Qt::Vertical)
+    {
+        this->setMaximumHeight(appRect.height());
+        mScrollArea->resize(-1,-1);
+    }
+    else
+    {
+        if(mFocusedWidget)
+        {
+            qreal vItemSpacing = 0.0;
+            style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing); 
+            
+            mMinHeight = mFocusedWidget->minimumHeight();
+            mMaxHeight = mFocusedWidget->maximumHeight();
+            qreal newHeight = appRect.height()-vItemSpacing-1;
+            mFocusedWidget->setMinimumHeight(newHeight);
+            mFocusedWidget->setMaximumHeight(newHeight);
+            mFocusedWidget->resize(mFocusedWidget->rect().width(),newHeight);
+
+        }
+    }
+    
+    //do layouting after some delay.
+    QTimer::singleShot(50,this,SLOT(doLayout()));
+    
     disconnect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened()));
+    connect(this->mainWindow(),SIGNAL(aboutToChangeOrientation()),this,SLOT(resetLayout()));
 }
-      
+
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::vkbClosed
 // @see header file
 //---------------------------------------------------------------
 void MsgUnifiedEditorView::vkbClosed()
 {
-    hideChrome(false);
+    hideChrome(false); 
+    
+    resetLayout();
+   
+    connect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened()));
     
-    connect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened()));
+    disconnect(this->mainWindow(),SIGNAL(aboutToChangeOrientation()),this,SLOT(resetLayout()));    
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::doLayout
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::doLayout()
+{
+    if(mFocusedWidget && mVkbHost->keypadStatus() == HbVkbHost::HbVkbStatusOpened)
+    {
+        if(this->mainWindow()->orientation() == Qt::Vertical)
+        {
+            ensureVisibility();
+        }
+        else 
+        {
+            qreal vItemSpacing = 0.0;
+            style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing); 
+            
+            if(mScrollArea->isAncestorOf(mFocusedWidget))
+            {
+                QPointF p = mScrollArea->mapFromScene(mFocusedWidget->scenePos());
+                mScrollArea->scrollContentsTo(p,0);
+                mScrollArea->enableScrolling(false);
+                mScrollArea->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff);
+            }
+
+            QPointF pp = mapFromScene(mFocusedWidget->scenePos());
+            qreal delta = pp.y() - vItemSpacing;
+            this->setTransform(QTransform::fromTranslate(0, -delta), true);
+        }
+    }
 }
 
 //---------------------------------------------------------------
-// MsgUnifiedEditorView::vkbAboutToOpen
+// MsgUnifiedEditorView::resetLayout
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::resetLayout()
+{
+    //disconnect signal from previously focused object.
+    if(mFocusedWidget)
+    {
+        HbAbstractEdit* editor = qobject_cast<HbAbstractEdit*>(mFocusedWidget);
+        disconnect(editor,SIGNAL(contentsChanged()),this,SLOT(ensureVisibility()));
+    }
+
+    if(this->mainWindow()->orientation() == Qt::Vertical)
+    {
+        this->setMaximumHeight(-1);
+        mScrollArea->scrollContentsTo(QPointF(0,0),0);
+        mScrollArea->resize(-1,-1);
+    }
+    else
+    {
+        this->resetTransform(); 
+
+        if(mFocusedWidget)
+        {
+            if(mMinHeight >0)
+            {
+                mFocusedWidget->setMinimumHeight(mMinHeight);
+                mMinHeight = 0.0;
+            }
+            if(mMaxHeight >0)
+            {
+                mFocusedWidget->setMaximumHeight(mMaxHeight);
+                mMaxHeight = 0.0;
+            }
+
+            if(mScrollArea->isAncestorOf(mFocusedWidget))
+            {
+                mScrollArea->enableScrolling(true);
+                mScrollArea->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAutoHide); 
+                mScrollArea->scrollContentsTo(QPointF(0,0),0);
+            }
+
+            mFocusedWidget = NULL;
+        }
+
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::ensureVisibility
 // @see header file
 //---------------------------------------------------------------
-void MsgUnifiedEditorView::vkbAboutToOpen()
-{    
-	  //This is done to avoid user action on attachment
-	  //toolbar button when vkb is opening
-    mAttachAction->setDisabled(true);
-    disconnect(mVkbHost,SIGNAL(aboutToOpen()),
-            this,SLOT(vkbAboutToOpen()));
+void MsgUnifiedEditorView::ensureVisibility()
+{
+    if(mFocusedWidget && mVkbHost->keypadStatus() == HbVkbHost::HbVkbStatusOpened)
+    {
+        if(this->mainWindow()->orientation() == Qt::Vertical)
+        {
+            if ( mScrollArea->isAncestorOf(mFocusedWidget)) 
+            {
+                QRectF scrollRect = mScrollArea->sceneBoundingRect();
+                QRectF editorRect = mFocusedWidget->sceneBoundingRect();
+
+                if (!scrollRect.contains(editorRect) ||
+                    scrollRect.intersects(editorRect))
+                {
+
+                    if (editorRect.height() < scrollRect.height()) {
+                        // Whole editor rect fits into scroll area. Move it there.
+                        if (editorRect.bottom() > scrollRect.bottom()) {
+                            // Scroll upwards.                    
+                            mScrollArea->ensureVisible(mScrollArea->contentWidget()->mapFromScene(editorRect.bottomLeft()));
+                        } else {
+                            // Scroll downwards.                        
+                            mScrollArea->ensureVisible(mScrollArea->contentWidget()->mapFromScene(editorRect.topLeft()));
+                        }
+                    } 
+                }
+            }
+        }
+    }
 }
-      
+
 //---------------------------------------------------------------
-// MsgUnifiedEditorView::vkbAboutToClose
+// MsgUnifiedEditorView::focusChanged
 // @see header file
 //---------------------------------------------------------------
-void MsgUnifiedEditorView::vkbAboutToClose()
-{      
-    mAttachAction->setDisabled(false);
-    connect(mVkbHost,SIGNAL(aboutToOpen()),
-            this,SLOT(vkbAboutToOpen()));
+void MsgUnifiedEditorView::focusChanged()
+{
+    //disconnect signal from previously focused object.
+    if(mFocusedWidget)
+    {
+        HbAbstractEdit* editor = qobject_cast<HbAbstractEdit*>(mFocusedWidget);
+        disconnect(editor,SIGNAL(contentsChanged()),this,SLOT(ensureVisibility()));
+    }
+    
+    //connect signal for newly focused object.
+    HbInputMethod* im =   HbInputMethod::activeInputMethod(); 
+    HbInputFocusObject* focusObj =   im->focusObject();
+    if(focusObj)
+    {
+        QObject* obj =   focusObj->object(); 
+        mFocusedWidget = qobject_cast<QGraphicsWidget*>(obj); 
+        HbAbstractEdit* editor = qobject_cast<HbAbstractEdit*>(obj);
+        if(editor)
+        {
+            connect(editor,SIGNAL(contentsChanged()),this,SLOT(ensureVisibility()));
+        }
+    }
 }
 
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::onAudioSelected
 // @see header file
 //---------------------------------------------------------------
-void 
-MsgUnifiedEditorView::onAudioSelected(QString& filePath)
+void MsgUnifiedEditorView::onAudioSelected(QString& filePath)
 {
     if (!filePath.isEmpty())
-        {
-            mBody->setAudio(filePath);
-        }    
+    {
+        mScrollArea->setAudio(filePath);
+    }    
 }
 
 //---------------------------------------------------------------
@@ -1730,18 +1319,16 @@
 //---------------------------------------------------------------
 void MsgUnifiedEditorView::doDelayedConstruction()
 {
-    addMenu();
     createTempFolder();
     
     //Create VKB instance and listen to VKB open and close signals.
-    mVkbHost = new HbAbstractVkbHost(this);
+    mVkbHost = new MsgUniEditorVkbHost(this);
+    
+    connect(mVkbHost, SIGNAL(focusChanged()), this, SLOT(focusChanged()));
     connect(mVkbHost, SIGNAL(keypadOpened()), this, SLOT(vkbOpened()));
     connect(mVkbHost, SIGNAL(keypadClosed()), this, SLOT(vkbClosed()));
-    connect(mVkbHost,SIGNAL(aboutToOpen()),this,SLOT(vkbAboutToOpen()));
-    connect(mVkbHost,SIGNAL(aboutToClose()),this,SLOT(vkbAboutToClose()));
     
     disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
-    
 }
 
 //---------------------------------------------------------------
@@ -1826,7 +1413,6 @@
         if (backAction) {
             backAction->trigger();
         }
-
     }
 }
 
@@ -1836,14 +1422,13 @@
 void MsgUnifiedEditorView::onDialogSmsSettings(HbAction* action)
 {
     HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender());
-    if (action == dlg->actions().at(0)) {
-        
+    if (action == dlg->actions().at(0))
+    {
         QVariantList params;
         params << MsgBaseView::MSGSETTINGS;// target view
         params << MsgBaseView::UNIEDITOR; // source view
         params << MsgSettingsView::SMSView;
         emit switchView(params);
-    
     }
 }
 
@@ -1863,50 +1448,6 @@
     }
 }
 
-//---------------------------------------------------------------
-// MsgUnifiedEditorView::enableSendButton
-// @see header file
-//--------------------------------------------------------------
-void MsgUnifiedEditorView::enableSendButton(bool enable)
-    {
-    if(mSendAction)
-        {
-         // enable/disable based on only if its disabled/enabled.
-         // this check is to avoid unnecessary calls to mSendAction->setEnabled(enable);
-        if(mSendAction->isEnabled() != enable )
-            mSendAction->setEnabled(enable);
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// MsgUnifiedEditorView::formatAddresses
-// @see header
-// ----------------------------------------------------------------------------
-void MsgUnifiedEditorView::formatAddresses(
-        ConvergedMessageAddressList& addresses)
-{       
-
-    for(int i=0; i < addresses.count() ;i++ )
-    {
-        QString addr = addresses[i]->address();
-        
-        HBufC *tempAddr = XQConversions::qStringToS60Desc(addr);     
-            
-        TPtr ptr = tempAddr->Des();
-                    
-         // Note: This is just to parse spaces etc away from phonenumbers.
-         //       Ignore EFalse returned for email addresses.   
-        CommonPhoneParser::ParsePhoneNumber(ptr , 
-                                            CommonPhoneParser::ESMSNumber );        
-       
-        addr = XQConversions::s60DescToQString(tempAddr->Des()); 
-        
-        addresses[i]->setAddress(addr);
-        
-        delete tempAddr;                                                       
-    }       
-}
-
 // ----------------------------------------------------------------------------
 // MsgUnifiedEditorView::isReplyPathBroken
 // @see header
@@ -1916,7 +1457,7 @@
     // 1. Never set for MMS
     // 2. if additional recipients exits
     if( (MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms) ||
-        (mToField->addressCount() != 1) )
+        (MsgUnifiedEditorMonitor::msgAddressCount() != 1) )
     {
         // broken
         return true;
@@ -1926,9 +1467,16 @@
     QString dispName;
     int phCount;
     int origCntLocalId = MsgContactHandler::resolveContactDisplayName(
-            mOriginatingSME, dispName, phCount);
+        mOriginatingSME, dispName, phCount);
     int currCntLocalId = -1;
-    QString currAddress(mToField->addresses().at(0)->address());
+    QString currAddress;
+    ConvergedMessageAddress* currentAdd = mScrollArea->currentAddress();
+    if(currentAdd)
+    {
+        currAddress = currentAdd->address();
+        delete currentAdd;
+    }
+    
     if(origCntLocalId != -1)
     {
         currCntLocalId = MsgContactHandler::resolveContactDisplayName(
@@ -1944,11 +1492,11 @@
     }
     else
     { // atleast one contact is not present in contacts db
-      // direct compare
+        // direct compare
         UniEditorGenUtils* genUtils = q_check_ptr(new UniEditorGenUtils);
         bool compareResult = false;
         TRAP_IGNORE(
-        compareResult = genUtils->MatchPhoneNumberL(
+            compareResult = genUtils->MatchPhoneNumberL(
                 *XQConversions::qStringToS60Desc(mOriginatingSME),
                 *XQConversions::qStringToS60Desc(currAddress))
         );
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/CatsFallingInLove1280x1024.jpg has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEGProgressive_8Mpix.jpg has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEGProgressive_QCIF.jpg has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEG_CIF.JPG has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/JPEG_QCIF.jpg has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/WMF_Qcif.jpg has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/animated_gif_800X600.gif has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/gif87_bomb.gif has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorprocessimageoperation/data/jpg_sun.jpg has changed
Binary file messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorutils/data/JPEG_CIF.JPG has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorutils/src/unittest_msgunieditorutils.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Test class for MsgUnifiedEditorPixmapWidget
+*
+*/
+
+#include "unittest_msgunieditorutils.h"    
+#include <QtTest/QTest>
+#include <QtTest/QSignalSpy>
+#include "msguitest.h"
+const QString IMAGE_JPEG_CIF_PATH = "c:\\data\\testUniEditor\\JPEG_CIF.JPG";
+const QString IMAGE_MIMETYPE("image");
+TestMsgUnifiedEditorUtils::TestMsgUnifiedEditorUtils()
+    {
+    
+    }
+TestMsgUnifiedEditorUtils::~TestMsgUnifiedEditorUtils()
+    {
+    
+    }
+void TestMsgUnifiedEditorUtils::initTestCase()
+    {
+        mMsgUnifiedEditorUtils = new MsgUnifiedEditorUtils();
+        QVERIFY(mMsgUnifiedEditorUtils != NULL);
+    }
+           
+void TestMsgUnifiedEditorUtils::test_Constructor()
+    {
+    /*nothing to check*/
+    }
+
+
+void TestMsgUnifiedEditorUtils::test_handleOk()
+    {
+        QSignalSpy signaleHandlerOK(mMsgUnifiedEditorUtils, SIGNAL(requestOk(const QVariant&)));
+        QVariant lVariant;
+        lVariant.setValue(QString("OK"));
+
+        QCOMPARE( signaleHandlerOK.count(), 0 );
+        mMsgUnifiedEditorUtils->handleOk(lVariant);
+        QCOMPARE( signaleHandlerOK.count(), 1 );
+    }
+
+void TestMsgUnifiedEditorUtils::test_handleError()
+    {
+        QSignalSpy signaleHandlerError(mMsgUnifiedEditorUtils, SIGNAL(requestError(int, const QString&)));
+        QString lString = "Not found";
+        int errorcode = KErrNotFound;
+        QCOMPARE( signaleHandlerError.count(), 0 );
+        mMsgUnifiedEditorUtils->handleError(errorcode, lString);
+        QCOMPARE( signaleHandlerError.count(), 1 );
+    }
+
+void TestMsgUnifiedEditorUtils::test_launchContentViewer()
+    {
+    mMsgUnifiedEditorUtils->launchContentViewer(IMAGE_MIMETYPE,IMAGE_JPEG_CIF_PATH);
+    }
+
+void TestMsgUnifiedEditorUtils::cleanupTestCase()
+    {
+        delete mMsgUnifiedEditorUtils;
+    }
+
+//entry point.
+MSGUI_TEST_MAIN(TestMsgUnifiedEditorUtils)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/tsrc/unittest_msgunieditorutils/unittest_msgunieditorutils.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+# 
+# Description:
+#
+#
+
+TARGET = unittest_msgunieditorutils
+TARGET.UID3 = 0x20024340
+
+include(../tsrc.pri)
+
+BLD_INF_RULES.prj_testexports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "./data/JPEG_CIF.JPG		c:/data/testUniEditor/JPEG_CIF.JPG" \
+
+symbian: {
+	addJPEGCIF.sources = ./data/JPEG_CIF.JPG
+	addJPEGCIF.path = c:/data/testUniEditor
+	DEPLOYMENT += addJPEGCIF
+
+}
+# Input
+HEADERS += unittest_msgunieditorutils.h
+SOURCES += unittest_msgunieditorutils.cpp
\ No newline at end of file
--- a/messagingapp/msgui/unifiededitor/unifiededitor.pro	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/unifiededitor.pro	Tue Oct 19 11:30:16 2010 +0530
@@ -54,7 +54,9 @@
 MMP_RULES += defBlock
 
 # Input
-HEADERS += msgunieditormonitor.h \
+HEADERS += msgunieditorbodyeditor.h \
+    msgunieditorscrollarea.h \
+    msgunieditormonitor.h \
     msgunieditoraddress.h \
     msgunieditorattachment.h \
     msgunieditorbody.h \
@@ -69,8 +71,9 @@
     msgunieditorpixmapwidget.h \
     msgunieditorutils.h \
     msgunieditoraudiowidget.h
-
-SOURCES += msgunieditormonitor.inl \
+    
+SOURCES += msgunieditorbodyeditor.cpp \
+    msgunieditorscrollarea.cpp \
     msgunieditormonitor.cpp \
     msgunieditoraddress.cpp \
     msgunieditorattachment.cpp \
--- a/messagingapp/msgui/unifiededitor/unifiededitor.qrc	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/unifiededitor.qrc	Tue Oct 19 11:30:16 2010 +0530
@@ -1,7 +1,4 @@
 <RCC>
-    <qresource prefix="/">
-        <file alias="qtg_anim_loading.axml">resources/qtg_anim_loading.axml</file>
-    </qresource>
     <qresource prefix="/layouts">
         <file alias="msgunifiededitoraddress.css">resources/layouts/msgunifiededitoraddress.css</file>
         <file alias="msgunifiededitoraddress.widgetml">resources/layouts/msgunifiededitoraddress.widgetml</file>
@@ -13,5 +10,7 @@
         <file alias="msgunifiededitorsubject.widgetml">resources/layouts/msgunifiededitorsubject.widgetml</file>
         <file alias="msgunifiededitorattachment_color.css">resources/layouts/msgunifiededitorattachment_color.css</file>
         <file alias="msgunifiededitorview.css">resources/layouts/msgunifiededitorview.css</file>
+        <file alias="msgunifiededitorbodyeditor.css">resources/layouts/msgunifiededitorbodyeditor.css</file>
+        <file alias="msgunifiededitorbodyeditor.widgetml">resources/layouts/msgunifiededitorbodyeditor.widgetml</file>
     </qresource>
 </RCC>
--- a/messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h	Tue Oct 19 11:30:16 2010 +0530
@@ -108,12 +108,12 @@
     void menuClosed();
     
     /**
-     * handlers for phone number specific menu items.
+     * handlers for context sensitive menu items.
      */
     void openContactInfo();
     void call();
-    void saveToContacts();
     void sendMessage();
+    void createEmail();
     void copyToClipboard();
     
     /**
@@ -150,6 +150,13 @@
     QTextCharFormat mFormatHighlight;
     QTextCharFormat mFormatNormal;
 
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestUniViewerAddressWidget;
+#endif
+
     };
 
 #endif // UNI_VIEWER_ADDRESS_WIDGET_H
--- a/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h	Tue Oct 19 11:30:16 2010 +0530
@@ -99,7 +99,6 @@
      * common handlers.
      */
     void openContactInfo();
-    void saveToContacts();
     void copyToClipboard();
     
     /**
@@ -141,6 +140,13 @@
 
     //Current cursor position.
     int mCursorPos;
+
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestUniViewerTextItem;
+#endif
 };
 
 #endif // UNIVIEWERTEXTITEM_H
--- a/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -30,10 +30,10 @@
 
 #include <xqservicerequest.h>
 #include <xqappmgr.h>
+#include <xqaiwdecl.h>
+#include <xqaiwrequest.h>
 #include <cntservicescontact.h>
 #include <qtcontacts.h>
-#include <xqservicerequest.h>
-#include <xqaiwrequest.h>
 #include "msgcontacthandler.h"
 
 // LOCAL CONSTANTS
@@ -41,13 +41,14 @@
 const QString ADDRESS_OPEN(" (");
 const QString ADDRESS_CLOSE(")");
 const QString SPACE(" ");
+const QChar AT_SIGN('@');
 
 //localization
 #define LOC_CONTACT_INFO      hbTrId("txt_messaging_menu_contact_info")
 #define LOC_CALL              hbTrId("txt_common_menu_call_verb")
 #define LOC_SEND_MESSAGE      hbTrId("txt_common_menu_send_message")
-#define LOC_SAVE_TO_CONTACTS  hbTrId("txt_common_menu_save_to_contacts")
 #define LOC_COPY              hbTrId("txt_common_menu_copy")
+#define LOC_CREATE_EMAIL      hbTrId("txt_messaging_menu_create_mail")
 
 const QString BG_FRAME_GRAPHICS("qtg_fr_lineedit_normal");
 
@@ -349,6 +350,7 @@
 
     if(!anchor.isEmpty() && !this->textCursor().hasSelection())
     {
+        // Secondary Actions
         populateMenu(contextMenu,anchor);
     }
 }
@@ -357,63 +359,48 @@
 {
     HbAction* action = NULL;
 
-    int contactId = MsgContactHandler::resolveContactDisplayName(
-                                 data, 
-                                 QContactPhoneNumber::DefinitionName,
-                                 QContactPhoneNumber::FieldNumber); 
-    
-    if(contactId > 0)
-    {
+    // Finding if the data is an Email Address
+    QBool isEmail = data.contains(AT_SIGN, Qt::CaseInsensitive);
+
+    if (isEmail) {
+        action = contextMenu->addAction(LOC_CREATE_EMAIL, this, SLOT(createEmail()));
+        action->setData(data);
+
         action = contextMenu->addAction(LOC_CONTACT_INFO, this, SLOT(openContactInfo()));
         action->setData(data);
     }
-    else
-    {
-        action = contextMenu->addAction(LOC_SAVE_TO_CONTACTS, this, SLOT(saveToContacts()));
-        action->setData(data);  
-    }
+    else {
+        action = contextMenu->addAction(LOC_CONTACT_INFO, this, SLOT(openContactInfo()));
+        action->setData(data);
 
-    action = contextMenu->addAction(LOC_CALL, this, SLOT(call()));
-    action->setData(data);
+        action = contextMenu->addAction(LOC_CALL, this, SLOT(call()));
+        action->setData(data);
 
-    action = contextMenu->addAction(LOC_SEND_MESSAGE, this, SLOT(sendMessage()));
-    action->setData(data);
+        action = contextMenu->addAction(LOC_SEND_MESSAGE, this, SLOT(sendMessage()));
+        action->setData(data);
+    }
 
     action = contextMenu->addAction(LOC_COPY, this, SLOT(copyToClipboard()));
     action->setData(data);
-    
-    connect(contextMenu,SIGNAL(aboutToClose()),this,SLOT(menuClosed())); 
+
+    connect(contextMenu, SIGNAL(aboutToClose()), this, SLOT(menuClosed()));
 }
 
 void UniViewerAddressWidget::shortTapAction(QString anchor,const QPointF& pos)
 {
+    Q_UNUSED(pos)
+
+    // Primary Actions
+
     HbAction action;
     action.setData(anchor);
 
-
-    int contactId = MsgContactHandler::resolveContactDisplayName(
-        anchor, 
-        QContactPhoneNumber::DefinitionName,
-        QContactPhoneNumber::FieldNumber);        
-
-    if(contactId > 0 )
-    {
-        //if resolved conatct open contact card 
-        connect(&action,SIGNAL(triggered()),this,SLOT(openContactInfo()));
+    if (anchor.contains(AT_SIGN, Qt::CaseInsensitive)) {
+        // Email address
+        connect(&action, SIGNAL(triggered()), this, SLOT(createEmail()));
     }
-    else
-    {
-        //unresolved contact show popup.  
-        highlightText(true);
-
-        HbMenu* contextMenu = new HbMenu();
-        contextMenu->setDismissPolicy(HbPopup::TapAnywhere);
-        contextMenu->setAttribute(Qt::WA_DeleteOnClose, true);
-        contextMenu->setPreferredPos(pos); 
-
-        populateMenu(contextMenu,anchor);
-        
-        contextMenu->show();
+    else {
+        connect(&action, SIGNAL(triggered()), this, SLOT(openContactInfo()));
     }
 
     action.trigger();
@@ -452,7 +439,10 @@
         connect(serviceRequest, SIGNAL(requestError(int)),
                 this, SLOT(onServiceRequestCompleted()));
         
-        *serviceRequest << phoneNumber;
+        QList<QVariant> args;
+        args << phoneNumber;
+
+        serviceRequest->setArguments(args);
         serviceRequest->send();
     }
 }
@@ -471,63 +461,52 @@
 
 void UniViewerAddressWidget::openContactInfo()
 {
-    HbAction* action = qobject_cast<HbAction*>(sender());
-    
-    if(action)
-    {
-        QString data = action->data().toString();        
-    
-        int contactId = MsgContactHandler::resolveContactDisplayName(
-                data,
-                QContactPhoneNumber::DefinitionName,
-                QContactPhoneNumber::FieldNumber);
+    HbAction* action = qobject_cast<HbAction*> (sender());
+
+    if (action) {
+        QString data = action->data().toString();
+        int contactId = -1;
+        QVariant contactType;
 
-        // if contact is unresolved on phone number field
-        // then, try resolving it on email address field
-        if(contactId <= 0)
-        {
-            contactId = MsgContactHandler::resolveContactDisplayName(
-                data,
-                QContactEmailAddress::DefinitionName,
-                QContactEmailAddress::FieldEmailAddress);
+        if (data.contains(AT_SIGN, Qt::CaseInsensitive)) {
+            // Email address
+            contactId = MsgContactHandler::resolveContactDisplayName(data,
+                QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress);
+            contactType = QContactEmailAddress::DefinitionName;
+        }
+        else {
+            contactId = MsgContactHandler::resolveContactDisplayName(data,
+                QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber);
+            contactType = QContactPhoneNumber::DefinitionName;
         }
 
         //service stuff.
-        QString service("phonebookservices");
-        QString interface;
-        QString operation;
         QList<QVariant> args;
+        XQAiwRequest* request = NULL;
+        XQApplicationManager appManager;
 
-        if(contactId > 0)
-        {
-            //open contact card
-            interface = QString("com.nokia.symbian.IContactsView");
-            operation = QString("openContactCard(int)");
+        if (contactId > 0) {
+            // open existing contact card
+            request = appManager.create(XQI_CONTACTS_VIEW, XQOP_CONTACTS_VIEW_CONTACT_CARD, true); // Embedded
             args << contactId;
         }
-        else
-        {
-            //save to contacts with phone number field prefilled.
-            interface = QString("com.nokia.symbian.IContactsEdit");
-            operation = QString("editCreateNew(QString,QString)");
-            QString type = QContactPhoneNumber::DefinitionName;
-            args << type;
-            args << data;
+        else {
+            // open temp contact card
+            request = appManager.create(XQI_CONTACTS_VIEW,
+                XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL, true); // Embedded
+            args << contactType; // Type
+            args << data; // Actual data
         }
-        XQAiwRequest* request;
-        XQApplicationManager appManager;
-        request = appManager.create(service, interface, operation, true); // embedded
-        if ( request == NULL )
-            {
-            return;       
-            }
+
+        if (request == NULL) {
+            return;
+        }
 
         // Result handlers
-        connect (request, SIGNAL(requestOk(const QVariant&)), 
-            this, SLOT(handleOk(const QVariant&)));
-        connect (request, SIGNAL(requestError(const QVariant&)), 
-            this, SLOT(handleError(const QVariant&)));
-        
+        connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+        connect(request, SIGNAL(requestError(const QVariant&)), this,
+            SLOT(handleError(const QVariant&)));
+
         request->setArguments(args);
         request->send();
         delete request;
@@ -535,19 +514,14 @@
 }
 
 void UniViewerAddressWidget::handleOk(const QVariant& result)
-    {
+{
     Q_UNUSED(result)
-    }
+}
 
 void UniViewerAddressWidget::handleError(int errorCode, const QString& errorMessage)
-    {
+{
     Q_UNUSED(errorMessage)
     Q_UNUSED(errorCode)
-    }
-
-void UniViewerAddressWidget::saveToContacts()
-{
-    openContactInfo();
 }
 
 void UniViewerAddressWidget::sendMessage()
@@ -585,4 +559,45 @@
     }
 }
 
+//---------------------------------------------------------------
+// UniViewerAddressWidget::createEmail
+// @see header file
+//---------------------------------------------------------------
+void UniViewerAddressWidget::createEmail()
+{
+    HbAction* action = qobject_cast<HbAction*> (sender());
+
+    if (action) {
+        QString emailId = action->data().toString();
+
+        // Launch email editor
+        QString interfaceName("com.nokia.symbian.IEmailMessageSend");
+        QString operation("send(QVariant)");
+        XQApplicationManager appManager;
+        XQAiwRequest* request = appManager.create(interfaceName, operation, true);
+        if (request == NULL) {
+            return;
+        }
+
+        // Fill args
+        QStringList recipients;
+        recipients.append(emailId);
+
+        QMap<QString, QVariant> map;
+        map.insert(QString("to"), recipients);
+
+        QList<QVariant> args;
+        args.append(map);
+
+        // Result handlers
+        connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+        connect(request, SIGNAL(requestError(const QVariant&)), this,
+            SLOT(handleError(const QVariant&)));
+
+        request->setArguments(args);
+        request->send();
+        delete request;
+    }
+}
+
 // EOF
--- a/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp	Tue Oct 05 13:58:47 2010 +0530
+++ b/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp	Tue Oct 19 11:30:16 2010 +0530
@@ -32,6 +32,7 @@
 #include <cntservicescontact.h>
 #include <xqservicerequest.h>
 #include <xqaiwrequest.h>
+#include <xqaiwdecl.h>
 #include <xqappmgr.h>
 
 
@@ -54,7 +55,6 @@
 #define LOC_CONTACT_INFO hbTrId("txt_messaging_menu_contact_info")
 #define LOC_CALL              hbTrId("txt_common_menu_call_verb")
 #define LOC_SEND_MESSAGE      hbTrId("txt_common_menu_send_message")
-#define LOC_SAVE_TO_CONTACTS  hbTrId("txt_common_menu_save_to_contacts")
 #define LOC_COPY              hbTrId("txt_common_menu_copy")
 #define LOC_CREATE_EMAIL      hbTrId("txt_messaging_menu_create_mail")
 #define LOC_OPEN_LINK         hbTrId("txt_messaging_menu_open_link")
@@ -72,6 +72,7 @@
     this->setFlag(QGraphicsItem::ItemIsFocusable,false);
     this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     this->setBackgroundItem(0);   
+    this->setSmileysEnabled(true);
 
     //inserting rules and patterns to map.
     mRules.insert(NUMBER_RULE,NUMBER_PATTERN);
@@ -163,6 +164,7 @@
     // Check if there is an anchor at this pos
     QString  anchor = this->anchorAt(pos);
 
+    // Secondary Actions
     if(!anchor.isEmpty() && !this->textCursor().hasSelection())
     {
         //remove default actions.
@@ -251,24 +253,9 @@
 {
     HbAction* action = NULL;
 
-    QString number = data;
-    number.remove(NUMBER_RULE);
-    int contactId = MsgContactHandler::resolveContactDisplayName(
-                                 number, 
-                                 QContactPhoneNumber::DefinitionName,
-                                 QContactPhoneNumber::FieldNumber); 
+    action = contextMenu->addAction(LOC_CONTACT_INFO, this, SLOT(openContactInfo()));
+    action->setData(data);
     
-    if(contactId > 0)
-    {
-        action = contextMenu->addAction(LOC_CONTACT_INFO, this, SLOT(openContactInfo()));
-        action->setData(data);
-    }
-    else
-    {
-        action = contextMenu->addAction(LOC_SAVE_TO_CONTACTS, this, SLOT(saveToContacts()));
-        action->setData(data);  
-    }
-
     action = contextMenu->addAction(LOC_CALL, this, SLOT(call()));
     action->setData(data);
 
@@ -289,9 +276,6 @@
     action = contextMenu->addAction(LOC_CONTACT_INFO, this, SLOT(openContactInfo()));
     action->setData(data);
 
-    action = contextMenu->addAction(LOC_SAVE_TO_CONTACTS, this, SLOT(saveToContacts()));
-    action->setData(data);
-
     action = contextMenu->addAction(LOC_COPY, this, SLOT(copyToClipboard()));
     action->setData(data);
 }
@@ -312,38 +296,16 @@
 
 void UniViewerTextItem::handleShortTap(QString anchor,const QPointF& pos)
 {
+    Q_UNUSED(pos)
+
+    // Primary Actions
+
     HbAction action;
     action.setData(anchor);
 
     if(anchor.contains(NUMBER_RULE))
     {
-        QString data = anchor;
-        data.remove(NUMBER_RULE);
-        int contactId = MsgContactHandler::resolveContactDisplayName(
-                                     data, 
-                                     QContactPhoneNumber::DefinitionName,
-                                     QContactPhoneNumber::FieldNumber);        
-       
-        if(contactId > 0 )
-        {
-            //if resolved conatct open contact card 
-            connect(&action,SIGNAL(triggered()),this,SLOT(openContactInfo()));
-        }
-        else
-        {
-            //unresolved contact show popup.  
-            highlightText(true);
-
-            HbMenu* contextMenu = new HbMenu();
-            contextMenu->setDismissPolicy(HbPopup::TapAnywhere);
-            contextMenu->setAttribute(Qt::WA_DeleteOnClose, true);
-            contextMenu->setPreferredPos(pos); 
-            connect(contextMenu,SIGNAL(aboutToClose()),this,SLOT(menuClosed()));
-            
-            addNumberMenu(contextMenu,anchor);
-            
-            contextMenu->show();
-        }
+        connect(&action,SIGNAL(triggered()),this,SLOT(openContactInfo()));
     }
     else if(anchor.contains(EMAIL_RULE))
     {
@@ -489,96 +451,63 @@
 
 void UniViewerTextItem::openContactInfo()
 {
-    HbAction* action = qobject_cast<HbAction*>(sender());
-    
-    if(action)
-    {
-        //service stuff.
-        QString service("phonebookservices");
-        QString interface;
-        QString operation;
-        QList<QVariant> args;
-        
+    HbAction* action = qobject_cast<HbAction*> (sender());
+
+    if (action) {
+        int contactId = -1;
         QString data = action->data().toString();
-        
-        if(data.contains(QRegExp("^"+NUMBER_RULE)))
-        {
+        QVariant contactType;
+
+        if (data.contains(QRegExp("^" + NUMBER_RULE))) {
             data.remove(NUMBER_RULE);
-    
-            int contactId = MsgContactHandler::resolveContactDisplayName(
-                                         data, 
-                                         QContactPhoneNumber::DefinitionName,
-                                         QContactPhoneNumber::FieldNumber);
-    
-            if(contactId > 0)
-                {
-                //open contact card
-                interface = QString("com.nokia.symbian.IContactsView");
-                operation = QString("openContactCard(int)");
-                args << contactId;
-                }
-            else
-                {
-                //save to contacts with phone number field prefilled.
-                interface = QString("com.nokia.symbian.IContactsEdit");
-                operation = QString("editCreateNew(QString,QString)");
-                QString type = QContactPhoneNumber::DefinitionName;
-                args << type;
-                args << data;
-                }
+
+            contactId = MsgContactHandler::resolveContactDisplayName(data,
+                QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber);
+
+            contactType = QContactPhoneNumber::DefinitionName;
         }
-        else if(data.contains(QRegExp("^"+EMAIL_RULE)))
-        {
+        else if (data.contains(QRegExp("^" + EMAIL_RULE))) {
             data.remove(EMAIL_RULE);
-    
-            int contactId = MsgContactHandler::resolveContactDisplayName(
-                    data,
-                    QContactEmailAddress::DefinitionName,
-                    QContactEmailAddress::FieldEmailAddress);
-            
-            if(contactId > 0)
-                {
-                //open contact card
-                interface = QString("com.nokia.symbian.IContactsView");
-                operation = QString("openContactCard(int)");
-                args << contactId;
-                }
-            else
-                {
-                //save to contacts with e-mail field prefilled.
-                interface = QString("com.nokia.symbian.IContactsEdit");
-                operation = QString("editCreateNew(QString,QString)");
-                QString type = QContactEmailAddress::DefinitionName;
-                args << type;
-                args << data;
-                }
-        }        
-        XQAiwRequest* request;
+
+            contactId = MsgContactHandler::resolveContactDisplayName(data,
+                QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress);
+
+            contactType = QContactEmailAddress::DefinitionName;
+        }
+
+        //service stuff.
+        QList<QVariant> args;
+        XQAiwRequest* request = NULL;
         XQApplicationManager appManager;
-        request = appManager.create(service, interface, operation, true); // embedded
-        if ( request == NULL )
-            {
-            return;       
-            }
+
+        if (contactId > 0) {
+            // open existing contact card
+            request = appManager.create(XQI_CONTACTS_VIEW, XQOP_CONTACTS_VIEW_CONTACT_CARD, true); // Embedded
+            args << contactId;
+        }
+        else {
+            // open temp contact card
+            request = appManager.create(XQI_CONTACTS_VIEW,
+                XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL, true); // Embedded
+            args << contactType; // Type
+            args << data; // Actual data
+        }
+
+        if (request == NULL) {
+            return;
+        }
 
         // Result handlers
-        connect (request, SIGNAL(requestOk(const QVariant&)), 
-			this, SLOT(handleOk(const QVariant&)));
-        connect (request, SIGNAL(requestError(const QVariant&)), 
-			this, SLOT(handleError(const QVariant&)));
-        
+        connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+        connect(request, SIGNAL(requestError(const QVariant&)), this,
+            SLOT(handleError(const QVariant&)));
+
         request->setArguments(args);
         request->send();
         delete request;
     }
 }
 
-
-void UniViewerTextItem::saveToContacts()
-{
-     openContactInfo();
-}
-
 void UniViewerTextItem::onServiceRequestCompleted()
     {
     //service request is now complete. delete it.
--- a/mobilemessaging/smsmtm/clientmtm/group/bld.inf	Tue Oct 05 13:58:47 2010 +0530
+++ b/mobilemessaging/smsmtm/clientmtm/group/bld.inf	Tue Oct 19 11:30:16 2010 +0530
@@ -17,11 +17,11 @@
 PRJ_EXPORTS
 ../inc/SMCMMAIN.H 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smcmmain.h)
 ../inc/SMSCLNT.H 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smsclnt.h)
-../inc/SMSCLNT.INL	 	SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(smsclnt.inl)
+../inc/SMSCLNT.INL	 	SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smsclnt.inl)
 ../inc/SMUTHDR.H 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smuthdr.h)
-../inc/SMUTHDR.INL 		SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(smuthdr.inl)
+../inc/SMUTHDR.INL 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smuthdr.inl)
 ../inc/SMUTSET.H 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smutset.h)
-../inc/SMUTSET.INL 		SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(smutset.inl)
+../inc/SMUTSET.INL 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smutset.inl)
 ../inc/smutsimparam.h 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smutsimparam.h)
 ../inc/smscmds.h 		SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smscmds.h)
 ../inc/smut.h 			SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(smut.h)
--- a/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h	Tue Oct 19 11:30:16 2010 +0530
@@ -199,9 +199,9 @@
 ECsBioMsg_VCard,
 ECsBioMsg_VCal,
 ECsBioMgs_NokiaService,
-ECsUnknown,
 ECsBlueTooth_VCard,
-ECsBlueTooth_VCal
+ECsBlueTooth_VCal,
+ECsUnknown
 };
 
 /**
--- a/msg_plat/messaging_history_api/inc/msgitem.h	Tue Oct 05 13:58:47 2010 +0530
+++ b/msg_plat/messaging_history_api/inc/msgitem.h	Tue Oct 19 11:30:16 2010 +0530
@@ -50,9 +50,14 @@
         MsgTypeBioMsg,
         MsgTypeBlueTooth,
         MsgTypeRingingTone,
-				MsgTypeProvisioning,
-        MsgTypeUnknown
-        };
+	    MsgTypeProvisioning,
+	    MsgTypeBioMsg_VCard,
+	    MsgTypeBioMsg_VCal,
+	    MsgTypeBioMgs_NokiaService,
+	    MsgTypeBlueTooth_VCard,
+	    MsgTypeBlueTooth_VCal,
+	    MsgTypeUnknown
+    };
     
     /**
      * Message state