williamr@2
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __CMSVMIMEHEADERS_H__
|
williamr@2
|
17 |
#define __CMSVMIMEHEADERS_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32base.h>
|
williamr@2
|
20 |
|
williamr@2
|
21 |
class CDesC8ArrayFlat;
|
williamr@2
|
22 |
class CMsvAttachment;
|
williamr@2
|
23 |
class CDesC8Array;
|
williamr@2
|
24 |
|
williamr@2
|
25 |
/**
|
williamr@2
|
26 |
String literal for Base64 encoding.
|
williamr@2
|
27 |
@publishedAll
|
williamr@2
|
28 |
@released
|
williamr@2
|
29 |
*/
|
williamr@2
|
30 |
_LIT8(KMsvBase64String, "Base64");
|
williamr@2
|
31 |
|
williamr@2
|
32 |
/**
|
williamr@2
|
33 |
String literal for Quoted-Printable encoding.
|
williamr@2
|
34 |
@publishedAll
|
williamr@2
|
35 |
@released
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
_LIT8(KMsvQPString, "quoted-printable");
|
williamr@2
|
38 |
|
williamr@2
|
39 |
/**
|
williamr@2
|
40 |
String literal for 7 bit encoding.
|
williamr@2
|
41 |
@publishedAll
|
williamr@2
|
42 |
@released
|
williamr@2
|
43 |
*/
|
williamr@2
|
44 |
_LIT8(KMsv7BitString, "7bit");
|
williamr@2
|
45 |
|
williamr@2
|
46 |
/**
|
williamr@2
|
47 |
String literal for 8 bit encoding.
|
williamr@2
|
48 |
@publishedAll
|
williamr@2
|
49 |
@released
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
_LIT8(KMsv8BitString, "8bit");
|
williamr@2
|
52 |
|
williamr@2
|
53 |
/**
|
williamr@2
|
54 |
String literal for binary encoding.
|
williamr@2
|
55 |
@publishedAll
|
williamr@2
|
56 |
@released
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
_LIT8(KMsvBinaryString, "binary");
|
williamr@2
|
59 |
|
williamr@2
|
60 |
/**
|
williamr@2
|
61 |
String literal for UU encoding.
|
williamr@2
|
62 |
@publishedAll
|
williamr@2
|
63 |
@released
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
_LIT8(KMsvUUString, "uuencode");
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/**
|
williamr@2
|
68 |
Utility class to represent commonly used Mime Headers. This object represents a number
|
williamr@2
|
69 |
of common Mime Headers into a single class. It is intended that this class is used to
|
williamr@2
|
70 |
represent the Mime Headers for an attachment represented by the CMsvAttachment class when
|
williamr@2
|
71 |
using the Attachment API. The Mime header data can be associated with an attachment and
|
williamr@2
|
72 |
stored and restored using the StoreL and RestoreL methods.
|
williamr@2
|
73 |
@publishedAll
|
williamr@2
|
74 |
@released
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
class CMsvMimeHeaders : public CBase
|
williamr@2
|
77 |
{
|
williamr@2
|
78 |
public:
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/** Messaging encoding types.
|
williamr@2
|
81 |
@publishedAll
|
williamr@2
|
82 |
@released
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
enum TMsvEncodingType
|
williamr@2
|
85 |
{
|
williamr@2
|
86 |
/** Unknown. */
|
williamr@2
|
87 |
EEncodingTypeUnknown,
|
williamr@2
|
88 |
/** None. */
|
williamr@2
|
89 |
EEncodingTypeNone,
|
williamr@2
|
90 |
/** 7-bit. */
|
williamr@2
|
91 |
EEncodingType7Bit,
|
williamr@2
|
92 |
/** 8-bit. */
|
williamr@2
|
93 |
EEncodingType8Bit, // ie lines still <1000 chars and terminated by CRLF
|
williamr@2
|
94 |
/** Binary. */
|
williamr@2
|
95 |
EEncodingTypeBinary, // ie any length of data, not terminated by CRLF
|
williamr@2
|
96 |
/** QP. */
|
williamr@2
|
97 |
EEncodingTypeQP,
|
williamr@2
|
98 |
/** Base64. */
|
williamr@2
|
99 |
EEncodingTypeBASE64,
|
williamr@2
|
100 |
/** UU. */
|
williamr@2
|
101 |
EEncodingTypeUU
|
williamr@2
|
102 |
};
|
williamr@2
|
103 |
|
williamr@2
|
104 |
public:
|
williamr@2
|
105 |
IMPORT_C static CMsvMimeHeaders* NewL();
|
williamr@2
|
106 |
IMPORT_C static CMsvMimeHeaders* NewLC();
|
williamr@2
|
107 |
IMPORT_C ~CMsvMimeHeaders();
|
williamr@2
|
108 |
|
williamr@2
|
109 |
IMPORT_C void StoreL(CMsvAttachment& aAttachment) const;
|
williamr@2
|
110 |
IMPORT_C void RestoreL(CMsvAttachment& aAttachment);
|
williamr@2
|
111 |
|
williamr@2
|
112 |
IMPORT_C void SetContentDescriptionL(const TDesC8& aContentDescription);
|
williamr@2
|
113 |
IMPORT_C const TDesC8& ContentDescription() const;
|
williamr@2
|
114 |
|
williamr@2
|
115 |
IMPORT_C void SetContentBaseL(const TDesC8& aContentBase);
|
williamr@2
|
116 |
IMPORT_C const TDesC8& ContentBase() const;
|
williamr@2
|
117 |
|
williamr@2
|
118 |
IMPORT_C void SetContentLocationL(const TDesC16& aContentLocation);
|
williamr@2
|
119 |
IMPORT_C const TDesC16& ContentLocation() const;
|
williamr@2
|
120 |
|
williamr@2
|
121 |
IMPORT_C void SetContentIdL(const TDesC8& aContentId);
|
williamr@2
|
122 |
IMPORT_C const TDesC8& ContentId() const;
|
williamr@2
|
123 |
|
williamr@2
|
124 |
IMPORT_C void SetContentTypeL(const TDesC8& aContentType);
|
williamr@2
|
125 |
IMPORT_C const TDesC8& ContentType() const;
|
williamr@2
|
126 |
|
williamr@2
|
127 |
IMPORT_C void SetContentSubTypeL(const TDesC8& aSubContentType);
|
williamr@2
|
128 |
IMPORT_C const TDesC8& ContentSubType() const;
|
williamr@2
|
129 |
|
williamr@2
|
130 |
IMPORT_C void SetContentDispositionL(const TDesC8& aContentDisposition);
|
williamr@2
|
131 |
IMPORT_C const TDesC8& ContentDisposition() const;
|
williamr@2
|
132 |
|
williamr@2
|
133 |
IMPORT_C CDesC8Array& ContentTypeParams();
|
williamr@2
|
134 |
IMPORT_C CDesC8Array& ContentDispositionParams();
|
williamr@2
|
135 |
IMPORT_C CDesC8Array& XTypeParams();
|
williamr@2
|
136 |
|
williamr@2
|
137 |
IMPORT_C const CDesC8Array& ContentTypeParams() const;
|
williamr@2
|
138 |
IMPORT_C const CDesC8Array& ContentDispositionParams() const;
|
williamr@2
|
139 |
IMPORT_C const CDesC8Array& XTypeParams() const;
|
williamr@2
|
140 |
|
williamr@2
|
141 |
IMPORT_C void SetMimeCharset(TUint aMimeCharset);
|
williamr@2
|
142 |
IMPORT_C TUint MimeCharset() const;
|
williamr@2
|
143 |
|
williamr@2
|
144 |
IMPORT_C void SetSuggestedFilenameL(const TDesC16& aSuggestedFilename);
|
williamr@2
|
145 |
IMPORT_C const TDesC16& SuggestedFilename() const;
|
williamr@2
|
146 |
|
williamr@2
|
147 |
IMPORT_C void SetRelativePathL(const TDesC8& aRelativePath);
|
williamr@2
|
148 |
IMPORT_C const TDesC8& RelativePath() const;
|
williamr@2
|
149 |
|
williamr@2
|
150 |
IMPORT_C void SetContentTransferEncoding(const TDesC8& aEncodingType);
|
williamr@2
|
151 |
IMPORT_C TMsvEncodingType ContentTransferEncoding() const;
|
williamr@2
|
152 |
IMPORT_C TMsvEncodingType ContentTransferEncoding(TPtrC8& aEncodingType) const;
|
williamr@2
|
153 |
IMPORT_C const TPtrC8 GetContentTypeValue(const TDesC8& aContentTypeParameter) const;
|
williamr@2
|
154 |
|
williamr@2
|
155 |
IMPORT_C void Reset();
|
williamr@2
|
156 |
IMPORT_C TInt Size() const;
|
williamr@2
|
157 |
IMPORT_C TBool ContainsMimeHeaders(const CMsvAttachment& aAttachment);
|
williamr@2
|
158 |
|
williamr@2
|
159 |
private:
|
williamr@2
|
160 |
CMsvMimeHeaders();
|
williamr@2
|
161 |
void ConstructL();
|
williamr@2
|
162 |
|
williamr@2
|
163 |
private:
|
williamr@2
|
164 |
HBufC8* iContentDescription;
|
williamr@2
|
165 |
HBufC8* iContentBase;
|
williamr@2
|
166 |
HBufC16* iContentLocation;
|
williamr@2
|
167 |
HBufC8* iContentId;
|
williamr@2
|
168 |
HBufC8* iContentType;
|
williamr@2
|
169 |
HBufC8* iContentSubType;
|
williamr@2
|
170 |
HBufC8* iContentDisposition;
|
williamr@2
|
171 |
CDesC8ArrayFlat* iContentTypeParams; // zero or more "parameter"
|
williamr@2
|
172 |
CDesC8ArrayFlat* iContentDispositionParams; // zero or more "parameters"
|
williamr@2
|
173 |
CDesC8ArrayFlat* iXTypeParams; // zero or more X-Type "parameters"
|
williamr@2
|
174 |
TUint iMimeCharset;
|
williamr@2
|
175 |
HBufC16* iSuggestedFilename;
|
williamr@2
|
176 |
HBufC8* iRelativePath;
|
williamr@2
|
177 |
TMsvEncodingType iContentTransferEncoding;
|
williamr@2
|
178 |
};
|
williamr@2
|
179 |
|
williamr@2
|
180 |
#endif // __CMSVMIMEHEADERS_H__
|