|
1 // Copyright (c) 2006-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 // |
|
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 private: |
|
58 CFetchBodyInfo(TMsvId aPartId); |
|
59 void ConstructL(); |
|
60 |
|
61 private: |
|
62 //the size of the data we want to retrieve |
|
63 TInt32 iSizeToFetch; |
|
64 //if the data is text then its a body part, otherwise its an attachment |
|
65 TBool iIsText; |
|
66 // the tmsvid where the data will be stored in the message store |
|
67 TMsvId iPartId; |
|
68 // the body sections we will be retrieving, eg 1, or 1.2 or 1.text |
|
69 HBufC8* iRelativePath; |
|
70 //for a partial fetch this is the amount of data not being fetched |
|
71 TInt32 iBodyPartRemainingSize; |
|
72 // the encoding method thats been used to encode the data |
|
73 TImEncodingType iContentTransferEncoding; |
|
74 // the chrachter set id |
|
75 TUint iCharsetId; |
|
76 //Content Access Framework Wrapper class, not owned by this class. |
|
77 CImCaf* iCaf; |
|
78 //A count of the bytes that have been fetched. |
|
79 TInt32 iBytesFetched; |
|
80 }; |
|
81 |
|
82 |
|
83 #endif // __CFETCHBODYINFO_H__ |