emailservices/emailcommon/src/CFSMailMessagePart.cpp
changeset 30 759dc5235cdb
parent 23 2dc6caa42ec3
child 49 00c7ae862740
--- a/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Thu May 27 12:43:55 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Fri Jun 11 13:27:14 2010 +0300
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include <apgcli.h>
 #include <apmrec.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
@@ -44,11 +45,12 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC( TFSMailMsgId aMessageId,
 														TFSMailMsgId aMessagePartId )
 {
-    FUNC_LOG;
-  CFSMailMessagePart* adr = new (ELeave) CFSMailMessagePart();
-  CleanupStack::PushL(adr);
-  adr->ConstructL( aMessageId, aMessagePartId );
-  return adr;
+    NM_FUNCTION;
+    
+    CFSMailMessagePart* adr = new (ELeave) CFSMailMessagePart();
+    CleanupStack::PushL(adr);
+    adr->ConstructL( aMessageId, aMessagePartId );
+    return adr;
 } 
 
 // -----------------------------------------------------------------------------
@@ -57,10 +59,11 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewL(	TFSMailMsgId aMessageId,
 														TFSMailMsgId aMessagePartId )
 {
-    FUNC_LOG;
-  CFSMailMessagePart* adr =  CFSMailMessagePart::NewLC( aMessageId, aMessagePartId );
-  CleanupStack::Pop(adr);
-  return adr;
+    NM_FUNCTION;
+    
+    CFSMailMessagePart* adr =  CFSMailMessagePart::NewLC( aMessageId, aMessagePartId );
+    CleanupStack::Pop(adr);
+    return adr;
 }
 
 //<qmail>
@@ -70,7 +73,8 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC(const NmId &aNmMessageId,
     const NmMessagePart& aNmMessage )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailMessagePart* self = new (ELeave) CFSMailMessagePart();
 	CleanupStack::PushL(self);
 	self->ConstructL( aNmMessageId,aNmMessage );
@@ -84,7 +88,8 @@
 void CFSMailMessagePart::ConstructL( TFSMailMsgId aMessageId,
                                      TFSMailMsgId aMessagePartId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
 	// Base class initialization
     CFSMailMessageBase::ConstructL(aMessageId);
@@ -107,7 +112,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessagePart::ConstructL( const NmId &aNmMessageId,const NmMessagePart& aNmMessage )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // Base class initialization
     CFSMailMessageBase::ConstructL(TFSMailMsgId(aNmMessageId));
     
@@ -129,7 +135,8 @@
     const NmMessagePart& aNmMessage,
     const NmMessageEnvelope& aNmMessageEnvelope)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // Base class initialization
     CFSMailMessageBase::ConstructL(aNmMessageEnvelope);
     
@@ -148,7 +155,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessagePart::~CFSMailMessagePart()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
 	if(iAttachmentName)
 	{
@@ -187,7 +195,7 @@
 // -----------------------------------------------------------------------------
 CFSMailMessagePart::CFSMailMessagePart() : CFSMailMessageBase()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
 	iContentClass = HBufC::New(1);
@@ -204,7 +212,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::GetContentType() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iContentTypePtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentType.utf16()),
     		iNmPrivateMessagePart->mContentType.length());
@@ -217,7 +226,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentType(const TDesC& aContentType)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentType = QString::fromUtf16(aContentType.Ptr(), aContentType.Length());
     iNmPrivateMessagePart->mContentType = qtContentType;
@@ -229,7 +239,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailMessagePart::GetPartId() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     return TFSMailMsgId(iNmPrivateMessagePart->mPartId);
 //</qmail>	
@@ -242,7 +253,7 @@
 EXPORT_C void CFSMailMessagePart::ChildPartsL( RPointerArray<CFSMailMessagePart>& aParts,
     TFSMailMessagePartDataSource aDataSource)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
     if (aDataSource == EDataSourceMessageStore)
         {
@@ -272,7 +283,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::ChildPartL(TFSMailMsgId aPartId)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	CFSMailMessagePart* part = NULL;
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
@@ -290,7 +301,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessagePart::IsMessageL() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TBuf<KMaxDataTypeLength> ptr;
 //<qmail>
@@ -318,7 +329,7 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewChildPartL( const TFSMailMsgId aInsertBefore,
 																const TDesC& aContentType )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	CFSMailMessagePart* part = NULL;
 	
@@ -335,7 +346,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::RemoveChildPartL(TFSMailMsgId aPartId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// get plugin pointer
 	TFSMailMsgId id = GetPartId();
 	if(id.IsNullId())
@@ -357,7 +369,8 @@
 EXPORT_C TInt CFSMailMessagePart::RemoveChildPartL( TFSMailMsgId aPartId,
                                                     MFSMailRequestObserver& aOperationObserver)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     // get plugin pointer
     TFSMailMsgId id = GetPartId();
@@ -402,7 +415,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::GetContentClass()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 		return *iContentClass;
 	}
 
@@ -411,7 +425,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentClass( const TDesC& aContentClass )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	// 
 	HBufC* contentClass = HBufC::New(aContentClass.Length());
@@ -435,7 +449,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailMessagePart::ContentSize() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     return (TUint)iNmPrivateMessagePart->mSize;
 //</qmail>
@@ -446,7 +461,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentSize( TUint aContentSize )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iNmPrivateMessagePart->mSize = quint32(aContentSize);
 //</qmail>
@@ -457,7 +473,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::ContentID()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>	
     iContentIDPtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentId.utf16()),
     		iNmPrivateMessagePart->mContentId.length());
@@ -470,7 +487,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentIDL(const TDesC& aContentID)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentID = QString::fromUtf16(aContentID.Ptr(), aContentID.Length());
     iNmPrivateMessagePart->mContentId = qtContentID;    
@@ -484,7 +502,7 @@
 													TFSMailMsgId aInsertBefore,
 													CFSMailMessage* aMessage)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	CFSMailMessagePart* part = NULL;
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
@@ -500,7 +518,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::RemoveContentL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
 	if(plugin == NULL)
@@ -529,7 +547,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::RemoveDownLoadedAttachmentsL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
         
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
     if(plugin == NULL)
@@ -569,7 +587,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C RFile CFSMailMessagePart::GetContentFileL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
@@ -596,7 +614,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentFromFileL(const TDesC& aFilePath)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->SetPartContentFromFileL(GetMailBoxId(), GetFolderId(),
@@ -609,7 +628,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::CopyContentFileL( const TDesC& aFilePath )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->CopyMessagePartFileL( GetMailBoxId(), GetFolderId(),
@@ -622,7 +642,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::GetContentToBufferL(TDes16& aBuffer, TUint aStartOffset)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->GetContentToBufferL( GetMailBoxId(), GetFolderId(), GetMessageId(),
@@ -635,7 +656,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContent( TDes16& aBuffer )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 // <qmail>
@@ -650,7 +672,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::ContentDescription()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iContentDescriptionPtr.Set(reinterpret_cast<const TUint16*> (
             iNmPrivateMessagePart->mContentDescription.utf16()),
@@ -665,7 +688,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentDescription( const TDesC& aContentDescription )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentDescription = QString::fromUtf16(
             aContentDescription.Ptr(), aContentDescription.Length());
@@ -677,7 +701,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::ContentDisposition()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
 	iContentDispositionPtr.Set(reinterpret_cast<const TUint16*> (
 	        iNmPrivateMessagePart->mContentDisposition.utf16()),
@@ -691,7 +716,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentDisposition( const TDesC& aContentDisposition )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentDisposition = QString::fromUtf16(
             aContentDisposition.Ptr(), aContentDisposition.Length());
@@ -704,7 +730,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CDesCArray& CFSMailMessagePart::ContentTypeParameters()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>	
     if (iNmPrivateMessagePart->mContentType.isNull())
 		{
@@ -801,7 +828,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CDesCArray& CFSMailMessagePart::ContentDispositionParameters()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 //<qmail>
     const TDesC& contentDisposition = ContentDisposition();
@@ -935,7 +962,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C MMRInfoObject& CFSMailMessagePart::GetMRInfo()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return *iMeetingRequest;
 }
 
@@ -944,7 +972,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessagePart::IsMRInfoSet()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iMeetingRequest)
 		{
 		return ETrue;
@@ -960,7 +989,8 @@
 // -----------------------------------------------------------------------------	
 EXPORT_C void CFSMailMessagePart::SetMRInfo(MMRInfoObject* aMeetingRequest)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iMeetingRequest)
 	{
 		delete iMeetingRequest;
@@ -973,7 +1003,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SaveL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->StoreMessagePartL( GetMailBoxId(), GetFolderId(), GetMessageId(), *this );		
@@ -986,7 +1017,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetAttachmentNameL(const TDesC& aFilePath)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	    // Parse file name in case full path is given
 		TPtrC name;
 		for(TInt i=0;i<aFilePath.Length();)
@@ -1057,7 +1089,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailMessagePart::AttachmentNameL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     // Look first from Content-Type param "name"
 	TInt ptr = GetContentType().Find(KFSMailContentTypeParamName);
@@ -1109,7 +1142,7 @@
         const TDesC& aContentType, 
         TFSMailMessagePartDataSource aDataSource)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     TBuf<KMaxDataTypeLength> ptr;
     if (!iNmPrivateMessagePart->mContentType.isNull())
@@ -1216,7 +1249,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessagePart::ContentTypeMatches( const TDesC& aContentType )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TBuf<KMaxDataTypeLength> ptr;
 	TBool result(EFalse);
@@ -1246,7 +1279,8 @@
 EXPORT_C void CFSMailMessagePart::AppendAttachmentsL(
     RPointerArray<CFSMailMessagePart>& aParts)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
     if ( plugin )
         {
@@ -1283,7 +1317,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailMessagePart::FetchedContentSize() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     return (TUint)iNmPrivateMessagePart->mFetchedSize;
 //</qmail>
@@ -1294,7 +1329,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetFetchedContentSize(TUint aContentSize)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iNmPrivateMessagePart->mFetchedSize = quint32(aContentSize);
 //</qmail>
@@ -1305,7 +1341,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSPartFetchState CFSMailMessagePart::FetchLoadState() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
 	 if(iMessagePartsStatus != EFSDefault)
 		{
@@ -1337,7 +1374,7 @@
         										  		MFSMailRequestObserver& aOperationObserver,
         												const TUint aPreferredByteCount)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
 	TInt requestId(0);
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
@@ -1379,7 +1416,7 @@
         							MFSMailRequestObserver& aOperationObserver,
         							const TUint aPreferredByteCount)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TInt requestId(0);
     
@@ -1421,7 +1458,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetMessagePartsStatus(TFSPartFetchState aMessagePartStatus)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iMessagePartsStatus = aMessagePartStatus;
 	}
 
@@ -1432,7 +1470,8 @@
 																const TFSMailMsgId /*aInsertBefore*/,
 																const TDesC& aContentType )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessagePart* newPart = NULL;
 
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
@@ -1464,7 +1503,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailMessagePart::ReadOnlyPartSize() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return iReadOnlyPartSize;
 }
 
@@ -1473,7 +1513,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetReadOnlyPartSize(const TUint aReadOnlyPartSize)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     iReadOnlyPartSize = aReadOnlyPartSize;
 }
 
@@ -1482,7 +1523,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessagePart::DoAttachmentListL( RPointerArray<CFSMailMessagePart>& /*aParts*/ )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 }
 
 //<qmail>
@@ -1491,7 +1532,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmMessagePart* CFSMailMessagePart::GetNmMessagePart()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return new NmMessagePart(iNmPrivateMessagePart);
 }
 //</qmail>
@@ -1502,7 +1544,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C HBufC* CFSMailMessagePart::GetLocalTextContentLC()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return NmConverter::qstringToHBufCLC(iNmPrivateMessagePart->mTextContent);
 }
 //</qmail>