|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Fetch operation with checking of available memory and disk space |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __IMAP4SIZEANDFETCHOP_H__ |
|
20 #define __IMAP4SIZEANDFETCHOP_H__ |
|
21 |
|
22 #include <ImumInternalApi.h> // CImumInternalApi |
|
23 #include <imapset.h> |
|
24 #include <imapcmds.h> |
|
25 #include "IMAPPRGR.H" |
|
26 #include "ImumOnlineOperation.h" |
|
27 #include "Imap4MtmUi.hrh" // KImpuIMAPFolderNameLength |
|
28 |
|
29 /** |
|
30 * Fetch operation with checking of available memory and disk space. |
|
31 */ |
|
32 class CImap4SizeAndFetchOp : public CImumOnlineOperation |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * |
|
37 */ |
|
38 static CImap4SizeAndFetchOp* NewL( |
|
39 CImumInternalApi& aMailboxApi, |
|
40 TRequestStatus& aStatus, |
|
41 MMsvProgressReporter& aReporter, |
|
42 TMsvId aService, |
|
43 TInt aFunctionId, |
|
44 const TImImap4GetMailInfo& aGetMailInfo, |
|
45 const CMsvEntrySelection& aSel); |
|
46 |
|
47 /** |
|
48 * |
|
49 */ |
|
50 virtual ~CImap4SizeAndFetchOp(); |
|
51 |
|
52 /** |
|
53 * |
|
54 */ |
|
55 virtual const TDesC8& GetErrorProgressL(TInt aError); |
|
56 |
|
57 protected: |
|
58 |
|
59 /** |
|
60 * |
|
61 */ |
|
62 CImap4SizeAndFetchOp( |
|
63 CImumInternalApi& aMailboxApi, |
|
64 TRequestStatus& aStatus, |
|
65 MMsvProgressReporter& aReporter, |
|
66 TMsvId aService, |
|
67 TInt aFunctionId, |
|
68 const TImImap4GetMailInfo& aGetMailInfo); |
|
69 |
|
70 /** |
|
71 * |
|
72 */ |
|
73 void ConstructL(const CMsvEntrySelection& aSel); |
|
74 |
|
75 /** |
|
76 * |
|
77 */ |
|
78 virtual void DoRunL(); |
|
79 |
|
80 /** |
|
81 * |
|
82 */ |
|
83 void DoSizeMessageL(); |
|
84 |
|
85 /** |
|
86 * |
|
87 */ |
|
88 void DoSizeNextMessageL(); |
|
89 |
|
90 /** |
|
91 * |
|
92 */ |
|
93 void DoFetchMessageL(); |
|
94 |
|
95 /** |
|
96 * |
|
97 */ |
|
98 TBool CheckMessageSizeL(); |
|
99 |
|
100 private: |
|
101 enum TSizeAndFetchState { EStateIdle, EStateSizeMsg, EStateFetchMsg }; |
|
102 TSizeAndFetchState iState; |
|
103 TPckgBuf<TImap4CompoundProgress> iProgressBuf; |
|
104 CMsvEntrySelection* iSelection; |
|
105 const TInt iFunctionId; |
|
106 const TImImap4GetMailInfo iGetMailInfo; |
|
107 TInt32 iTotalSizeToFetch; |
|
108 TInt iCurrentMsgToSize; |
|
109 }; |
|
110 |
|
111 #endif |