|
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 __CATTACHMENTQUEUEENTRY_H__ |
|
17 #define __CATTACHMENTQUEUEENTRY_H__ |
|
18 |
|
19 #include "cqueueentrybase.h" |
|
20 #include "cstoreutilities.h" |
|
21 |
|
22 /** |
|
23 Used to hold chunk info when sorting chunks into the correct order. |
|
24 @internalComponent |
|
25 @prototype |
|
26 */ |
|
27 class CChunkAttachmentInfo : public CBase |
|
28 { |
|
29 friend class CAttachmentQueueEntry; |
|
30 public: |
|
31 CChunkAttachmentInfo(TInt aChunkNumber,HBufC8* aData); |
|
32 ~CChunkAttachmentInfo(); |
|
33 private: |
|
34 TInt iChunkNumber; |
|
35 HBufC8* iData; |
|
36 }; |
|
37 |
|
38 /** |
|
39 Used for requests to store attachments. |
|
40 @internalComponent |
|
41 @prototype |
|
42 */ |
|
43 class CAttachmentQueueEntry : public CQueueEntryBase |
|
44 { |
|
45 public: |
|
46 static CAttachmentQueueEntry* NewL(TInt aTotalChunks,CImapMailStore& aParent,CMsvServerEntry& aServerEntry,CImapSettings& aImapSettings,CFetchBodyInfo& aFetchBodyInfo,TInt aLogId,MMailStoreObserver& aObserver); |
|
47 ~CAttachmentQueueEntry(); |
|
48 void AddChunkL(HBufC8* aData,TInt aChunkNumber); |
|
49 void CreateAttachmentL(CMsvServerEntry& iServerEntry); |
|
50 static void CreateAttachmentInfoL(CMsvServerEntry& aServerEntry,RFile& aFile); |
|
51 void CancelRequestL(); |
|
52 void CancelRequest(); |
|
53 protected: |
|
54 void DoCancel(); |
|
55 virtual void RunL(); |
|
56 virtual TInt RunError(TInt aError); |
|
57 private: |
|
58 void ConstructL(); |
|
59 CAttachmentQueueEntry(TInt aTotalChunks,CImapMailStore& aParent,CMsvServerEntry& aServerEntry,CImapSettings& aImapSettings,CFetchBodyInfo& aFetchBodyInfo,TInt aLogId,MMailStoreObserver& aObserver); |
|
60 static TInt CompareChunks(const CChunkAttachmentInfo& aChunkAttachmentInfo1, const CChunkAttachmentInfo& aChunkAttachmentInfo2); |
|
61 private: |
|
62 TInt iTotalChunks; |
|
63 TImEncodingType iEncoding; |
|
64 TInt iNextExpectedChunk; |
|
65 RFile iFile; |
|
66 TBool iReadyToRemoveChunk; |
|
67 RPointerArray<CChunkAttachmentInfo> iDataArray; |
|
68 CStoreUtilities* iStoreUtilities; |
|
69 CImapSettings& iImapSettings; |
|
70 //Content Access Framework Wrapper class, not owned by this class. |
|
71 CImCaf* iCaf; |
|
72 HBufC8* iDecodedData; |
|
73 TInt iLogId; |
|
74 }; |
|
75 |
|
76 |
|
77 #endif // __CATTACHMENTQUEUEENTRY_H__ |
|
78 |
|
79 |