|
1 // Copyright (c) 2006-2010 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 // |
|
15 |
|
16 #ifndef __CFETCHBODYINFO_H__ |
|
17 #define __CFETCHBODYINFO_H__ |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <msvstd.h> |
|
21 #include <miuthdr.h> |
|
22 #include <cimcaf.h> |
|
23 |
|
24 /** |
|
25 Represents a message body or attachent part |
|
26 @internalTechnology |
|
27 @prototype |
|
28 */ |
|
29 |
|
30 class CFetchBodyInfo : public CBase |
|
31 { |
|
32 public: |
|
33 IMPORT_C static CFetchBodyInfo* NewLC(TMsvId aPartId); |
|
34 IMPORT_C static CFetchBodyInfo* NewL(TMsvId aPartId); |
|
35 ~CFetchBodyInfo(); |
|
36 |
|
37 IMPORT_C TInt32 SizeToFetch(); |
|
38 IMPORT_C TMsvId PartId(); |
|
39 IMPORT_C HBufC8* RelativePath() const; |
|
40 IMPORT_C TInt32 BodyPartRemainingSize(); |
|
41 IMPORT_C TBool IsText(); |
|
42 |
|
43 IMPORT_C void SetSizeToFetch(TInt32 aSize); |
|
44 IMPORT_C void SetIsText(TBool aIsText); |
|
45 IMPORT_C void SetPartId(const TMsvId aId); |
|
46 IMPORT_C void SetRelativePathL(const TDesC8& aPath); |
|
47 IMPORT_C void SetBodyPartRemainingSize(const TInt32 aSize); |
|
48 IMPORT_C void SetContentTransferEncoding(const TImEncodingType); |
|
49 IMPORT_C void SetCharsetId(const TUint aCharsetId); |
|
50 IMPORT_C TImEncodingType ContentTransferEncoding() const; |
|
51 IMPORT_C TUint CharsetId() const; |
|
52 IMPORT_C void SetCaf(CImCaf* aCaf); |
|
53 IMPORT_C void ResetCaf(); |
|
54 IMPORT_C CImCaf* Caf() const; |
|
55 IMPORT_C TInt32 BytesFetched(); |
|
56 IMPORT_C void IncrementBytesFetched(TInt32 aByteCount); |
|
57 inline TBool PartialDownload(); |
|
58 inline void SetPartialDownload(TBool aFlag); |
|
59 public: |
|
60 TBool iEmbed; |
|
61 |
|
62 private: |
|
63 CFetchBodyInfo(TMsvId aPartId); |
|
64 void ConstructL(); |
|
65 |
|
66 private: |
|
67 //the size of the data we want to retrieve |
|
68 TInt32 iSizeToFetch; |
|
69 //if the data is text then its a body part, otherwise its an attachment |
|
70 TBool iIsText; |
|
71 // the tmsvid where the data will be stored in the message store |
|
72 TMsvId iPartId; |
|
73 // the body sections we will be retrieving, eg 1, or 1.2 or 1.text |
|
74 HBufC8* iRelativePath; |
|
75 //for a partial fetch this is the amount of data not being fetched |
|
76 TInt32 iBodyPartRemainingSize; |
|
77 // the encoding method thats been used to encode the data |
|
78 TImEncodingType iContentTransferEncoding; |
|
79 // the chrachter set id |
|
80 TUint iCharsetId; |
|
81 //Content Access Framework Wrapper class, not owned by this class. |
|
82 CImCaf* iCaf; |
|
83 //A count of the bytes that have been fetched. |
|
84 TInt32 iBytesFetched; |
|
85 //Flag to indicate whether we are downloading the mail, partially or fully .. |
|
86 TBool iPartialDownload; |
|
87 }; |
|
88 |
|
89 inline TBool CFetchBodyInfo::PartialDownload() |
|
90 { |
|
91 return iPartialDownload; |
|
92 } |
|
93 |
|
94 inline void CFetchBodyInfo::SetPartialDownload(TBool aFlag) |
|
95 { |
|
96 iPartialDownload =aFlag; |
|
97 } |
|
98 |
|
99 #endif // __CFETCHBODYINFO_H__ |