|
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 * POP3 MTM UI |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __POP3MTMUI_H__ |
|
20 #define __POP3MTMUI_H__ |
|
21 |
|
22 #include <mtmuibas.h> |
|
23 #include <popcmtm.h> |
|
24 |
|
25 #include "ImumMtmBaseMtmUi.h" // CImumMtmBaseMtmUi |
|
26 |
|
27 |
|
28 // forward declarations |
|
29 class TEditorParameters; |
|
30 class CErrorUI; |
|
31 class CMuiuFlags; |
|
32 |
|
33 /** |
|
34 * CPop3MtmUi - POP3 MTM UI |
|
35 */ |
|
36 class CPop3MtmUi : public CImumMtmBaseMtmUi |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * |
|
42 */ |
|
43 static CPop3MtmUi* NewL( |
|
44 CBaseMtm& aBaseMtm, |
|
45 CRegisteredMtmDll& aRegisteredMtmDll ); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~CPop3MtmUi(); |
|
51 |
|
52 /** |
|
53 * From CBaseMtmUi |
|
54 * Function NOT dependent on the current context |
|
55 * Context set to new entry |
|
56 */ |
|
57 virtual CMsvOperation* CreateL( |
|
58 const TMsvEntry& aEntry, |
|
59 CMsvEntry& aParent, |
|
60 TRequestStatus& aStatus ); |
|
61 |
|
62 /** |
|
63 * From CBaseMtmUi |
|
64 * Context-specific |
|
65 */ |
|
66 virtual CMsvOperation* OpenL( TRequestStatus& aStatus ); |
|
67 |
|
68 /** |
|
69 * From CBaseMtmUi |
|
70 * Context-specific |
|
71 */ |
|
72 virtual CMsvOperation* CloseL( TRequestStatus& aStatus ); |
|
73 |
|
74 /** |
|
75 * From CBaseMtmUi |
|
76 * Context-specific |
|
77 */ |
|
78 virtual CMsvOperation* EditL( TRequestStatus& aStatus ); |
|
79 |
|
80 /** |
|
81 * From CBaseMtmUi |
|
82 * Context-specific |
|
83 */ |
|
84 virtual CMsvOperation* ViewL( TRequestStatus& aStatus ); |
|
85 |
|
86 /** |
|
87 * From CBaseMtmUi |
|
88 * Deletes entries from the current context, which must be a folder |
|
89 * or service of the relevant MTM |
|
90 */ |
|
91 virtual CMsvOperation* DeleteFromL( |
|
92 const CMsvEntrySelection& aSelection, |
|
93 TRequestStatus& aStatus ); |
|
94 |
|
95 /** |
|
96 * From CBaseMtmUi |
|
97 * Un-deletes entries from the current context, which must be a folder |
|
98 * or service of the relevant MTM |
|
99 */ |
|
100 virtual CMsvOperation* UnDeleteFromL( |
|
101 const CMsvEntrySelection& aSelection, |
|
102 TRequestStatus& aStatus ); |
|
103 |
|
104 /** |
|
105 * From CBaseMtmUi |
|
106 * Context-specific |
|
107 * Takes ownership of the passed entry (which the context is switched to ) |
|
108 */ |
|
109 virtual CMsvOperation* ReplyL( |
|
110 TMsvId aDestination, |
|
111 TMsvPartList aPartlist, |
|
112 TRequestStatus& aCompletionStatus ); |
|
113 |
|
114 /** |
|
115 * From CBaseMtmUi |
|
116 * Context-specific |
|
117 * Takes ownership of the passed entry (which the context is switched to ) |
|
118 */ |
|
119 virtual CMsvOperation* ForwardL( |
|
120 TMsvId aDestination, |
|
121 TMsvPartList aPartList, |
|
122 TRequestStatus& aCompletionStatus ); |
|
123 |
|
124 /** |
|
125 * From CBaseMtmUi |
|
126 * Context-specific |
|
127 * Selections must be in same folder and all of the correct MTM type |
|
128 * Context may change after calling these functions |
|
129 */ |
|
130 virtual CMsvOperation* OpenL( |
|
131 TRequestStatus& aStatus, |
|
132 const CMsvEntrySelection& aSelection ); |
|
133 |
|
134 /** |
|
135 * From CBaseMtmUi |
|
136 * Context-specific |
|
137 * Selections must be in same folder and all of the correct MTM type |
|
138 * Context may change after calling these functions |
|
139 */ |
|
140 virtual CMsvOperation* CloseL( |
|
141 TRequestStatus& aStatus, |
|
142 const CMsvEntrySelection& aSelection ); |
|
143 |
|
144 /** |
|
145 * From CBaseMtmUi |
|
146 * Context-specific |
|
147 * Selections must be in same folder and all of the correct MTM type |
|
148 * Context may change after calling these functions |
|
149 */ |
|
150 virtual CMsvOperation* EditL( |
|
151 TRequestStatus& aStatus, |
|
152 const CMsvEntrySelection& aSelection ); |
|
153 |
|
154 /** |
|
155 * From CBaseMtmUi |
|
156 * Context-specific |
|
157 * Selections must be in same folder and all of the correct MTM type |
|
158 * Context may change after calling these functions |
|
159 */ |
|
160 virtual CMsvOperation* ViewL( |
|
161 TRequestStatus& aStatus, |
|
162 const CMsvEntrySelection& aSelection ); |
|
163 |
|
164 /** |
|
165 * From CBaseMtmUi |
|
166 * Context-specific |
|
167 * Selections must be in same folder and all of the correct MTM type |
|
168 * Context may change after calling these functions |
|
169 */ |
|
170 virtual CMsvOperation* CancelL( |
|
171 TRequestStatus& aStatus, |
|
172 const CMsvEntrySelection& aSelection ); |
|
173 |
|
174 /** |
|
175 * From CBaseMtmUi |
|
176 */ |
|
177 virtual TInt QueryCapability( TUid aCapability, TInt& aResponse ); |
|
178 |
|
179 /** |
|
180 * From CBaseMtmUi |
|
181 */ |
|
182 virtual CMsvOperation* InvokeAsyncFunctionL( |
|
183 TInt aFunctionId, |
|
184 const CMsvEntrySelection& aSelection, |
|
185 TRequestStatus& aCompletionStatus, |
|
186 TDes8& aParameter ); |
|
187 |
|
188 /** |
|
189 * From CBaseMtmUi |
|
190 * not relevant to POP3 - Leave with not supported |
|
191 */ |
|
192 virtual CMsvOperation* CopyToL( |
|
193 const CMsvEntrySelection& aSelection, |
|
194 TRequestStatus& aStatus ); |
|
195 |
|
196 /** |
|
197 * From CBaseMtmUi |
|
198 * not relevant to POP3 - Leave with not supported |
|
199 */ |
|
200 virtual CMsvOperation* MoveToL( |
|
201 const CMsvEntrySelection& aSelection, |
|
202 TRequestStatus& aStatus ); |
|
203 |
|
204 /** |
|
205 * From CBaseMtmUi |
|
206 * not relevant to POP3 - Leave with not supported |
|
207 */ |
|
208 virtual CMsvOperation* CopyFromL( |
|
209 const CMsvEntrySelection& aSelection, |
|
210 TMsvId aTargetId, |
|
211 TRequestStatus& aStatus ); |
|
212 |
|
213 /** |
|
214 * From CBaseMtmUi |
|
215 * not relevant to POP3 - Leave with not supported |
|
216 */ |
|
217 virtual CMsvOperation* MoveFromL( |
|
218 const CMsvEntrySelection& aSelection, |
|
219 TMsvId aTargetId, |
|
220 TRequestStatus& aStatus ); |
|
221 |
|
222 /** |
|
223 * From CBaseMtmUi |
|
224 * Interpret transfer progress |
|
225 */ |
|
226 virtual TInt GetProgress( |
|
227 const TDesC8& aProgress, |
|
228 TBuf<EProgressStringMaxLen>& aReturnString, |
|
229 TInt& aTotalEntryCount, |
|
230 TInt& aEntriesDone, |
|
231 TInt& aCurrentEntrySize, |
|
232 TInt& aCurrentBytesTrans ) const; |
|
233 |
|
234 /** |
|
235 * From CBaseMtmUi |
|
236 * Interpret transfer progress |
|
237 */ |
|
238 virtual TInt DisplayProgressSummary( |
|
239 const TDesC8& aProgress ) const; |
|
240 |
|
241 /** |
|
242 * Specific to Pop3 |
|
243 */ |
|
244 CMsvOperation* LaunchEditorApplicationL( |
|
245 TRequestStatus& aStatus, |
|
246 const TEditorParameters& aParams ); |
|
247 |
|
248 protected: |
|
249 /** |
|
250 * |
|
251 */ |
|
252 TInt GetEngineProgress( |
|
253 const TDesC8& aProgress, |
|
254 TBuf<EProgressStringMaxLen>& aReturnString, |
|
255 TInt& aTotalEntryCount, |
|
256 TInt& aEntriesDone, |
|
257 TInt& aCurrentEntrySize, |
|
258 TInt& aCurrentBytesTrans ) const; |
|
259 |
|
260 /** |
|
261 * |
|
262 */ |
|
263 TInt GetUiProgress( |
|
264 const TDesC8& aProgress, |
|
265 TBuf<EProgressStringMaxLen>& aReturnString, |
|
266 TInt& aTotalEntryCount, |
|
267 TInt& aEntriesDone, |
|
268 TInt& aCurrentEntrySize, |
|
269 TInt& aCurrentBytesTrans ) const; |
|
270 |
|
271 /** |
|
272 * |
|
273 */ |
|
274 TInt GetConnectionProgress( |
|
275 const TDesC8& aProgress, |
|
276 TBuf<EProgressStringMaxLen>& aReturnString, |
|
277 TInt& aTotalEntryCount, |
|
278 TInt& aEntriesDone, |
|
279 TInt& aCurrentEntrySize, |
|
280 TInt& aCurrentBytesTrans ) const; |
|
281 |
|
282 /** |
|
283 * |
|
284 */ |
|
285 TInt GetDeleteProgress( |
|
286 TInt aTotalMsgs, |
|
287 TInt aError, |
|
288 TBuf<EProgressStringMaxLen>& aReturnString, |
|
289 TInt& aTotalEntryCount, |
|
290 TInt& aEntriesDone, |
|
291 TInt& aCurrentEntrySize, |
|
292 TInt& aCurrentBytesTrans) const; |
|
293 |
|
294 /** |
|
295 * |
|
296 */ |
|
297 TInt DisplayProgressErrorAlert( TInt aErrCode ) const; |
|
298 |
|
299 /** |
|
300 * |
|
301 */ |
|
302 void FormatConnectingServerProgressTextL( |
|
303 TMsvId aServiceId, |
|
304 TDes& aReturnString ) const; |
|
305 |
|
306 /** |
|
307 * |
|
308 */ |
|
309 CMsvEntrySelection* SingleEntrySelectionLC( |
|
310 TMsvId aId ) const; |
|
311 |
|
312 /** |
|
313 * |
|
314 */ |
|
315 CMsvOperation* ViewMessageL( TRequestStatus& aStatus ); |
|
316 |
|
317 /** |
|
318 * |
|
319 */ |
|
320 CMsvOperation* EditSmtpServiceL( |
|
321 TRequestStatus& aStatus, |
|
322 TMsvId aServiceEntry ) const; |
|
323 |
|
324 /** |
|
325 * |
|
326 */ |
|
327 CMsvOperation* RetrieveAndEditMessageL( |
|
328 TRequestStatus& aStatus, |
|
329 const TEditorParameters& aEditorParams ); |
|
330 |
|
331 /** |
|
332 * |
|
333 */ |
|
334 CMsvOperation* GetMailL( TRequestStatus& aStatus ); |
|
335 |
|
336 /** |
|
337 * |
|
338 */ |
|
339 CMsvOperation* FetchL( |
|
340 TRequestStatus& aStatus, |
|
341 const CMsvEntrySelection& aSel, |
|
342 TInt aFunctionId ); |
|
343 |
|
344 /** |
|
345 * |
|
346 */ |
|
347 TInt FetchSyncL( const CMsvEntrySelection& aSelection ); |
|
348 |
|
349 /** |
|
350 * |
|
351 */ |
|
352 HBufC* GetEditorFileNameL(); |
|
353 |
|
354 /** |
|
355 * |
|
356 */ |
|
357 HBufC* GetViewerFileNameL(); |
|
358 |
|
359 /** |
|
360 * |
|
361 */ |
|
362 TInt ProgressType( const TDesC8& aProgress ) const; |
|
363 |
|
364 /** |
|
365 * |
|
366 */ |
|
367 const CImPop3Settings& GetAccountSettingsL( TMsvId aId ) const; |
|
368 |
|
369 /** |
|
370 * |
|
371 */ |
|
372 void CheckSelectionL( |
|
373 const CMsvEntrySelection& aSelection, |
|
374 TMsvId& aParent ) const; |
|
375 |
|
376 /** |
|
377 * |
|
378 */ |
|
379 void CheckEntryL( const TMsvEntry& aEntry ) const; |
|
380 |
|
381 /** |
|
382 * |
|
383 */ |
|
384 CMsvEntrySelection* StripInvalidEntriesLC( |
|
385 const CMsvEntrySelection& aSelection ) const; |
|
386 |
|
387 protected: |
|
388 /** |
|
389 * From CBaseMtmUi |
|
390 */ |
|
391 virtual void GetResourceFileName( TFileName& aFileName ) const; |
|
392 |
|
393 private: |
|
394 /** |
|
395 * |
|
396 */ |
|
397 CPop3MtmUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll ); |
|
398 /** |
|
399 * |
|
400 */ |
|
401 virtual void ConstructL(); |
|
402 /** |
|
403 * |
|
404 */ |
|
405 inline CPop3ClientMtm& Pop3ClientMtm() const; |
|
406 |
|
407 /** |
|
408 * Shows message info dialog |
|
409 * Context should be the message which info is displayed. |
|
410 */ |
|
411 CMsvOperation* ShowMessageInfoL( |
|
412 TRequestStatus& aCompletionStatus, |
|
413 TDes8& aParameter ); |
|
414 |
|
415 private: // Data |
|
416 HBufC* iEditorFilename; |
|
417 HBufC* iViewerFilename; |
|
418 |
|
419 struct TServerNameCache |
|
420 { |
|
421 TMsvId iService; |
|
422 TBuf<EProgressStringMaxLen> iConnectingServerTxt; |
|
423 }; |
|
424 mutable TServerNameCache iServerNameCache; |
|
425 }; |
|
426 |
|
427 |
|
428 inline CPop3ClientMtm& CPop3MtmUi::Pop3ClientMtm() const |
|
429 { |
|
430 return STATIC_CAST(CPop3ClientMtm&, BaseMtm()); |
|
431 } |
|
432 |
|
433 |
|
434 #endif // __PP3U_H__ |