14 * Description: |
14 * Description: |
15 * Move a selection of messages that may or may not be complete |
15 * Move a selection of messages that may or may not be complete |
16 * |
16 * |
17 */ |
17 */ |
18 |
18 |
|
19 |
19 #include "emailtrace.h" |
20 #include "emailtrace.h" |
20 #include "ipsplgheaders.h" |
21 #include "ipsplgheaders.h" |
21 |
22 |
22 // <qmail> priority parameter has been removed |
23 const TInt KMoveRemoteOpPriority = CActive::EPriorityStandard; |
23 |
24 |
24 // ---------------------------------------------------------------------------- |
25 // ---------------------------------------------------------------------------- |
25 // ---------------------------------------------------------------------------- |
26 // ---------------------------------------------------------------------------- |
26 // <qmail> TImImap4GetMailInfo& -> TMsvId&, aFunctionId removed |
|
27 // <qmail> MFSMailRequestObserver& changed to pointer |
|
28 CIpsPlgImap4MoveRemoteOp* CIpsPlgImap4MoveRemoteOp::NewL( |
27 CIpsPlgImap4MoveRemoteOp* CIpsPlgImap4MoveRemoteOp::NewL( |
29 CMsvSession& aMsvSession, |
28 CMsvSession& aMsvSession, |
30 TRequestStatus& aObserverRequestStatus, |
29 TRequestStatus& aObserverRequestStatus, |
|
30 TInt aFunctionId, |
31 TMsvId aService, |
31 TMsvId aService, |
32 CIpsPlgTimerOperation& aActivityTimer, |
32 CIpsPlgTimerOperation& aActivityTimer, |
33 const TMsvId& aDestinationFolderId, |
33 const TImImap4GetMailInfo& aGetMailInfo, |
34 const CMsvEntrySelection& aSelection, |
34 const CMsvEntrySelection& aSel, |
35 TFSMailMsgId aFSMailBoxId, |
35 TFSMailMsgId aFSMailBoxId, |
36 MFSMailRequestObserver* aFSOperationObserver, |
36 MFSMailRequestObserver& aFSOperationObserver, |
37 TInt aFSRequestId ) |
37 TInt aFSRequestId ) |
38 { |
38 { |
39 FUNC_LOG; |
39 FUNC_LOG; |
40 CIpsPlgImap4MoveRemoteOp* op = new (ELeave) CIpsPlgImap4MoveRemoteOp( |
40 CIpsPlgImap4MoveRemoteOp* op = new (ELeave) CIpsPlgImap4MoveRemoteOp( |
41 aMsvSession, |
41 aMsvSession, |
42 aObserverRequestStatus, |
42 aObserverRequestStatus, |
|
43 aFunctionId, |
43 aService, |
44 aService, |
44 aActivityTimer, |
45 aActivityTimer, |
45 aDestinationFolderId, |
46 aGetMailInfo, |
46 aFSMailBoxId, |
47 aFSMailBoxId, |
47 aFSOperationObserver, |
48 aFSOperationObserver, |
48 aFSRequestId ); |
49 aFSRequestId ); |
49 |
50 |
50 CleanupStack::PushL( op ); |
51 CleanupStack::PushL( op ); |
51 op->ConstructL( aSelection ); |
52 op->ConstructL( aSel ); |
52 CleanupStack::Pop( op ); |
53 CleanupStack::Pop( op ); |
53 return op; |
54 return op; |
54 } |
55 } |
55 |
56 |
56 // ---------------------------------------------------------------------------- |
57 // ---------------------------------------------------------------------------- |
57 // ---------------------------------------------------------------------------- |
58 // ---------------------------------------------------------------------------- |
58 // <qmail> TImImap4GetMailInfo& -> TMsvId&, aFunctionId removed, priority param removed |
|
59 // <qmail> MFSMailRequestObserver& changed to pointer |
|
60 CIpsPlgImap4MoveRemoteOp::CIpsPlgImap4MoveRemoteOp( |
59 CIpsPlgImap4MoveRemoteOp::CIpsPlgImap4MoveRemoteOp( |
61 CMsvSession& aMsvSession, |
60 CMsvSession& aMsvSession, |
62 TRequestStatus& aObserverRequestStatus, |
61 TRequestStatus& aObserverRequestStatus, |
|
62 TInt aFunctionId, |
63 TMsvId aService, |
63 TMsvId aService, |
64 CIpsPlgTimerOperation& aActivityTimer, |
64 CIpsPlgTimerOperation& aActivityTimer, |
65 const TMsvId& aDestinationFolderId, |
65 const TImImap4GetMailInfo& aGetMailInfo, |
66 TFSMailMsgId aFSMailBoxId, |
66 TFSMailMsgId aFSMailBoxId, |
67 MFSMailRequestObserver* aFSOperationObserver, |
67 MFSMailRequestObserver& aFSOperationObserver, |
68 TInt aFSRequestId ) |
68 TInt aFSRequestId ) |
69 : |
69 : |
70 CIpsPlgOnlineOperation( |
70 CIpsPlgOnlineOperation( |
71 aMsvSession, |
71 aMsvSession, |
72 aObserverRequestStatus, |
72 KMoveRemoteOpPriority, |
73 aActivityTimer, |
73 aObserverRequestStatus, |
74 aFSMailBoxId, |
74 aActivityTimer, |
75 aFSOperationObserver, |
75 aFSMailBoxId, |
76 aFSRequestId ), |
76 aFSOperationObserver, |
77 // <qmail> |
77 aFSRequestId ), |
78 iState( EIdle ), |
78 iFunctionId(aFunctionId), |
79 iDestinationFolderId( aDestinationFolderId ) |
79 iGetMailInfo(aGetMailInfo) |
80 // </qmail> |
|
81 { |
80 { |
82 FUNC_LOG; |
81 FUNC_LOG; |
83 iService = aService; |
82 iService = aService; |
84 } |
83 } |
85 |
84 |
110 { |
106 { |
111 FUNC_LOG; |
107 FUNC_LOG; |
112 iState = EConnecting; |
108 iState = EConnecting; |
113 iStatus = KRequestPending; |
109 iStatus = KRequestPending; |
114 |
110 |
115 // <qmail> priority parameter has been removed |
|
116 CIpsPlgImap4ConnectOp* connOp = CIpsPlgImap4ConnectOp::NewL( |
111 CIpsPlgImap4ConnectOp* connOp = CIpsPlgImap4ConnectOp::NewL( |
117 iMsvSession, |
112 iMsvSession, |
|
113 KMoveRemoteOpPriority, |
118 iStatus, |
114 iStatus, |
119 iService, |
115 iService, |
120 *iActivityTimer, |
116 *iActivityTimer, |
121 iFSMailboxId, |
117 iFSMailboxId, |
122 NULL, // no operationobserver for suboperation |
118 iFSOperationObserver, |
123 0, // no requestId needed |
119 iFSRequestId, |
124 NULL, // event handler not needed whin plain connect |
120 NULL, // event handler not needed whin plain connect |
125 ETrue ); // do only connect |
121 ETrue, |
|
122 EFalse ); |
126 |
123 |
127 delete iSubOperation; |
124 delete iOperation; |
128 iSubOperation = connOp; |
125 iOperation = connOp; |
129 |
126 |
130 SetActive(); |
127 SetActive(); |
131 } |
128 } |
132 |
129 |
133 // ---------------------------------------------------------------------------- |
130 // ---------------------------------------------------------------------------- |
292 iStatus = KRequestPending; |
289 iStatus = KRequestPending; |
293 // first element of the CMsvEntrySelection is the service which is then |
290 // first element of the CMsvEntrySelection is the service which is then |
294 // followed by any messages |
291 // followed by any messages |
295 if( iRemoteSel->Count() > 1 ) |
292 if( iRemoteSel->Count() > 1 ) |
296 { |
293 { |
297 // <qmail> deletion of iSubOperation is done inside InvokeClientMtmAsyncFunctionL </qmail> |
294 // Switch operations. |
|
295 delete iOperation; |
|
296 iOperation = NULL; |
298 |
297 |
299 // Filters are not used when performing 'move' operation, use normal |
298 // Filters are not used when performing 'move' operation, use normal |
300 // getmail info instead |
299 // getmail info instead |
301 // <qmail> |
300 TPckg<TImImap4GetMailInfo> param( iGetMailInfo ); |
302 TPckgBuf<TImImap4GetMailInfo> paramBuf; |
301 InvokeClientMtmAsyncFunctionL( iFunctionId, *iRemoteSel, iService, param ); |
303 TImImap4GetMailInfo& mailInfo = paramBuf(); |
|
304 mailInfo.iMaxEmailSize = KMaxTInt32; |
|
305 mailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments; |
|
306 mailInfo.iDestinationFolder = iDestinationFolderId; |
|
307 |
|
308 // <qmail> Parameters changed |
|
309 InvokeClientMtmAsyncFunctionL( KIMAP4MTMMoveMailSelectionWhenAlreadyConnected, *iRemoteSel, paramBuf ); |
|
310 // </qmail> |
|
311 SetActive(); |
302 SetActive(); |
312 } |
303 } |
313 else |
304 else |
314 { |
305 { |
315 // <qmail> SetActive(); moved inside CompleteThis(); |
306 SetActive(); |
316 CompleteThis(); |
307 CompleteThis(); |
317 } |
308 } |
318 } |
309 } |
319 |
310 |
320 // <qmail> removed CIpsPlgImap4MoveRemoteOp::GetEngineProgress( const TDesC8& aProgress ) |
|
321 |
|
322 // <qmail> new func to this op |
|
323 // ---------------------------------------------------------------------------- |
311 // ---------------------------------------------------------------------------- |
324 // ---------------------------------------------------------------------------- |
312 // ---------------------------------------------------------------------------- |
325 TIpsOpType CIpsPlgImap4MoveRemoteOp::IpsOpType() const |
313 TInt CIpsPlgImap4MoveRemoteOp::GetEngineProgress( const TDesC8& aProgress ) |
326 { |
314 { |
327 FUNC_LOG; |
315 FUNC_LOG; |
328 return EIpsOpTypeMoveRemoteOp; |
316 if( !aProgress.Length() ) |
329 } |
317 { |
330 // </qmail> |
318 return KErrNone; |
|
319 } |
|
320 else |
|
321 { |
|
322 TPckgBuf<TImap4CompoundProgress> paramPack; |
|
323 paramPack.Copy( aProgress ); |
|
324 const TImap4GenericProgress& progress = paramPack().iGenericProgress; |
|
325 |
|
326 return progress.iErrorCode; |
|
327 } |
|
328 } |
331 |
329 |
332 // class CIpsPlgImap4MoveRemoteOpObserver |
330 // class CIpsPlgImap4MoveRemoteOpObserver |
333 // |
331 // |
334 |
332 |
335 // ---------------------------------------------------------------------------- |
333 // ---------------------------------------------------------------------------- |