|
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 message(s) operation, using client MTM Get Mail API |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __MSVPOP3FETCHOPERATION_H__ |
|
20 #define __MSVPOP3FETCHOPERATION_H__ |
|
21 |
|
22 #include <pop3set.h> |
|
23 #include <MsvPrgReporter.h> |
|
24 #include <ImumInternalApi.h> // CImumInternalApi |
|
25 |
|
26 #include "ImumDiskSpaceObserverOperation.h" |
|
27 |
|
28 #include "ImumMtmLogging.h" |
|
29 |
|
30 class CMsvEmailConnectionProgressProvider; |
|
31 |
|
32 /** |
|
33 * CMsvPop3FetchOperation |
|
34 * Fetch message(s) operation, using client MTM Get Mail API. |
|
35 * Encapsulates checking for a connection, and if neccessary, connecting beforehand |
|
36 * and disconnecting afterwards. |
|
37 */ |
|
38 class CMsvPop3FetchOperation : |
|
39 public CImumDiskSpaceObserverOperation |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * |
|
44 */ |
|
45 static CMsvPop3FetchOperation* NewL( |
|
46 CImumInternalApi& aMailboxApi, |
|
47 TRequestStatus& aObserverRequestStatus, |
|
48 MMsvProgressReporter& aReporter, |
|
49 TInt aFunctionId, |
|
50 TMsvId aService, |
|
51 const TImPop3GetMailInfo& aGetMailInfo, |
|
52 const CMsvEntrySelection& aSel ); |
|
53 |
|
54 /** |
|
55 * for partial fetch |
|
56 */ |
|
57 static CMsvPop3FetchOperation* NewL( |
|
58 CImumInternalApi& aMailboxApi, |
|
59 TRequestStatus& aObserverRequestStatus, |
|
60 MMsvProgressReporter& aReporter, |
|
61 TInt aFunctionId, |
|
62 TMsvId aService, |
|
63 const TImPop3GetMailInfo& aGetMailInfo, |
|
64 const CMsvEntrySelection& aSel, |
|
65 TInt aLimit); |
|
66 |
|
67 |
|
68 |
|
69 /** |
|
70 * |
|
71 */ |
|
72 virtual ~CMsvPop3FetchOperation(); |
|
73 |
|
74 /** |
|
75 * |
|
76 */ |
|
77 virtual const TDesC8& ProgressL(); |
|
78 |
|
79 /** |
|
80 * |
|
81 */ |
|
82 virtual const TDesC8& GetErrorProgressL( TInt aError ); |
|
83 |
|
84 protected: |
|
85 |
|
86 /** |
|
87 * |
|
88 */ |
|
89 CMsvPop3FetchOperation( |
|
90 CImumInternalApi& aMailboxApi, |
|
91 TRequestStatus& aObserverRequestStatus, |
|
92 MMsvProgressReporter& aReporter, |
|
93 TInt aFunctionId, |
|
94 TMsvId aService, |
|
95 const TImPop3GetMailInfo& aGetMailInfo); |
|
96 |
|
97 /** |
|
98 * for partial fetch |
|
99 */ |
|
100 CMsvPop3FetchOperation( |
|
101 CImumInternalApi& aMailboxApi, |
|
102 TRequestStatus& aObserverRequestStatus, |
|
103 MMsvProgressReporter& aReporter, |
|
104 TInt aFunctionId, |
|
105 TMsvId aService, |
|
106 const TImPop3GetMailInfo& aGetMailInfo, |
|
107 TInt aLimit); |
|
108 |
|
109 /** |
|
110 * |
|
111 */ |
|
112 void ConstructL( const CMsvEntrySelection& aSel ); |
|
113 |
|
114 /** |
|
115 * From CActive |
|
116 */ |
|
117 virtual void RunL(); |
|
118 |
|
119 /** |
|
120 * From CActive |
|
121 */ |
|
122 virtual void DoCancel(); |
|
123 |
|
124 /** |
|
125 * From CActive |
|
126 */ |
|
127 virtual void DoRunL(); |
|
128 |
|
129 /** |
|
130 * |
|
131 */ |
|
132 void DoConnectL(); |
|
133 |
|
134 /** |
|
135 * |
|
136 */ |
|
137 void DoFetchL(); |
|
138 |
|
139 /** |
|
140 * |
|
141 */ |
|
142 void DoDisconnectL(); |
|
143 |
|
144 protected: |
|
145 |
|
146 enum TFetchState { |
|
147 EStateIdle, |
|
148 EStateConnecting, |
|
149 EStateFetching, |
|
150 EStateDisconnecting }; |
|
151 TFetchState iState; |
|
152 |
|
153 protected: |
|
154 TBool iDisconnect; |
|
155 TDesC8* iFetchErrorProgress; |
|
156 TInt iFunctionId; |
|
157 TImPop3GetMailInfo iGetMailInfo; |
|
158 CMsvEntrySelection* iSelection; |
|
159 TInt iPopulateLimit; |
|
160 }; |
|
161 |
|
162 |
|
163 #endif |
|
164 |
|
165 // End of File |