emailservices/emailcommon/src/CFSMailMessagePart.cpp
changeset 30 759dc5235cdb
parent 23 2dc6caa42ec3
child 49 00c7ae862740
equal deleted inserted replaced
27:9ba4404ef423 30:759dc5235cdb
    13 *
    13 *
    14 * Description:  common email part object
    14 * Description:  common email part object
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 #include "emailtrace.h"
       
    19 
    18 //<qmail>
    20 //<qmail>
    19 #include <nmcommonheaders.h>
    21 #include <nmcommonheaders.h>
    20 //</qmail>
    22 //</qmail>
    21 
    23 
    22 #include "emailtrace.h"
       
    23 #include <apgcli.h>
    24 #include <apgcli.h>
    24 #include <apmrec.h>
    25 #include <apmrec.h>
    25 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
    26 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
    26 
    27 
    27 //<cmail>
    28 //<cmail>
    42 // CFSMailMessagePart::NewLC
    43 // CFSMailMessagePart::NewLC
    43 // -----------------------------------------------------------------------------
    44 // -----------------------------------------------------------------------------
    44 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC( TFSMailMsgId aMessageId,
    45 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC( TFSMailMsgId aMessageId,
    45 														TFSMailMsgId aMessagePartId )
    46 														TFSMailMsgId aMessagePartId )
    46 {
    47 {
    47     FUNC_LOG;
    48     NM_FUNCTION;
    48   CFSMailMessagePart* adr = new (ELeave) CFSMailMessagePart();
    49     
    49   CleanupStack::PushL(adr);
    50     CFSMailMessagePart* adr = new (ELeave) CFSMailMessagePart();
    50   adr->ConstructL( aMessageId, aMessagePartId );
    51     CleanupStack::PushL(adr);
    51   return adr;
    52     adr->ConstructL( aMessageId, aMessagePartId );
       
    53     return adr;
    52 } 
    54 } 
    53 
    55 
    54 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    55 // CFSMailMessagePart::NewL
    57 // CFSMailMessagePart::NewL
    56 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
    57 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewL(	TFSMailMsgId aMessageId,
    59 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewL(	TFSMailMsgId aMessageId,
    58 														TFSMailMsgId aMessagePartId )
    60 														TFSMailMsgId aMessagePartId )
    59 {
    61 {
    60     FUNC_LOG;
    62     NM_FUNCTION;
    61   CFSMailMessagePart* adr =  CFSMailMessagePart::NewLC( aMessageId, aMessagePartId );
    63     
    62   CleanupStack::Pop(adr);
    64     CFSMailMessagePart* adr =  CFSMailMessagePart::NewLC( aMessageId, aMessagePartId );
    63   return adr;
    65     CleanupStack::Pop(adr);
       
    66     return adr;
    64 }
    67 }
    65 
    68 
    66 //<qmail>
    69 //<qmail>
    67 // -----------------------------------------------------------------------------
    70 // -----------------------------------------------------------------------------
    68 // CFSMailMessagePart::NewLC
    71 // CFSMailMessagePart::NewLC
    69 // -----------------------------------------------------------------------------
    72 // -----------------------------------------------------------------------------
    70 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC(const NmId &aNmMessageId,
    73 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC(const NmId &aNmMessageId,
    71     const NmMessagePart& aNmMessage )
    74     const NmMessagePart& aNmMessage )
    72 {
    75 {
    73     FUNC_LOG;
    76     NM_FUNCTION;
       
    77     
    74 	CFSMailMessagePart* self = new (ELeave) CFSMailMessagePart();
    78 	CFSMailMessagePart* self = new (ELeave) CFSMailMessagePart();
    75 	CleanupStack::PushL(self);
    79 	CleanupStack::PushL(self);
    76 	self->ConstructL( aNmMessageId,aNmMessage );
    80 	self->ConstructL( aNmMessageId,aNmMessage );
    77 	return self;
    81 	return self;
    78 } 
    82 } 
    82 // CFSMailMessagePart::ConstructL
    86 // CFSMailMessagePart::ConstructL
    83 // -----------------------------------------------------------------------------
    87 // -----------------------------------------------------------------------------
    84 void CFSMailMessagePart::ConstructL( TFSMailMsgId aMessageId,
    88 void CFSMailMessagePart::ConstructL( TFSMailMsgId aMessageId,
    85                                      TFSMailMsgId aMessagePartId )
    89                                      TFSMailMsgId aMessagePartId )
    86 {
    90 {
    87     FUNC_LOG;
    91     NM_FUNCTION;
       
    92     
    88 //<qmail>
    93 //<qmail>
    89 	// Base class initialization
    94 	// Base class initialization
    90     CFSMailMessageBase::ConstructL(aMessageId);
    95     CFSMailMessageBase::ConstructL(aMessageId);
    91 	
    96 	
    92 	iNmPrivateMessagePart = new NmMessagePartPrivate();
    97 	iNmPrivateMessagePart = new NmMessagePartPrivate();
   105 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   106 // CFSMailMessagePart::ConstructL
   111 // CFSMailMessagePart::ConstructL
   107 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   108 void CFSMailMessagePart::ConstructL( const NmId &aNmMessageId,const NmMessagePart& aNmMessage )
   113 void CFSMailMessagePart::ConstructL( const NmId &aNmMessageId,const NmMessagePart& aNmMessage )
   109 {
   114 {
   110     FUNC_LOG;
   115     NM_FUNCTION;
       
   116     
   111     // Base class initialization
   117     // Base class initialization
   112     CFSMailMessageBase::ConstructL(TFSMailMsgId(aNmMessageId));
   118     CFSMailMessageBase::ConstructL(TFSMailMsgId(aNmMessageId));
   113     
   119     
   114     iNmPrivateMessagePart = aNmMessage.d;
   120     iNmPrivateMessagePart = aNmMessage.d;
   115            
   121            
   127 // -----------------------------------------------------------------------------
   133 // -----------------------------------------------------------------------------
   128 void CFSMailMessagePart::ConstructL(
   134 void CFSMailMessagePart::ConstructL(
   129     const NmMessagePart& aNmMessage,
   135     const NmMessagePart& aNmMessage,
   130     const NmMessageEnvelope& aNmMessageEnvelope)
   136     const NmMessageEnvelope& aNmMessageEnvelope)
   131 {
   137 {
   132     FUNC_LOG;
   138     NM_FUNCTION;
       
   139     
   133     // Base class initialization
   140     // Base class initialization
   134     CFSMailMessageBase::ConstructL(aNmMessageEnvelope);
   141     CFSMailMessageBase::ConstructL(aNmMessageEnvelope);
   135     
   142     
   136     iNmPrivateMessagePart = aNmMessage.d;
   143     iNmPrivateMessagePart = aNmMessage.d;
   137            
   144            
   146 // -----------------------------------------------------------------------------
   153 // -----------------------------------------------------------------------------
   147 // CFSMailMessagePart::~CFSMailMessagePart
   154 // CFSMailMessagePart::~CFSMailMessagePart
   148 // -----------------------------------------------------------------------------
   155 // -----------------------------------------------------------------------------
   149 EXPORT_C CFSMailMessagePart::~CFSMailMessagePart()
   156 EXPORT_C CFSMailMessagePart::~CFSMailMessagePart()
   150 {
   157 {
   151     FUNC_LOG;
   158     NM_FUNCTION;
       
   159     
   152 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
   160 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
   153 	if(iAttachmentName)
   161 	if(iAttachmentName)
   154 	{
   162 	{
   155 		delete iAttachmentName;
   163 		delete iAttachmentName;
   156 	}
   164 	}
   185 // -----------------------------------------------------------------------------
   193 // -----------------------------------------------------------------------------
   186 // CFSMailMessagePart::CFSMailMessagePart
   194 // CFSMailMessagePart::CFSMailMessagePart
   187 // -----------------------------------------------------------------------------
   195 // -----------------------------------------------------------------------------
   188 CFSMailMessagePart::CFSMailMessagePart() : CFSMailMessageBase()
   196 CFSMailMessagePart::CFSMailMessagePart() : CFSMailMessageBase()
   189 {
   197 {
   190     FUNC_LOG;
   198     NM_FUNCTION;
   191 	
   199 	
   192 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
   200 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
   193 	iContentClass = HBufC::New(1);
   201 	iContentClass = HBufC::New(1);
   194 	iContentClass->Des().Copy(KNullDesC());
   202 	iContentClass->Des().Copy(KNullDesC());
   195 
   203 
   202 // -----------------------------------------------------------------------------
   210 // -----------------------------------------------------------------------------
   203 // CFSMailMessagePart::GetContentType
   211 // CFSMailMessagePart::GetContentType
   204 // -----------------------------------------------------------------------------
   212 // -----------------------------------------------------------------------------
   205 EXPORT_C const TDesC& CFSMailMessagePart::GetContentType() const
   213 EXPORT_C const TDesC& CFSMailMessagePart::GetContentType() const
   206 {
   214 {
   207     FUNC_LOG;
   215     NM_FUNCTION;
       
   216     
   208 //<qmail>
   217 //<qmail>
   209     iContentTypePtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentType.utf16()),
   218     iContentTypePtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentType.utf16()),
   210     		iNmPrivateMessagePart->mContentType.length());
   219     		iNmPrivateMessagePart->mContentType.length());
   211     return iContentTypePtr;
   220     return iContentTypePtr;
   212 //</qmail>
   221 //</qmail>
   215 // -----------------------------------------------------------------------------
   224 // -----------------------------------------------------------------------------
   216 // CFSMailMessagePart::SetContentType
   225 // CFSMailMessagePart::SetContentType
   217 // -----------------------------------------------------------------------------
   226 // -----------------------------------------------------------------------------
   218 EXPORT_C void CFSMailMessagePart::SetContentType(const TDesC& aContentType)
   227 EXPORT_C void CFSMailMessagePart::SetContentType(const TDesC& aContentType)
   219 {
   228 {
   220     FUNC_LOG;
   229     NM_FUNCTION;
       
   230     
   221 //<qmail>
   231 //<qmail>
   222     QString qtContentType = QString::fromUtf16(aContentType.Ptr(), aContentType.Length());
   232     QString qtContentType = QString::fromUtf16(aContentType.Ptr(), aContentType.Length());
   223     iNmPrivateMessagePart->mContentType = qtContentType;
   233     iNmPrivateMessagePart->mContentType = qtContentType;
   224 //</qmail>
   234 //</qmail>
   225 }
   235 }
   227 // -----------------------------------------------------------------------------
   237 // -----------------------------------------------------------------------------
   228 // CFSMailMessagePart::GetPartId
   238 // CFSMailMessagePart::GetPartId
   229 // -----------------------------------------------------------------------------
   239 // -----------------------------------------------------------------------------
   230 EXPORT_C TFSMailMsgId CFSMailMessagePart::GetPartId() const
   240 EXPORT_C TFSMailMsgId CFSMailMessagePart::GetPartId() const
   231 {
   241 {
   232     FUNC_LOG;
   242     NM_FUNCTION;
       
   243     
   233 //<qmail>
   244 //<qmail>
   234     return TFSMailMsgId(iNmPrivateMessagePart->mPartId);
   245     return TFSMailMsgId(iNmPrivateMessagePart->mPartId);
   235 //</qmail>	
   246 //</qmail>	
   236 }
   247 }
   237 
   248 
   240 // CFSMailMessagePart::ChildPartsL
   251 // CFSMailMessagePart::ChildPartsL
   241 // -----------------------------------------------------------------------------
   252 // -----------------------------------------------------------------------------
   242 EXPORT_C void CFSMailMessagePart::ChildPartsL( RPointerArray<CFSMailMessagePart>& aParts,
   253 EXPORT_C void CFSMailMessagePart::ChildPartsL( RPointerArray<CFSMailMessagePart>& aParts,
   243     TFSMailMessagePartDataSource aDataSource)
   254     TFSMailMessagePartDataSource aDataSource)
   244 	{
   255 	{
   245     FUNC_LOG;
   256     NM_FUNCTION;
   246 
   257 
   247     if (aDataSource == EDataSourceMessageStore)
   258     if (aDataSource == EDataSourceMessageStore)
   248         {
   259         {
   249         if (CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
   260         if (CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
   250             {
   261             {
   270 // -----------------------------------------------------------------------------
   281 // -----------------------------------------------------------------------------
   271 // CFSMailMessagePart::ChildPartL
   282 // CFSMailMessagePart::ChildPartL
   272 // -----------------------------------------------------------------------------
   283 // -----------------------------------------------------------------------------
   273 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::ChildPartL(TFSMailMsgId aPartId)
   284 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::ChildPartL(TFSMailMsgId aPartId)
   274 	{
   285 	{
   275     FUNC_LOG;
   286     NM_FUNCTION;
   276 	
   287 	
   277 	CFSMailMessagePart* part = NULL;
   288 	CFSMailMessagePart* part = NULL;
   278 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
   289 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
   279 		{
   290 		{
   280 		part = plugin->MessagePartL(GetMailBoxId(),
   291 		part = plugin->MessagePartL(GetMailBoxId(),
   288 // -----------------------------------------------------------------------------
   299 // -----------------------------------------------------------------------------
   289 // CFSMailMessagePart::IsMessageL
   300 // CFSMailMessagePart::IsMessageL
   290 // -----------------------------------------------------------------------------
   301 // -----------------------------------------------------------------------------
   291 EXPORT_C TBool CFSMailMessagePart::IsMessageL() const
   302 EXPORT_C TBool CFSMailMessagePart::IsMessageL() const
   292 	{
   303 	{
   293     FUNC_LOG;
   304     NM_FUNCTION;
   294 
   305 
   295 	TBuf<KMaxDataTypeLength> ptr;
   306 	TBuf<KMaxDataTypeLength> ptr;
   296 //<qmail>
   307 //<qmail>
   297     if ( !iNmPrivateMessagePart->mContentType.isNull() ) 
   308     if ( !iNmPrivateMessagePart->mContentType.isNull() ) 
   298     {
   309     {
   316 // CFSMailMessagePart::NewChildPartL
   327 // CFSMailMessagePart::NewChildPartL
   317 // -----------------------------------------------------------------------------
   328 // -----------------------------------------------------------------------------
   318 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewChildPartL( const TFSMailMsgId aInsertBefore,
   329 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewChildPartL( const TFSMailMsgId aInsertBefore,
   319 																const TDesC& aContentType )
   330 																const TDesC& aContentType )
   320 	{
   331 	{
   321     FUNC_LOG;
   332     NM_FUNCTION;
   322 
   333 
   323 	CFSMailMessagePart* part = NULL;
   334 	CFSMailMessagePart* part = NULL;
   324 	
   335 	
   325 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
   336 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
   326 		{
   337 		{
   333 // -----------------------------------------------------------------------------
   344 // -----------------------------------------------------------------------------
   334 // CFSMailMessagePart::RemoveChildPartL
   345 // CFSMailMessagePart::RemoveChildPartL
   335 // -----------------------------------------------------------------------------
   346 // -----------------------------------------------------------------------------
   336 EXPORT_C void CFSMailMessagePart::RemoveChildPartL(TFSMailMsgId aPartId)
   347 EXPORT_C void CFSMailMessagePart::RemoveChildPartL(TFSMailMsgId aPartId)
   337 {
   348 {
   338     FUNC_LOG;
   349     NM_FUNCTION;
       
   350     
   339 	// get plugin pointer
   351 	// get plugin pointer
   340 	TFSMailMsgId id = GetPartId();
   352 	TFSMailMsgId id = GetPartId();
   341 	if(id.IsNullId())
   353 	if(id.IsNullId())
   342 		{
   354 		{
   343 		id = GetMessageId();
   355 		id = GetMessageId();
   355 // CFSMailMessagePart::RemoveChildPartL
   367 // CFSMailMessagePart::RemoveChildPartL
   356 // -----------------------------------------------------------------------------
   368 // -----------------------------------------------------------------------------
   357 EXPORT_C TInt CFSMailMessagePart::RemoveChildPartL( TFSMailMsgId aPartId,
   369 EXPORT_C TInt CFSMailMessagePart::RemoveChildPartL( TFSMailMsgId aPartId,
   358                                                     MFSMailRequestObserver& aOperationObserver)
   370                                                     MFSMailRequestObserver& aOperationObserver)
   359 {
   371 {
   360     FUNC_LOG;
   372     NM_FUNCTION;
       
   373     
   361     TFSPendingRequest request;
   374     TFSPendingRequest request;
   362     // get plugin pointer
   375     // get plugin pointer
   363     TFSMailMsgId id = GetPartId();
   376     TFSMailMsgId id = GetPartId();
   364     if(id.IsNullId())
   377     if(id.IsNullId())
   365         {
   378         {
   400 // -----------------------------------------------------------------------------
   413 // -----------------------------------------------------------------------------
   401 // CFSMailMessagePart::GetContentClass
   414 // CFSMailMessagePart::GetContentClass
   402 // -----------------------------------------------------------------------------
   415 // -----------------------------------------------------------------------------
   403 EXPORT_C const TDesC& CFSMailMessagePart::GetContentClass()
   416 EXPORT_C const TDesC& CFSMailMessagePart::GetContentClass()
   404 	{
   417 	{
   405     FUNC_LOG;
   418     NM_FUNCTION;
       
   419     
   406 		return *iContentClass;
   420 		return *iContentClass;
   407 	}
   421 	}
   408 
   422 
   409 // -----------------------------------------------------------------------------
   423 // -----------------------------------------------------------------------------
   410 // CFSMailMessagePart::SetContentClass
   424 // CFSMailMessagePart::SetContentClass
   411 // -----------------------------------------------------------------------------
   425 // -----------------------------------------------------------------------------
   412 EXPORT_C void CFSMailMessagePart::SetContentClass( const TDesC& aContentClass )
   426 EXPORT_C void CFSMailMessagePart::SetContentClass( const TDesC& aContentClass )
   413 	{
   427 	{
   414     FUNC_LOG;
   428     NM_FUNCTION;
   415 
   429 
   416 	// 
   430 	// 
   417 	HBufC* contentClass = HBufC::New(aContentClass.Length());
   431 	HBufC* contentClass = HBufC::New(aContentClass.Length());
   418 	
   432 	
   419 	// store new mailbox name
   433 	// store new mailbox name
   433 // -----------------------------------------------------------------------------
   447 // -----------------------------------------------------------------------------
   434 // CFSMailMessagePart::ContentSize
   448 // CFSMailMessagePart::ContentSize
   435 // -----------------------------------------------------------------------------
   449 // -----------------------------------------------------------------------------
   436 EXPORT_C TUint CFSMailMessagePart::ContentSize() const
   450 EXPORT_C TUint CFSMailMessagePart::ContentSize() const
   437 	{
   451 	{
   438     FUNC_LOG;
   452     NM_FUNCTION;
       
   453     
   439 //<qmail>
   454 //<qmail>
   440     return (TUint)iNmPrivateMessagePart->mSize;
   455     return (TUint)iNmPrivateMessagePart->mSize;
   441 //</qmail>
   456 //</qmail>
   442 	}
   457 	}
   443 
   458 
   444 // -----------------------------------------------------------------------------
   459 // -----------------------------------------------------------------------------
   445 // CFSMailMessagePart::SetContentSize
   460 // CFSMailMessagePart::SetContentSize
   446 // -----------------------------------------------------------------------------
   461 // -----------------------------------------------------------------------------
   447 EXPORT_C void CFSMailMessagePart::SetContentSize( TUint aContentSize )
   462 EXPORT_C void CFSMailMessagePart::SetContentSize( TUint aContentSize )
   448 	{
   463 	{
   449     FUNC_LOG;
   464     NM_FUNCTION;
       
   465     
   450 //<qmail>
   466 //<qmail>
   451     iNmPrivateMessagePart->mSize = quint32(aContentSize);
   467     iNmPrivateMessagePart->mSize = quint32(aContentSize);
   452 //</qmail>
   468 //</qmail>
   453 	}
   469 	}
   454 
   470 
   455 // -----------------------------------------------------------------------------
   471 // -----------------------------------------------------------------------------
   456 // CFSMailMessagePart::ContentID
   472 // CFSMailMessagePart::ContentID
   457 // -----------------------------------------------------------------------------
   473 // -----------------------------------------------------------------------------
   458 EXPORT_C const TDesC& CFSMailMessagePart::ContentID()
   474 EXPORT_C const TDesC& CFSMailMessagePart::ContentID()
   459 	{
   475 	{
   460     FUNC_LOG;
   476     NM_FUNCTION;
       
   477     
   461 //<qmail>	
   478 //<qmail>	
   462     iContentIDPtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentId.utf16()),
   479     iContentIDPtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentId.utf16()),
   463     		iNmPrivateMessagePart->mContentId.length());
   480     		iNmPrivateMessagePart->mContentId.length());
   464     return iContentIDPtr;	
   481     return iContentIDPtr;	
   465 //</qmail>
   482 //</qmail>
   468 // -----------------------------------------------------------------------------
   485 // -----------------------------------------------------------------------------
   469 // CFSMailMessagePart::SetContentIDL
   486 // CFSMailMessagePart::SetContentIDL
   470 // -----------------------------------------------------------------------------
   487 // -----------------------------------------------------------------------------
   471 EXPORT_C void CFSMailMessagePart::SetContentIDL(const TDesC& aContentID)
   488 EXPORT_C void CFSMailMessagePart::SetContentIDL(const TDesC& aContentID)
   472 	{
   489 	{
   473     FUNC_LOG;
   490     NM_FUNCTION;
       
   491     
   474 //<qmail>
   492 //<qmail>
   475     QString qtContentID = QString::fromUtf16(aContentID.Ptr(), aContentID.Length());
   493     QString qtContentID = QString::fromUtf16(aContentID.Ptr(), aContentID.Length());
   476     iNmPrivateMessagePart->mContentId = qtContentID;    
   494     iNmPrivateMessagePart->mContentId = qtContentID;    
   477 //</qmail>    
   495 //</qmail>    
   478 	}
   496 	}
   482 // -----------------------------------------------------------------------------
   500 // -----------------------------------------------------------------------------
   483 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::CopyMessageAsChildPartL(
   501 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::CopyMessageAsChildPartL(
   484 													TFSMailMsgId aInsertBefore,
   502 													TFSMailMsgId aInsertBefore,
   485 													CFSMailMessage* aMessage)
   503 													CFSMailMessage* aMessage)
   486 	{
   504 	{
   487     FUNC_LOG;
   505     NM_FUNCTION;
   488 	
   506 	
   489 	CFSMailMessagePart* part = NULL;
   507 	CFSMailMessagePart* part = NULL;
   490 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   508 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   491 	{
   509 	{
   492 		part = plugin->CopyMessageAsChildPartL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),
   510 		part = plugin->CopyMessageAsChildPartL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),
   498 // -----------------------------------------------------------------------------
   516 // -----------------------------------------------------------------------------
   499 // CFSMailMessagePart::RemoveContentL
   517 // CFSMailMessagePart::RemoveContentL
   500 // -----------------------------------------------------------------------------
   518 // -----------------------------------------------------------------------------
   501 EXPORT_C void CFSMailMessagePart::RemoveContentL()
   519 EXPORT_C void CFSMailMessagePart::RemoveContentL()
   502 	{
   520 	{
   503     FUNC_LOG;
   521     NM_FUNCTION;
   504 	
   522 	
   505 	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
   523 	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
   506 	if(plugin == NULL)
   524 	if(plugin == NULL)
   507 	    {
   525 	    {
   508 	    plugin = iRequestHandler->GetPluginByUid(GetMessageId());
   526 	    plugin = iRequestHandler->GetPluginByUid(GetMessageId());
   527 // -----------------------------------------------------------------------------
   545 // -----------------------------------------------------------------------------
   528 // CFSMailMessagePart::RemoveDownLoadedAttachmentsL
   546 // CFSMailMessagePart::RemoveDownLoadedAttachmentsL
   529 // -----------------------------------------------------------------------------
   547 // -----------------------------------------------------------------------------
   530 EXPORT_C void CFSMailMessagePart::RemoveDownLoadedAttachmentsL()
   548 EXPORT_C void CFSMailMessagePart::RemoveDownLoadedAttachmentsL()
   531     {
   549     {
   532     FUNC_LOG;
   550     NM_FUNCTION;
   533         
   551         
   534     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
   552     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
   535     if(plugin == NULL)
   553     if(plugin == NULL)
   536         {
   554         {
   537         plugin = iRequestHandler->GetPluginByUid(GetMessageId());
   555         plugin = iRequestHandler->GetPluginByUid(GetMessageId());
   567 // -----------------------------------------------------------------------------
   585 // -----------------------------------------------------------------------------
   568 // CFSMailMessagePart::GetContentFileL
   586 // CFSMailMessagePart::GetContentFileL
   569 // -----------------------------------------------------------------------------
   587 // -----------------------------------------------------------------------------
   570 EXPORT_C RFile CFSMailMessagePart::GetContentFileL()
   588 EXPORT_C RFile CFSMailMessagePart::GetContentFileL()
   571 	{
   589 	{
   572     FUNC_LOG;
   590     NM_FUNCTION;
   573 	
   591 	
   574 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   592 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   575 		{
   593 		{
   576 		TInt rcode = plugin->GetMessagePartFileL( GetMailBoxId(), GetFolderId(),
   594 		TInt rcode = plugin->GetMessagePartFileL( GetMailBoxId(), GetFolderId(),
   577 					                            GetMessageId(), GetPartId(),
   595 					                            GetMessageId(), GetPartId(),
   594 // -----------------------------------------------------------------------------
   612 // -----------------------------------------------------------------------------
   595 // CFSMailMessagePart::SetContentFromFileL
   613 // CFSMailMessagePart::SetContentFromFileL
   596 // -----------------------------------------------------------------------------
   614 // -----------------------------------------------------------------------------
   597 EXPORT_C void CFSMailMessagePart::SetContentFromFileL(const TDesC& aFilePath)
   615 EXPORT_C void CFSMailMessagePart::SetContentFromFileL(const TDesC& aFilePath)
   598 	{
   616 	{
   599     FUNC_LOG;
   617     NM_FUNCTION;
       
   618     
   600 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   619 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   601 		{
   620 		{
   602 		plugin->SetPartContentFromFileL(GetMailBoxId(), GetFolderId(),
   621 		plugin->SetPartContentFromFileL(GetMailBoxId(), GetFolderId(),
   603 			GetMessageId(), GetPartId(), aFilePath );
   622 			GetMessageId(), GetPartId(), aFilePath );
   604 		}
   623 		}
   607 // -----------------------------------------------------------------------------
   626 // -----------------------------------------------------------------------------
   608 // CFSMailMessagePart::CopyContentFileL
   627 // CFSMailMessagePart::CopyContentFileL
   609 // -----------------------------------------------------------------------------
   628 // -----------------------------------------------------------------------------
   610 EXPORT_C void CFSMailMessagePart::CopyContentFileL( const TDesC& aFilePath )
   629 EXPORT_C void CFSMailMessagePart::CopyContentFileL( const TDesC& aFilePath )
   611 	{
   630 	{
   612     FUNC_LOG;
   631     NM_FUNCTION;
       
   632     
   613 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   633 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   614 		{
   634 		{
   615 		plugin->CopyMessagePartFileL( GetMailBoxId(), GetFolderId(),
   635 		plugin->CopyMessagePartFileL( GetMailBoxId(), GetFolderId(),
   616 			GetMessageId(), GetPartId(), aFilePath);		
   636 			GetMessageId(), GetPartId(), aFilePath);		
   617 		}
   637 		}
   620 // -----------------------------------------------------------------------------
   640 // -----------------------------------------------------------------------------
   621 // CFSMailMessagePart::GetContentToBufferL
   641 // CFSMailMessagePart::GetContentToBufferL
   622 // -----------------------------------------------------------------------------
   642 // -----------------------------------------------------------------------------
   623 EXPORT_C void CFSMailMessagePart::GetContentToBufferL(TDes16& aBuffer, TUint aStartOffset)
   643 EXPORT_C void CFSMailMessagePart::GetContentToBufferL(TDes16& aBuffer, TUint aStartOffset)
   624 	{
   644 	{
   625     FUNC_LOG;
   645     NM_FUNCTION;
       
   646     
   626 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   647 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   627 		{
   648 		{
   628 		plugin->GetContentToBufferL( GetMailBoxId(), GetFolderId(), GetMessageId(),
   649 		plugin->GetContentToBufferL( GetMailBoxId(), GetFolderId(), GetMessageId(),
   629 									 GetPartId(), aBuffer, aStartOffset );
   650 									 GetPartId(), aBuffer, aStartOffset );
   630 		}
   651 		}
   633 // -----------------------------------------------------------------------------
   654 // -----------------------------------------------------------------------------
   634 // CFSMailMessagePart::SetContent
   655 // CFSMailMessagePart::SetContent
   635 // -----------------------------------------------------------------------------
   656 // -----------------------------------------------------------------------------
   636 EXPORT_C void CFSMailMessagePart::SetContent( TDes16& aBuffer )
   657 EXPORT_C void CFSMailMessagePart::SetContent( TDes16& aBuffer )
   637 	{
   658 	{
   638     FUNC_LOG;
   659     NM_FUNCTION;
       
   660     
   639 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   661 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   640 		{
   662 		{
   641 // <qmail>
   663 // <qmail>
   642         TRAP_IGNORE(plugin->SetContentL( aBuffer, GetMailBoxId(), GetFolderId(),
   664         TRAP_IGNORE(plugin->SetContentL( aBuffer, GetMailBoxId(), GetFolderId(),
   643             GetMessageId(), GetPartId() ));
   665             GetMessageId(), GetPartId() ));
   648 // -----------------------------------------------------------------------------
   670 // -----------------------------------------------------------------------------
   649 // CFSMailMessagePart::ContentDescription
   671 // CFSMailMessagePart::ContentDescription
   650 // -----------------------------------------------------------------------------
   672 // -----------------------------------------------------------------------------
   651 EXPORT_C const TDesC& CFSMailMessagePart::ContentDescription()
   673 EXPORT_C const TDesC& CFSMailMessagePart::ContentDescription()
   652 	{
   674 	{
   653     FUNC_LOG;
   675     NM_FUNCTION;
       
   676     
   654 //<qmail>
   677 //<qmail>
   655     iContentDescriptionPtr.Set(reinterpret_cast<const TUint16*> (
   678     iContentDescriptionPtr.Set(reinterpret_cast<const TUint16*> (
   656             iNmPrivateMessagePart->mContentDescription.utf16()),
   679             iNmPrivateMessagePart->mContentDescription.utf16()),
   657     		iNmPrivateMessagePart->mContentDescription.length());
   680     		iNmPrivateMessagePart->mContentDescription.length());
   658     
   681     
   663 // -----------------------------------------------------------------------------
   686 // -----------------------------------------------------------------------------
   664 // CFSMailMessagePart::SetContentDescription
   687 // CFSMailMessagePart::SetContentDescription
   665 // -----------------------------------------------------------------------------
   688 // -----------------------------------------------------------------------------
   666 EXPORT_C void CFSMailMessagePart::SetContentDescription( const TDesC& aContentDescription )
   689 EXPORT_C void CFSMailMessagePart::SetContentDescription( const TDesC& aContentDescription )
   667 	{
   690 	{
   668     FUNC_LOG;
   691     NM_FUNCTION;
       
   692     
   669 //<qmail>
   693 //<qmail>
   670     QString qtContentDescription = QString::fromUtf16(
   694     QString qtContentDescription = QString::fromUtf16(
   671             aContentDescription.Ptr(), aContentDescription.Length());
   695             aContentDescription.Ptr(), aContentDescription.Length());
   672     iNmPrivateMessagePart->mContentDescription = qtContentDescription;
   696     iNmPrivateMessagePart->mContentDescription = qtContentDescription;
   673 //</qmail>
   697 //</qmail>
   675 // -----------------------------------------------------------------------------
   699 // -----------------------------------------------------------------------------
   676 // CFSMailMessagePart::ContentDisposition
   700 // CFSMailMessagePart::ContentDisposition
   677 // -----------------------------------------------------------------------------
   701 // -----------------------------------------------------------------------------
   678 EXPORT_C const TDesC& CFSMailMessagePart::ContentDisposition()
   702 EXPORT_C const TDesC& CFSMailMessagePart::ContentDisposition()
   679 	{
   703 	{
   680     FUNC_LOG;
   704     NM_FUNCTION;
       
   705     
   681 //<qmail>
   706 //<qmail>
   682 	iContentDispositionPtr.Set(reinterpret_cast<const TUint16*> (
   707 	iContentDispositionPtr.Set(reinterpret_cast<const TUint16*> (
   683 	        iNmPrivateMessagePart->mContentDisposition.utf16()),
   708 	        iNmPrivateMessagePart->mContentDisposition.utf16()),
   684 			iNmPrivateMessagePart->mContentDisposition.length());
   709 			iNmPrivateMessagePart->mContentDisposition.length());
   685 	return iContentDispositionPtr;
   710 	return iContentDispositionPtr;
   689 // -----------------------------------------------------------------------------
   714 // -----------------------------------------------------------------------------
   690 // CFSMailMessagePart::SetContentDisposition
   715 // CFSMailMessagePart::SetContentDisposition
   691 // -----------------------------------------------------------------------------
   716 // -----------------------------------------------------------------------------
   692 EXPORT_C void CFSMailMessagePart::SetContentDisposition( const TDesC& aContentDisposition )
   717 EXPORT_C void CFSMailMessagePart::SetContentDisposition( const TDesC& aContentDisposition )
   693 	{
   718 	{
   694     FUNC_LOG;
   719     NM_FUNCTION;
       
   720     
   695 //<qmail>
   721 //<qmail>
   696     QString qtContentDisposition = QString::fromUtf16(
   722     QString qtContentDisposition = QString::fromUtf16(
   697             aContentDisposition.Ptr(), aContentDisposition.Length());
   723             aContentDisposition.Ptr(), aContentDisposition.Length());
   698     iNmPrivateMessagePart->mContentDisposition = qtContentDisposition;
   724     iNmPrivateMessagePart->mContentDisposition = qtContentDisposition;
   699 //</qmail>
   725 //</qmail>
   702 // -----------------------------------------------------------------------------
   728 // -----------------------------------------------------------------------------
   703 // CFSMailMessagePart::ContentTypeParameters
   729 // CFSMailMessagePart::ContentTypeParameters
   704 // -----------------------------------------------------------------------------
   730 // -----------------------------------------------------------------------------
   705 EXPORT_C CDesCArray& CFSMailMessagePart::ContentTypeParameters()
   731 EXPORT_C CDesCArray& CFSMailMessagePart::ContentTypeParameters()
   706 	{
   732 	{
   707     FUNC_LOG;
   733     NM_FUNCTION;
       
   734     
   708 //<qmail>	
   735 //<qmail>	
   709     if (iNmPrivateMessagePart->mContentType.isNull())
   736     if (iNmPrivateMessagePart->mContentType.isNull())
   710 		{
   737 		{
   711 		return *iContentTypeParams;
   738 		return *iContentTypeParams;
   712 		}
   739 		}
   799 // -----------------------------------------------------------------------------
   826 // -----------------------------------------------------------------------------
   800 // CFSMailMessagePart::ContentDispositionParameters
   827 // CFSMailMessagePart::ContentDispositionParameters
   801 // -----------------------------------------------------------------------------
   828 // -----------------------------------------------------------------------------
   802 EXPORT_C CDesCArray& CFSMailMessagePart::ContentDispositionParameters()
   829 EXPORT_C CDesCArray& CFSMailMessagePart::ContentDispositionParameters()
   803 	{
   830 	{
   804     FUNC_LOG;
   831     NM_FUNCTION;
   805 	
   832 	
   806 //<qmail>
   833 //<qmail>
   807     const TDesC& contentDisposition = ContentDisposition();
   834     const TDesC& contentDisposition = ContentDisposition();
   808     
   835     
   809 	if(!contentDisposition.Ptr())
   836 	if(!contentDisposition.Ptr())
   933 // -----------------------------------------------------------------------------
   960 // -----------------------------------------------------------------------------
   934 // CFSMailMessagePart::GetMRInfo
   961 // CFSMailMessagePart::GetMRInfo
   935 // -----------------------------------------------------------------------------
   962 // -----------------------------------------------------------------------------
   936 EXPORT_C MMRInfoObject& CFSMailMessagePart::GetMRInfo()
   963 EXPORT_C MMRInfoObject& CFSMailMessagePart::GetMRInfo()
   937 {
   964 {
   938     FUNC_LOG;
   965     NM_FUNCTION;
       
   966     
   939 	return *iMeetingRequest;
   967 	return *iMeetingRequest;
   940 }
   968 }
   941 
   969 
   942 // -----------------------------------------------------------------------------
   970 // -----------------------------------------------------------------------------
   943 // CFSMailMessagePart::IsMRInfoSet
   971 // CFSMailMessagePart::IsMRInfoSet
   944 // -----------------------------------------------------------------------------
   972 // -----------------------------------------------------------------------------
   945 EXPORT_C TBool CFSMailMessagePart::IsMRInfoSet()
   973 EXPORT_C TBool CFSMailMessagePart::IsMRInfoSet()
   946 {
   974 {
   947     FUNC_LOG;
   975     NM_FUNCTION;
       
   976     
   948 	if(iMeetingRequest)
   977 	if(iMeetingRequest)
   949 		{
   978 		{
   950 		return ETrue;
   979 		return ETrue;
   951 		}
   980 		}
   952 	else
   981 	else
   958 // -----------------------------------------------------------------------------
   987 // -----------------------------------------------------------------------------
   959 // CFSMailMessagePart::SetMRInfo
   988 // CFSMailMessagePart::SetMRInfo
   960 // -----------------------------------------------------------------------------	
   989 // -----------------------------------------------------------------------------	
   961 EXPORT_C void CFSMailMessagePart::SetMRInfo(MMRInfoObject* aMeetingRequest)
   990 EXPORT_C void CFSMailMessagePart::SetMRInfo(MMRInfoObject* aMeetingRequest)
   962 {
   991 {
   963     FUNC_LOG;
   992     NM_FUNCTION;
       
   993     
   964 	if(iMeetingRequest)
   994 	if(iMeetingRequest)
   965 	{
   995 	{
   966 		delete iMeetingRequest;
   996 		delete iMeetingRequest;
   967 	}
   997 	}
   968 	iMeetingRequest = aMeetingRequest;
   998 	iMeetingRequest = aMeetingRequest;
   971 // -----------------------------------------------------------------------------
  1001 // -----------------------------------------------------------------------------
   972 // CFSMailMessagePart::SaveL
  1002 // CFSMailMessagePart::SaveL
   973 // -----------------------------------------------------------------------------
  1003 // -----------------------------------------------------------------------------
   974 EXPORT_C void CFSMailMessagePart::SaveL()
  1004 EXPORT_C void CFSMailMessagePart::SaveL()
   975 	{
  1005 	{
   976     FUNC_LOG;
  1006     NM_FUNCTION;
       
  1007     
   977 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
  1008 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
   978 		{
  1009 		{
   979 		plugin->StoreMessagePartL( GetMailBoxId(), GetFolderId(), GetMessageId(), *this );		
  1010 		plugin->StoreMessagePartL( GetMailBoxId(), GetFolderId(), GetMessageId(), *this );		
   980 		}
  1011 		}
   981 	}
  1012 	}
   984 // -----------------------------------------------------------------------------
  1015 // -----------------------------------------------------------------------------
   985 // CFSMailMessagePart::SetAttachmentNameL
  1016 // CFSMailMessagePart::SetAttachmentNameL
   986 // -----------------------------------------------------------------------------
  1017 // -----------------------------------------------------------------------------
   987 EXPORT_C void CFSMailMessagePart::SetAttachmentNameL(const TDesC& aFilePath)
  1018 EXPORT_C void CFSMailMessagePart::SetAttachmentNameL(const TDesC& aFilePath)
   988 	{
  1019 	{
   989     FUNC_LOG;
  1020     NM_FUNCTION;
       
  1021     
   990 	    // Parse file name in case full path is given
  1022 	    // Parse file name in case full path is given
   991 		TPtrC name;
  1023 		TPtrC name;
   992 		for(TInt i=0;i<aFilePath.Length();)
  1024 		for(TInt i=0;i<aFilePath.Length();)
   993 			{
  1025 			{
   994 			name.Set(aFilePath.Mid(i,(aFilePath.Length()-i)));
  1026 			name.Set(aFilePath.Mid(i,(aFilePath.Length()-i)));
  1055 // -----------------------------------------------------------------------------
  1087 // -----------------------------------------------------------------------------
  1056 // CFSMailMessagePart::AttachmentNameL
  1088 // CFSMailMessagePart::AttachmentNameL
  1057 // -----------------------------------------------------------------------------
  1089 // -----------------------------------------------------------------------------
  1058 EXPORT_C TDesC& CFSMailMessagePart::AttachmentNameL()
  1090 EXPORT_C TDesC& CFSMailMessagePart::AttachmentNameL()
  1059 	{
  1091 	{
  1060     FUNC_LOG;
  1092     NM_FUNCTION;
       
  1093     
  1061 //<qmail>
  1094 //<qmail>
  1062     // Look first from Content-Type param "name"
  1095     // Look first from Content-Type param "name"
  1063 	TInt ptr = GetContentType().Find(KFSMailContentTypeParamName);
  1096 	TInt ptr = GetContentType().Find(KFSMailContentTypeParamName);
  1064     if(ptr >= 0)
  1097     if(ptr >= 0)
  1065     	{
  1098     	{
  1107 // -----------------------------------------------------------------------------
  1140 // -----------------------------------------------------------------------------
  1108 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::FindBodyPartL(
  1141 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::FindBodyPartL(
  1109         const TDesC& aContentType, 
  1142         const TDesC& aContentType, 
  1110         TFSMailMessagePartDataSource aDataSource)
  1143         TFSMailMessagePartDataSource aDataSource)
  1111     {
  1144     {
  1112     FUNC_LOG;
  1145     NM_FUNCTION;
  1113 
  1146 
  1114     TBuf<KMaxDataTypeLength> ptr;
  1147     TBuf<KMaxDataTypeLength> ptr;
  1115     if (!iNmPrivateMessagePart->mContentType.isNull())
  1148     if (!iNmPrivateMessagePart->mContentType.isNull())
  1116         {
  1149         {
  1117         ptr.Copy(GetContentType());
  1150         ptr.Copy(GetContentType());
  1214 // -----------------------------------------------------------------------------
  1247 // -----------------------------------------------------------------------------
  1215 // CFSMailMessagePart::ContentTypeMatches
  1248 // CFSMailMessagePart::ContentTypeMatches
  1216 // -----------------------------------------------------------------------------
  1249 // -----------------------------------------------------------------------------
  1217 EXPORT_C TBool CFSMailMessagePart::ContentTypeMatches( const TDesC& aContentType )
  1250 EXPORT_C TBool CFSMailMessagePart::ContentTypeMatches( const TDesC& aContentType )
  1218 {
  1251 {
  1219     FUNC_LOG;
  1252     NM_FUNCTION;
  1220 
  1253 
  1221 	TBuf<KMaxDataTypeLength> ptr;
  1254 	TBuf<KMaxDataTypeLength> ptr;
  1222 	TBool result(EFalse);
  1255 	TBool result(EFalse);
  1223 //<qmail>
  1256 //<qmail>
  1224 	if ( !iNmPrivateMessagePart->mContentType.isNull() )
  1257 	if ( !iNmPrivateMessagePart->mContentType.isNull() )
  1244 // CFSMailMessagePart::AppendAttachmentsL
  1277 // CFSMailMessagePart::AppendAttachmentsL
  1245 // -----------------------------------------------------------------------------
  1278 // -----------------------------------------------------------------------------
  1246 EXPORT_C void CFSMailMessagePart::AppendAttachmentsL(
  1279 EXPORT_C void CFSMailMessagePart::AppendAttachmentsL(
  1247     RPointerArray<CFSMailMessagePart>& aParts)
  1280     RPointerArray<CFSMailMessagePart>& aParts)
  1248     {
  1281     {
  1249     FUNC_LOG;
  1282     NM_FUNCTION;
       
  1283     
  1250     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
  1284     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
  1251     if ( plugin )
  1285     if ( plugin )
  1252         {
  1286         {
  1253         RPointerArray<CFSMailMessagePart> messageParts;
  1287         RPointerArray<CFSMailMessagePart> messageParts;
  1254         CleanupResetAndDestroyPushL( messageParts );
  1288         CleanupResetAndDestroyPushL( messageParts );
  1281 // -----------------------------------------------------------------------------
  1315 // -----------------------------------------------------------------------------
  1282 // CFSMailMessagePart::FetchedContentSize
  1316 // CFSMailMessagePart::FetchedContentSize
  1283 // -----------------------------------------------------------------------------
  1317 // -----------------------------------------------------------------------------
  1284 EXPORT_C TUint CFSMailMessagePart::FetchedContentSize() const
  1318 EXPORT_C TUint CFSMailMessagePart::FetchedContentSize() const
  1285 	{
  1319 	{
  1286     FUNC_LOG;
  1320     NM_FUNCTION;
       
  1321     
  1287 //<qmail>
  1322 //<qmail>
  1288     return (TUint)iNmPrivateMessagePart->mFetchedSize;
  1323     return (TUint)iNmPrivateMessagePart->mFetchedSize;
  1289 //</qmail>
  1324 //</qmail>
  1290 	}
  1325 	}
  1291 
  1326 
  1292 // -----------------------------------------------------------------------------
  1327 // -----------------------------------------------------------------------------
  1293 // CFSMailMessagePart::SetFetchedContentSize
  1328 // CFSMailMessagePart::SetFetchedContentSize
  1294 // -----------------------------------------------------------------------------
  1329 // -----------------------------------------------------------------------------
  1295 EXPORT_C void CFSMailMessagePart::SetFetchedContentSize(TUint aContentSize)
  1330 EXPORT_C void CFSMailMessagePart::SetFetchedContentSize(TUint aContentSize)
  1296 	{
  1331 	{
  1297     FUNC_LOG;
  1332     NM_FUNCTION;
       
  1333     
  1298 //<qmail>
  1334 //<qmail>
  1299     iNmPrivateMessagePart->mFetchedSize = quint32(aContentSize);
  1335     iNmPrivateMessagePart->mFetchedSize = quint32(aContentSize);
  1300 //</qmail>
  1336 //</qmail>
  1301 	}
  1337 	}
  1302 
  1338 
  1303 // -----------------------------------------------------------------------------
  1339 // -----------------------------------------------------------------------------
  1304 // CFSMailMessagePart::FetchLoadState
  1340 // CFSMailMessagePart::FetchLoadState
  1305 // -----------------------------------------------------------------------------
  1341 // -----------------------------------------------------------------------------
  1306 EXPORT_C TFSPartFetchState CFSMailMessagePart::FetchLoadState() const
  1342 EXPORT_C TFSPartFetchState CFSMailMessagePart::FetchLoadState() const
  1307 	{
  1343 	{
  1308     FUNC_LOG;
  1344     NM_FUNCTION;
       
  1345     
  1309 //<qmail>
  1346 //<qmail>
  1310 	 if(iMessagePartsStatus != EFSDefault)
  1347 	 if(iMessagePartsStatus != EFSDefault)
  1311 		{
  1348 		{
  1312 		return iMessagePartsStatus;
  1349 		return iMessagePartsStatus;
  1313 		}
  1350 		}
  1335 // -----------------------------------------------------------------------------
  1372 // -----------------------------------------------------------------------------
  1336 EXPORT_C TInt CFSMailMessagePart::FetchMessagePartL( 	const TFSMailMsgId /*aMessagePartId*/,
  1373 EXPORT_C TInt CFSMailMessagePart::FetchMessagePartL( 	const TFSMailMsgId /*aMessagePartId*/,
  1337         										  		MFSMailRequestObserver& aOperationObserver,
  1374         										  		MFSMailRequestObserver& aOperationObserver,
  1338         												const TUint aPreferredByteCount)
  1375         												const TUint aPreferredByteCount)
  1339     {
  1376     {
  1340     FUNC_LOG;
  1377     NM_FUNCTION;
  1341     
  1378     
  1342 	TInt requestId(0);
  1379 	TInt requestId(0);
  1343 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
  1380 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
  1344 		{
  1381 		{
  1345 		
  1382 		
  1377 EXPORT_C TInt CFSMailMessagePart::FetchMessagesPartsL( 
  1414 EXPORT_C TInt CFSMailMessagePart::FetchMessagesPartsL( 
  1378 									const RArray<TFSMailMsgId>& aMessagePartIds,
  1415 									const RArray<TFSMailMsgId>& aMessagePartIds,
  1379         							MFSMailRequestObserver& aOperationObserver,
  1416         							MFSMailRequestObserver& aOperationObserver,
  1380         							const TUint aPreferredByteCount)
  1417         							const TUint aPreferredByteCount)
  1381     {
  1418     {
  1382     FUNC_LOG;
  1419     NM_FUNCTION;
  1383 
  1420 
  1384 	TInt requestId(0);
  1421 	TInt requestId(0);
  1385     
  1422     
  1386 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
  1423 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
  1387 		{
  1424 		{
  1419 // -----------------------------------------------------------------------------
  1456 // -----------------------------------------------------------------------------
  1420 // CFSMailMessagePart::SetMessagePartsStatus
  1457 // CFSMailMessagePart::SetMessagePartsStatus
  1421 // -----------------------------------------------------------------------------
  1458 // -----------------------------------------------------------------------------
  1422 EXPORT_C void CFSMailMessagePart::SetMessagePartsStatus(TFSPartFetchState aMessagePartStatus)
  1459 EXPORT_C void CFSMailMessagePart::SetMessagePartsStatus(TFSPartFetchState aMessagePartStatus)
  1423 	{
  1460 	{
  1424     FUNC_LOG;
  1461     NM_FUNCTION;
       
  1462     
  1425 	iMessagePartsStatus = aMessagePartStatus;
  1463 	iMessagePartsStatus = aMessagePartStatus;
  1426 	}
  1464 	}
  1427 
  1465 
  1428 // -----------------------------------------------------------------------------
  1466 // -----------------------------------------------------------------------------
  1429 // CFSMailMessagePart::AddNewAttachmentL
  1467 // CFSMailMessagePart::AddNewAttachmentL
  1430 // -----------------------------------------------------------------------------
  1468 // -----------------------------------------------------------------------------
  1431 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::AddNewAttachmentL(	const TDesC& aFilePath,
  1469 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::AddNewAttachmentL(	const TDesC& aFilePath,
  1432 																const TFSMailMsgId /*aInsertBefore*/,
  1470 																const TFSMailMsgId /*aInsertBefore*/,
  1433 																const TDesC& aContentType )
  1471 																const TDesC& aContentType )
  1434     {
  1472     {
  1435     FUNC_LOG;
  1473     NM_FUNCTION;
       
  1474     
  1436     CFSMailMessagePart* newPart = NULL;
  1475     CFSMailMessagePart* newPart = NULL;
  1437 
  1476 
  1438     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
  1477     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
  1439     if ( plugin )
  1478     if ( plugin )
  1440         {
  1479         {
  1462 // -----------------------------------------------------------------------------
  1501 // -----------------------------------------------------------------------------
  1463 // CFSMailMessagePart::ReadOnlyPartSize
  1502 // CFSMailMessagePart::ReadOnlyPartSize
  1464 // -----------------------------------------------------------------------------
  1503 // -----------------------------------------------------------------------------
  1465 EXPORT_C TUint CFSMailMessagePart::ReadOnlyPartSize() const
  1504 EXPORT_C TUint CFSMailMessagePart::ReadOnlyPartSize() const
  1466 {
  1505 {
  1467     FUNC_LOG;
  1506     NM_FUNCTION;
       
  1507     
  1468     return iReadOnlyPartSize;
  1508     return iReadOnlyPartSize;
  1469 }
  1509 }
  1470 
  1510 
  1471 // -----------------------------------------------------------------------------
  1511 // -----------------------------------------------------------------------------
  1472 // CFSMailMessagePart::SetReadOnlyPartSize
  1512 // CFSMailMessagePart::SetReadOnlyPartSize
  1473 // -----------------------------------------------------------------------------
  1513 // -----------------------------------------------------------------------------
  1474 EXPORT_C void CFSMailMessagePart::SetReadOnlyPartSize(const TUint aReadOnlyPartSize)
  1514 EXPORT_C void CFSMailMessagePart::SetReadOnlyPartSize(const TUint aReadOnlyPartSize)
  1475 {
  1515 {
  1476     FUNC_LOG;
  1516     NM_FUNCTION;
       
  1517     
  1477     iReadOnlyPartSize = aReadOnlyPartSize;
  1518     iReadOnlyPartSize = aReadOnlyPartSize;
  1478 }
  1519 }
  1479 
  1520 
  1480 // -----------------------------------------------------------------------------
  1521 // -----------------------------------------------------------------------------
  1481 // CFSMailMessagePart::DoAttachmentListL
  1522 // CFSMailMessagePart::DoAttachmentListL
  1482 // -----------------------------------------------------------------------------
  1523 // -----------------------------------------------------------------------------
  1483 void CFSMailMessagePart::DoAttachmentListL( RPointerArray<CFSMailMessagePart>& /*aParts*/ )
  1524 void CFSMailMessagePart::DoAttachmentListL( RPointerArray<CFSMailMessagePart>& /*aParts*/ )
  1484 {
  1525 {
  1485     FUNC_LOG;
  1526     NM_FUNCTION;
  1486 }
  1527 }
  1487 
  1528 
  1488 //<qmail>
  1529 //<qmail>
  1489 // -----------------------------------------------------------------------------
  1530 // -----------------------------------------------------------------------------
  1490 // CFSMailMessagePart::GetNmMessagePart
  1531 // CFSMailMessagePart::GetNmMessagePart
  1491 // -----------------------------------------------------------------------------
  1532 // -----------------------------------------------------------------------------
  1492 EXPORT_C NmMessagePart* CFSMailMessagePart::GetNmMessagePart()
  1533 EXPORT_C NmMessagePart* CFSMailMessagePart::GetNmMessagePart()
  1493 {
  1534 {
  1494     FUNC_LOG;
  1535     NM_FUNCTION;
       
  1536     
  1495     return new NmMessagePart(iNmPrivateMessagePart);
  1537     return new NmMessagePart(iNmPrivateMessagePart);
  1496 }
  1538 }
  1497 //</qmail>
  1539 //</qmail>
  1498 
  1540 
  1499 //<qmail>
  1541 //<qmail>
  1500 // -----------------------------------------------------------------------------
  1542 // -----------------------------------------------------------------------------
  1501 // CFSMailMessagePart::GetLocalTextContentLC
  1543 // CFSMailMessagePart::GetLocalTextContentLC
  1502 // -----------------------------------------------------------------------------
  1544 // -----------------------------------------------------------------------------
  1503 EXPORT_C HBufC* CFSMailMessagePart::GetLocalTextContentLC()
  1545 EXPORT_C HBufC* CFSMailMessagePart::GetLocalTextContentLC()
  1504 {
  1546 {
  1505     FUNC_LOG;
  1547     NM_FUNCTION;
       
  1548     
  1506     return NmConverter::qstringToHBufCLC(iNmPrivateMessagePart->mTextContent);
  1549     return NmConverter::qstringToHBufCLC(iNmPrivateMessagePart->mTextContent);
  1507 }
  1550 }
  1508 //</qmail>
  1551 //</qmail>