|
1 // CImEncodedHeader.h |
|
2 // |
|
3 |
|
4 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
5 // All rights reserved. |
|
6 // This component and the accompanying materials are made available |
|
7 // under the terms of "Eclipse Public License v1.0" |
|
8 // which accompanies this distribution, and is available |
|
9 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
10 // |
|
11 // Initial Contributors: |
|
12 // Nokia Corporation - initial contribution. |
|
13 // |
|
14 // Contributors: |
|
15 // |
|
16 // Description: |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalTechnology |
|
22 */ |
|
23 |
|
24 #ifndef __CIMENCODEDHEADER_H__ |
|
25 #define __CIMENCODEDHEADER_H__ |
|
26 |
|
27 #include <msvstore.h> // CMsvStore |
|
28 #include "MIUTHDR.H" |
|
29 |
|
30 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB) |
|
31 class CCHeaderFields; |
|
32 #endif |
|
33 |
|
34 // IMail-specific stream type within an IMail file store for CImEncodedHeader |
|
35 const TUid KUidMsgFileIMailEncodedHeader = {0x101FD0E3}; // 270520547 decimal |
|
36 |
|
37 //------------------------------------------------------------------------------ |
|
38 |
|
39 class CImEncodedHeader : public CBase |
|
40 /** Encapsulates an undecoded Internet Mail header. |
|
41 This class encapsulates the 8 bit data of supported fields for the CImHeader |
|
42 prior to decoding. It allows this information to populate an associated |
|
43 CImHeader class for redecoding. |
|
44 |
|
45 @internalTechnology |
|
46 @released |
|
47 */ |
|
48 { |
|
49 public: |
|
50 |
|
51 static CImEncodedHeader* NewLC(); |
|
52 static CImEncodedHeader* NewL(); |
|
53 ~CImEncodedHeader(); |
|
54 void Reset(); |
|
55 |
|
56 void InternalizeL(RMsvReadStream& aReadStream); |
|
57 void ExternalizeL(RMsvWriteStream& aWriteStream) const; |
|
58 void RestoreL(CMsvStore& aMessageStore); |
|
59 void StoreL (CMsvStore& aMessageStore) const; |
|
60 // From field |
|
61 const TPtrC8 From() const; |
|
62 void SetFromL(const TDesC8& aFrom); |
|
63 |
|
64 // Subject field |
|
65 const TPtrC8 Subject() const; |
|
66 void SetSubjectL(const TDesC8& aSubject); |
|
67 |
|
68 // ReplyTo field |
|
69 const TPtrC8 ReplyTo() const; |
|
70 void SetReplyToL(const TDesC8& aReplyTo); |
|
71 void CopyFromHeaderL( |
|
72 const CImHeader& aFromHeader, TBool aDeleteExistingData = false); |
|
73 void CopyToHeaderL(CImHeader& aToHeader) const; |
|
74 |
|
75 void SetDecodeCharset(TUint aCharset); |
|
76 TUint DecodeCharset() const; |
|
77 |
|
78 TUint16 Version() const; |
|
79 void SetVersion(TUint16 aVersion); |
|
80 TInt DataSize() const; |
|
81 |
|
82 CDesCArray& ToRecipients (); |
|
83 CDesCArray& CcRecipients (); |
|
84 CDesCArray& BccRecipients(); |
|
85 |
|
86 const CDesCArray& ToRecipients () const; |
|
87 const CDesCArray& CcRecipients () const; |
|
88 const CDesCArray& BccRecipients() const; |
|
89 |
|
90 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB) |
|
91 void StoreEncodedDBL (CMsvStore& aMessageStore) const; |
|
92 void ReStoreEncodedDBL(CMsvStore& aMessageStore); |
|
93 void CreateEncodedArrayListL(TPtrC16 aEncodedStr ,TInt aI); |
|
94 TInt EncodedBufSize()const; |
|
95 #endif |
|
96 |
|
97 private: |
|
98 CImEncodedHeader(); |
|
99 void ConstructL(); |
|
100 friend void CopyArrayL(const CDesCArray& aSource, CDesCArray& aDestination); |
|
101 |
|
102 private: |
|
103 TUint16 iVersion; |
|
104 HBufC8* iFrom; |
|
105 HBufC8* iSubject; |
|
106 HBufC8* iReplyTo; |
|
107 CDesCArray* iTo; |
|
108 CDesCArray* iCc; |
|
109 CDesCArray* iBcc; |
|
110 TUint iDecodeCharset; |
|
111 }; |
|
112 |
|
113 #endif |