1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CMSVMIMEHEADERS_H__
17 #define __CMSVMIMEHEADERS_H__
21 class CDesC8ArrayFlat;
26 String literal for Base64 encoding.
30 _LIT8(KMsvBase64String, "Base64");
33 String literal for Quoted-Printable encoding.
37 _LIT8(KMsvQPString, "quoted-printable");
40 String literal for 7 bit encoding.
44 _LIT8(KMsv7BitString, "7bit");
47 String literal for 8 bit encoding.
51 _LIT8(KMsv8BitString, "8bit");
54 String literal for binary encoding.
58 _LIT8(KMsvBinaryString, "binary");
61 String literal for UU encoding.
65 _LIT8(KMsvUUString, "uuencode");
68 Utility class to represent commonly used Mime Headers. This object represents a number
69 of common Mime Headers into a single class. It is intended that this class is used to
70 represent the Mime Headers for an attachment represented by the CMsvAttachment class when
71 using the Attachment API. The Mime header data can be associated with an attachment and
72 stored and restored using the StoreL and RestoreL methods.
76 class CMsvMimeHeaders : public CBase
80 /** Messaging encoding types.
93 EEncodingType8Bit, // ie lines still <1000 chars and terminated by CRLF
95 EEncodingTypeBinary, // ie any length of data, not terminated by CRLF
105 IMPORT_C static CMsvMimeHeaders* NewL();
106 IMPORT_C static CMsvMimeHeaders* NewLC();
107 IMPORT_C ~CMsvMimeHeaders();
109 IMPORT_C void StoreL(CMsvAttachment& aAttachment) const;
110 IMPORT_C void RestoreL(CMsvAttachment& aAttachment);
112 IMPORT_C void SetContentDescriptionL(const TDesC8& aContentDescription);
113 IMPORT_C const TDesC8& ContentDescription() const;
115 IMPORT_C void SetContentBaseL(const TDesC8& aContentBase);
116 IMPORT_C const TDesC8& ContentBase() const;
118 IMPORT_C void SetContentLocationL(const TDesC16& aContentLocation);
119 IMPORT_C const TDesC16& ContentLocation() const;
121 IMPORT_C void SetContentIdL(const TDesC8& aContentId);
122 IMPORT_C const TDesC8& ContentId() const;
124 IMPORT_C void SetContentTypeL(const TDesC8& aContentType);
125 IMPORT_C const TDesC8& ContentType() const;
127 IMPORT_C void SetContentSubTypeL(const TDesC8& aSubContentType);
128 IMPORT_C const TDesC8& ContentSubType() const;
130 IMPORT_C void SetContentDispositionL(const TDesC8& aContentDisposition);
131 IMPORT_C const TDesC8& ContentDisposition() const;
133 IMPORT_C CDesC8Array& ContentTypeParams();
134 IMPORT_C CDesC8Array& ContentDispositionParams();
135 IMPORT_C CDesC8Array& XTypeParams();
137 IMPORT_C const CDesC8Array& ContentTypeParams() const;
138 IMPORT_C const CDesC8Array& ContentDispositionParams() const;
139 IMPORT_C const CDesC8Array& XTypeParams() const;
141 IMPORT_C void SetMimeCharset(TUint aMimeCharset);
142 IMPORT_C TUint MimeCharset() const;
144 IMPORT_C void SetSuggestedFilenameL(const TDesC16& aSuggestedFilename);
145 IMPORT_C const TDesC16& SuggestedFilename() const;
147 IMPORT_C void SetRelativePathL(const TDesC8& aRelativePath);
148 IMPORT_C const TDesC8& RelativePath() const;
150 IMPORT_C void SetContentTransferEncoding(const TDesC8& aEncodingType);
151 IMPORT_C TMsvEncodingType ContentTransferEncoding() const;
152 IMPORT_C TMsvEncodingType ContentTransferEncoding(TPtrC8& aEncodingType) const;
153 IMPORT_C const TPtrC8 GetContentTypeValue(const TDesC8& aContentTypeParameter) const;
155 IMPORT_C void Reset();
156 IMPORT_C TInt Size() const;
157 IMPORT_C TBool ContainsMimeHeaders(const CMsvAttachment& aAttachment);
164 HBufC8* iContentDescription;
165 HBufC8* iContentBase;
166 HBufC16* iContentLocation;
168 HBufC8* iContentType;
169 HBufC8* iContentSubType;
170 HBufC8* iContentDisposition;
171 CDesC8ArrayFlat* iContentTypeParams; // zero or more "parameter"
172 CDesC8ArrayFlat* iContentDispositionParams; // zero or more "parameters"
173 CDesC8ArrayFlat* iXTypeParams; // zero or more X-Type "parameters"
175 HBufC16* iSuggestedFilename;
176 HBufC8* iRelativePath;
177 TMsvEncodingType iContentTransferEncoding;
180 #endif // __CMSVMIMEHEADERS_H__