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