1.1 --- a/epoc32/include/cmsvmimeheaders.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/cmsvmimeheaders.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,180 @@
1.4 -cmsvmimeheaders.h
1.5 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __CMSVMIMEHEADERS_H__
1.21 +#define __CMSVMIMEHEADERS_H__
1.22 +
1.23 +#include <e32base.h>
1.24 +
1.25 +class CDesC8ArrayFlat;
1.26 +class CMsvAttachment;
1.27 +class CDesC8Array;
1.28 +
1.29 +/**
1.30 +String literal for Base64 encoding.
1.31 +@publishedAll
1.32 +@released
1.33 +*/
1.34 +_LIT8(KMsvBase64String, "Base64");
1.35 +
1.36 +/**
1.37 +String literal for Quoted-Printable encoding.
1.38 +@publishedAll
1.39 +@released
1.40 +*/
1.41 +_LIT8(KMsvQPString, "quoted-printable");
1.42 +
1.43 +/**
1.44 +String literal for 7 bit encoding.
1.45 +@publishedAll
1.46 +@released
1.47 +*/
1.48 +_LIT8(KMsv7BitString, "7bit");
1.49 +
1.50 +/**
1.51 +String literal for 8 bit encoding.
1.52 +@publishedAll
1.53 +@released
1.54 +*/
1.55 +_LIT8(KMsv8BitString, "8bit");
1.56 +
1.57 +/**
1.58 +String literal for binary encoding.
1.59 +@publishedAll
1.60 +@released
1.61 +*/
1.62 +_LIT8(KMsvBinaryString, "binary");
1.63 +
1.64 +/**
1.65 +String literal for UU encoding.
1.66 +@publishedAll
1.67 +@released
1.68 +*/
1.69 +_LIT8(KMsvUUString, "uuencode");
1.70 +
1.71 +/**
1.72 +Utility class to represent commonly used Mime Headers. This object represents a number
1.73 +of common Mime Headers into a single class. It is intended that this class is used to
1.74 +represent the Mime Headers for an attachment represented by the CMsvAttachment class when
1.75 +using the Attachment API. The Mime header data can be associated with an attachment and
1.76 +stored and restored using the StoreL and RestoreL methods.
1.77 +@publishedAll
1.78 +@released
1.79 +*/
1.80 +class CMsvMimeHeaders : public CBase
1.81 + {
1.82 +public:
1.83 +
1.84 +/** Messaging encoding types.
1.85 +@publishedAll
1.86 +@released
1.87 +*/
1.88 +enum TMsvEncodingType
1.89 + {
1.90 + /** Unknown. */
1.91 + EEncodingTypeUnknown,
1.92 + /** None. */
1.93 + EEncodingTypeNone,
1.94 + /** 7-bit. */
1.95 + EEncodingType7Bit,
1.96 + /** 8-bit. */
1.97 + EEncodingType8Bit, // ie lines still <1000 chars and terminated by CRLF
1.98 + /** Binary. */
1.99 + EEncodingTypeBinary, // ie any length of data, not terminated by CRLF
1.100 + /** QP. */
1.101 + EEncodingTypeQP,
1.102 + /** Base64. */
1.103 + EEncodingTypeBASE64,
1.104 + /** UU. */
1.105 + EEncodingTypeUU
1.106 + };
1.107 +
1.108 +public:
1.109 + IMPORT_C static CMsvMimeHeaders* NewL();
1.110 + IMPORT_C static CMsvMimeHeaders* NewLC();
1.111 + IMPORT_C ~CMsvMimeHeaders();
1.112 +
1.113 + IMPORT_C void StoreL(CMsvAttachment& aAttachment) const;
1.114 + IMPORT_C void RestoreL(CMsvAttachment& aAttachment);
1.115 +
1.116 + IMPORT_C void SetContentDescriptionL(const TDesC8& aContentDescription);
1.117 + IMPORT_C const TDesC8& ContentDescription() const;
1.118 +
1.119 + IMPORT_C void SetContentBaseL(const TDesC8& aContentBase);
1.120 + IMPORT_C const TDesC8& ContentBase() const;
1.121 +
1.122 + IMPORT_C void SetContentLocationL(const TDesC16& aContentLocation);
1.123 + IMPORT_C const TDesC16& ContentLocation() const;
1.124 +
1.125 + IMPORT_C void SetContentIdL(const TDesC8& aContentId);
1.126 + IMPORT_C const TDesC8& ContentId() const;
1.127 +
1.128 + IMPORT_C void SetContentTypeL(const TDesC8& aContentType);
1.129 + IMPORT_C const TDesC8& ContentType() const;
1.130 +
1.131 + IMPORT_C void SetContentSubTypeL(const TDesC8& aSubContentType);
1.132 + IMPORT_C const TDesC8& ContentSubType() const;
1.133 +
1.134 + IMPORT_C void SetContentDispositionL(const TDesC8& aContentDisposition);
1.135 + IMPORT_C const TDesC8& ContentDisposition() const;
1.136 +
1.137 + IMPORT_C CDesC8Array& ContentTypeParams();
1.138 + IMPORT_C CDesC8Array& ContentDispositionParams();
1.139 + IMPORT_C CDesC8Array& XTypeParams();
1.140 +
1.141 + IMPORT_C const CDesC8Array& ContentTypeParams() const;
1.142 + IMPORT_C const CDesC8Array& ContentDispositionParams() const;
1.143 + IMPORT_C const CDesC8Array& XTypeParams() const;
1.144 +
1.145 + IMPORT_C void SetMimeCharset(TUint aMimeCharset);
1.146 + IMPORT_C TUint MimeCharset() const;
1.147 +
1.148 + IMPORT_C void SetSuggestedFilenameL(const TDesC16& aSuggestedFilename);
1.149 + IMPORT_C const TDesC16& SuggestedFilename() const;
1.150 +
1.151 + IMPORT_C void SetRelativePathL(const TDesC8& aRelativePath);
1.152 + IMPORT_C const TDesC8& RelativePath() const;
1.153 +
1.154 + IMPORT_C void SetContentTransferEncoding(const TDesC8& aEncodingType);
1.155 + IMPORT_C TMsvEncodingType ContentTransferEncoding() const;
1.156 + IMPORT_C TMsvEncodingType ContentTransferEncoding(TPtrC8& aEncodingType) const;
1.157 + IMPORT_C const TPtrC8 GetContentTypeValue(const TDesC8& aContentTypeParameter) const;
1.158 +
1.159 + IMPORT_C void Reset();
1.160 + IMPORT_C TInt Size() const;
1.161 + IMPORT_C TBool ContainsMimeHeaders(const CMsvAttachment& aAttachment);
1.162 +
1.163 +private:
1.164 + CMsvMimeHeaders();
1.165 + void ConstructL();
1.166 +
1.167 +private:
1.168 + HBufC8* iContentDescription;
1.169 + HBufC8* iContentBase;
1.170 + HBufC16* iContentLocation;
1.171 + HBufC8* iContentId;
1.172 + HBufC8* iContentType;
1.173 + HBufC8* iContentSubType;
1.174 + HBufC8* iContentDisposition;
1.175 + CDesC8ArrayFlat* iContentTypeParams; // zero or more "parameter"
1.176 + CDesC8ArrayFlat* iContentDispositionParams; // zero or more "parameters"
1.177 + CDesC8ArrayFlat* iXTypeParams; // zero or more X-Type "parameters"
1.178 + TUint iMimeCharset;
1.179 + HBufC16* iSuggestedFilename;
1.180 + HBufC8* iRelativePath;
1.181 + TMsvEncodingType iContentTransferEncoding;
1.182 + };
1.183 +
1.184 +#endif // __CMSVMIMEHEADERS_H__