emailservices/emailclientapi/src/emailmessage.cpp
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
   512         /* No content, return NULL */
   512         /* No content, return NULL */
   513         CleanupStack::Pop(); // parts
   513         CleanupStack::Pop(); // parts
   514         return NULL;
   514         return NULL;
   515         }
   515         }
   516     CFSMailMessagePart* part = parts[0];
   516     CFSMailMessagePart* part = parts[0];
   517     const TDesC& contentType = part->GetContentType();
   517     TContentType contentType( part->GetContentType() ); 
   518     TMessageContentId msgContentId = TMessageContentId( 
   518     TMessageContentId msgContentId = TMessageContentId( 
   519                         part->GetPartId().Id(),
   519                         part->GetPartId().Id(),
   520                         iMessageId.iId,
   520                         iMessageId.iId,
   521                         iMessageId.iFolderId.iId,
   521                         iMessageId.iFolderId.iId,
   522                         iMessageId.iFolderId.iMailboxId ); 
   522                         iMessageId.iFolderId.iMailboxId ); 
   523 
   523 
   524     if (!contentType.Find(KFSMailContentTypeTextPlain) || 
   524     if ( contentType.Equals( KFSMailContentTypeTextPlain ) || 
   525         !contentType.Find(KFSMailContentTypeTextHtml))
   525         contentType.Equals( KFSMailContentTypeTextHtml ) )
   526         {                                
   526         {                                
   527         iTextContent = CEmailTextContent::NewL(iPluginData, msgContentId, part, EAPIOwns );        
   527         iTextContent = CEmailTextContent::NewL(iPluginData, msgContentId, part, EAPIOwns );        
   528         }
   528         }
   529     else if (!contentType.Find(KFSMailContentTypeMultipartMixed) ||
   529     else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) ||
   530              !contentType.Find(KFSMailContentTypeMultipartAlternative) ||
   530               contentType.Equals( KFSMailContentTypeMultipartAlternative ) ||
   531              !contentType.Find(KFSMailContentTypeMultipartDigest) ||
   531               contentType.Equals( KFSMailContentTypeMultipartDigest ) ||
   532              !contentType.Find(KFSMailContentTypeMultipartRelated) ||
   532               contentType.Equals( KFSMailContentTypeMultipartRelated ) ||
   533              !contentType.Find(KFSMailContentTypeMultipartParallel))
   533               contentType.Equals( KFSMailContentTypeMultipartParallel ) )
   534         {
   534         {
   535         iContent = CEmailMultipart::NewL(iPluginData, msgContentId, part, EAPIOwns);
   535         iContent = CEmailMultipart::NewL(iPluginData, msgContentId, part, EAPIOwns);
   536         }
   536         }
   537     if (count == 2 )
   537     if ( count == 2 )
   538         {
   538         {
   539         CFSMailMessagePart* part = parts[1];
   539         CFSMailMessagePart* part = parts[1];
   540         const TDesC& contentType = part->GetContentType();
   540         const TDesC& contentType = part->GetContentType();
   541         }
   541         }
   542     CleanupStack::Pop(); // parts
   542     CleanupStack::Pop(); // parts
   855     CVwsSessionWrapper* viewSrvSession = CVwsSessionWrapper::NewLC();
   855     CVwsSessionWrapper* viewSrvSession = CVwsSessionWrapper::NewLC();
   856     TUid command = TUid::Uid(KEditorCmdForward);
   856     TUid command = TUid::Uid(KEditorCmdForward);
   857     viewSrvSession->ActivateView(TVwsViewId(KFSEmailUiUid, MailEditorId), command, pckgData);
   857     viewSrvSession->ActivateView(TVwsViewId(KFSEmailUiUid, MailEditorId), command, pckgData);
   858     CleanupStack::PopAndDestroy();   
   858     CleanupStack::PopAndDestroy();   
   859     }
   859     }
       
   860 
       
   861 // -----------------------------------------------------------------------------
       
   862 //
       
   863 // -----------------------------------------------------------------------------
       
   864 //
       
   865 TContentType::TContentType( const TDesC& aContentType ) : iContentType( aContentType )
       
   866     {
       
   867     _LIT( KSeparator, ";" );
       
   868     TInt end = aContentType.Find( KSeparator );
       
   869     if ( end != KErrNotFound )
       
   870         {
       
   871         iContentType.Set( aContentType.Left( end ) );
       
   872         }
       
   873     }
       
   874 
       
   875 // -----------------------------------------------------------------------------
       
   876 //
       
   877 // -----------------------------------------------------------------------------
       
   878 //
       
   879 TBool TContentType::Equals( const TDesC& aContentType )
       
   880     {
       
   881 	TBool ret = iContentType.CompareF( aContentType );
       
   882     if ( ret == 0  )
       
   883     	return ETrue;
       
   884     else
       
   885     	return EFalse;
       
   886     }
       
   887 
   860 // End of file.
   888 // End of file.