|
1 // Copyright (c) 1999-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // MIUTCONV.H |
|
15 // |
|
16 |
|
17 /** |
|
18 * @file |
|
19 * @publishedAll |
|
20 * @released |
|
21 */ |
|
22 |
|
23 #ifndef __MIUTCONV_H__ |
|
24 #define __MIUTCONV_H__ |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 |
|
29 #if !defined (__CHARCONV_H_) |
|
30 #include <charconv.h> |
|
31 #endif |
|
32 |
|
33 #if !defined (__MIUTHDR_H__) |
|
34 #include <miuthdr.h> |
|
35 #endif |
|
36 |
|
37 #if !defined (__UTF_H_) |
|
38 #include <utf.h> |
|
39 #endif |
|
40 |
|
41 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
42 #include "cimconvertcharconv.h" |
|
43 #endif |
|
44 |
|
45 /** SMTP send methods. |
|
46 @publishedAll |
|
47 @released |
|
48 */ |
|
49 enum TImSendMethod |
|
50 { |
|
51 /** Simple email. */ |
|
52 ESendAsSimpleEmail, |
|
53 /** MIME email. */ |
|
54 ESendAsMimeEmail |
|
55 }; |
|
56 |
|
57 |
|
58 // Information to be used when sending an email message. |
|
59 // Relating to how parts are encoded and converted. |
|
60 // |
|
61 class TImEmailTransformingInfo |
|
62 /** Encapsulates character conversion and encoding settings for sending SMTP email. |
|
63 |
|
64 The default outcomes for header, body, HTML, and attachment parts respectively |
|
65 for each of the listed categories are given below: |
|
66 |
|
67 Plain Charset: ISO-8859-1,ISO-8859-1,N/A,N/A |
|
68 |
|
69 Plain Encoding:None,None,N/A,UU |
|
70 |
|
71 MIME Charset:UTF8,UTF8,UTF8*,N/A |
|
72 |
|
73 MIME Encoding:B,QP,Base64,Base64 |
|
74 |
|
75 *: the UTF8 value set in the header field, but no conversion is done. The |
|
76 HTML converter converts to UTF8. |
|
77 @publishedAll |
|
78 @released |
|
79 */ |
|
80 { |
|
81 public: |
|
82 IMPORT_C TImEmailTransformingInfo& operator=(const TImEmailTransformingInfo& aInfo); |
|
83 IMPORT_C TBool operator==(const TImEmailTransformingInfo& aInfo); |
|
84 |
|
85 // streaming operations |
|
86 IMPORT_C void ExternalizeL( RWriteStream& aWriteStream ) const; |
|
87 IMPORT_C void InternalizeL( RReadStream& aReadStream ); |
|
88 IMPORT_C void StoreL( CMsvStore& aStore ) const; |
|
89 IMPORT_C void RestoreL( CMsvStore& aStore ); |
|
90 |
|
91 // Setting functions |
|
92 IMPORT_C void SetToDefault(const TImSendMethod aMethod); |
|
93 IMPORT_C void SetSendMethod(const TImSendMethod aMethod); |
|
94 IMPORT_C TImSendMethod SendMethod() const; |
|
95 |
|
96 IMPORT_C void SetHeaderEncodingQ(); |
|
97 IMPORT_C void SetHeaderEncodingB(); |
|
98 IMPORT_C void SetBodyTextEncoding(TImEncodingType aType); |
|
99 IMPORT_C void SetHTMLEncoding(TImEncodingType aType); |
|
100 IMPORT_C void SetAttachmentEncoding(TImEncodingType aType); |
|
101 |
|
102 IMPORT_C void SetHeaderAndBodyCharset(TUint aCharset); |
|
103 IMPORT_C void SetHeaderCharset(TUint aCharset); |
|
104 IMPORT_C void SetBodyTextCharset(TUint aCharset); |
|
105 IMPORT_C void SetHTMLCharset(TUint aCharset); |
|
106 |
|
107 // Accessor functions |
|
108 IMPORT_C TImEncodingType HeaderEncoding() const; |
|
109 IMPORT_C TImEncodingType BodyTextEncoding() const; |
|
110 IMPORT_C TImEncodingType HTMLEncoding() const; |
|
111 IMPORT_C TImEncodingType AttachmentEncoding() const; |
|
112 |
|
113 IMPORT_C TUint HeaderCharset() const; |
|
114 IMPORT_C TUint BodyTextCharset() const; |
|
115 IMPORT_C TUint HTMLCharset() const; |
|
116 |
|
117 private: |
|
118 void SetHeaderEncoding(TImEncodingType aType); |
|
119 |
|
120 private: |
|
121 TImEncodingType iHeaderEncoding; |
|
122 TImEncodingType iBodyEncoding; |
|
123 TImEncodingType iHTMLEncoding; |
|
124 TImEncodingType iAttachmentEncoding; |
|
125 |
|
126 TUint iHeaderCharset; |
|
127 TUint iBodyCharset; |
|
128 TUint iHTMLCharset; |
|
129 TUint iTextAttachmentCharset; |
|
130 |
|
131 TImSendMethod iSendMethod; |
|
132 }; |
|
133 |
|
134 #endif //__MIUTCONV_H__ |