17 |
17 |
18 #include "emailcontent.h" |
18 #include "emailcontent.h" |
19 #include "emailtextcontent.h" |
19 #include "emailtextcontent.h" |
20 #include "emailattachment.h" |
20 #include "emailattachment.h" |
21 #include "emailmultipart.h" |
21 #include "emailmultipart.h" |
|
22 #include "emailmessage.h" |
22 #include "emailclientapi.hrh" |
23 #include "emailclientapi.hrh" |
23 |
24 |
24 |
25 |
25 // ----------------------------------------------------------------------------- |
26 // ----------------------------------------------------------------------------- |
26 // |
27 // |
100 { |
101 { |
101 User::Leave( KErrArgument ); |
102 User::Leave( KErrArgument ); |
102 } |
103 } |
103 MEmailMessageContent* content = NULL; |
104 MEmailMessageContent* content = NULL; |
104 TFSMailMsgId partId = iChildParts[aIndex]; |
105 TFSMailMsgId partId = iChildParts[aIndex]; |
105 CFSMailMessagePart* copy = iEmailMsgContent->Part().ChildPartL(partId); |
106 CFSMailMessagePart* copy = iEmailMsgContent->Part().ChildPartL( partId ); |
106 |
107 TContentType contentType( copy->GetContentType() ); |
107 const TDesC& contentType = copy->GetContentType(); |
|
108 const TDesC& compareString = CEmailTextContent::CheckParameterFormatL( contentType ); |
|
109 |
|
110 TMessageContentId msgContentId = TMessageContentId( |
108 TMessageContentId msgContentId = TMessageContentId( |
111 copy->GetPartId().Id(), |
109 copy->GetPartId().Id(), |
112 Id().iMessageId.iId, |
110 Id().iMessageId.iId, |
113 Id().iMessageId.iFolderId.iId, |
111 Id().iMessageId.iFolderId.iId, |
114 Id().iMessageId.iFolderId.iMailboxId ); |
112 Id().iMessageId.iFolderId.iMailboxId ); |
115 |
113 |
116 if (!compareString.Compare(KFSMailContentTypeTextPlain) || |
114 if ( contentType.Equals( KFSMailContentTypeTextPlain ) || |
117 !compareString.Compare(KFSMailContentTypeTextHtml)) |
115 contentType.Equals( KFSMailContentTypeTextHtml ) ) |
118 { |
116 { |
119 content = CEmailTextContent::NewL( iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns ); |
117 content = CEmailTextContent::NewL( iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns ); |
120 } |
118 } |
121 else if (!compareString.Compare(KFSMailContentTypeMultipartMixed) || |
119 else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) || |
122 !compareString.Compare(KFSMailContentTypeMultipartAlternative) || |
120 contentType.Equals( KFSMailContentTypeMultipartAlternative ) || |
123 !compareString.Compare(KFSMailContentTypeMultipartDigest) || |
121 contentType.Equals( KFSMailContentTypeMultipartDigest ) || |
124 !compareString.Compare(KFSMailContentTypeMultipartRelated) || |
122 contentType.Equals( KFSMailContentTypeMultipartRelated ) || |
125 !compareString.Compare(KFSMailContentTypeMultipartParallel)) |
123 contentType.Equals( KFSMailContentTypeMultipartParallel ) ) |
126 { |
124 { |
127 content = CEmailMultipart::NewL( iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns ); |
125 content = CEmailMultipart::NewL( iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns ); |
128 } |
126 } |
129 else |
127 else |
130 { |
128 { |