16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 |
19 |
20 //<cmail> |
20 //<cmail> |
21 #include "MsgStore.h" |
21 #include "msgstore.h" |
22 #include "MsgStoreSearchCriteria.h" |
22 #include "msgstoresearchcriteria.h" |
23 #include "MFSMailBoxSearchObserver.h" |
23 #include "mfsmailboxsearchobserver.h" |
24 //</cmail> |
24 //</cmail> |
25 |
25 |
26 #include "BasePlugin.h" |
26 #include "baseplugin.h" |
27 #include "BasePluginPanic.h" |
27 #include "basepluginpanic.h" |
28 #include "baseplugincommonutils.h" |
28 #include "baseplugincommonutils.h" |
29 #include "baseplugindelayedopsprivate.h" |
29 #include "baseplugindelayedopsprivate.h" |
30 |
30 |
31 /** |
31 /** |
32 * Base plugin has no particular id. |
32 * Base plugin has no particular id. |
33 */ |
33 */ |
34 TUint CBasePlugin::GetPluginId() |
34 EXPORT_C TUint CBasePlugin::GetPluginId() |
35 { |
35 { |
36 return 0; |
36 return 0; |
37 } |
37 } |
38 |
38 |
39 |
39 |
40 /** |
40 /** |
41 * |
41 * |
42 */ |
42 */ |
43 TFSMailBoxStatus CBasePlugin::GetMailBoxStatus( |
43 EXPORT_C TFSMailBoxStatus CBasePlugin::GetMailBoxStatus( |
44 const TFSMailMsgId& /*aMailBoxId*/ ) |
44 const TFSMailMsgId& /*aMailBoxId*/ ) |
45 { |
45 { |
46 return EFSMailBoxOnline; |
46 return EFSMailBoxOnline; |
47 } |
47 } |
48 |
48 |
49 |
49 |
50 /** |
50 /** |
51 * |
51 * |
52 */ |
52 */ |
53 TBool CBasePlugin::MailboxHasCapabilityL( |
53 EXPORT_C TBool CBasePlugin::MailboxHasCapabilityL( |
54 TFSMailBoxCapabilities /*aCapability*/, |
54 TFSMailBoxCapabilities /*aCapability*/, |
55 TFSMailMsgId /*aMailBoxId*/ ) |
55 TFSMailMsgId /*aMailBoxId*/ ) |
56 { |
56 { |
57 return EFalse; |
57 return EFalse; |
58 } |
58 } |
59 |
59 |
60 |
60 |
61 /** |
61 /** |
62 * |
62 * |
63 */ |
63 */ |
64 TInt CBasePlugin::WizardDataAvailableL() |
64 EXPORT_C TInt CBasePlugin::WizardDataAvailableL() |
65 { |
65 { |
66 return KErrNotSupported; |
66 return KErrNotSupported; |
67 } |
67 } |
68 |
68 |
69 |
69 |
70 /** |
70 /** |
71 * |
71 * |
72 */ |
72 */ |
73 void CBasePlugin::AuthenticateL( |
73 EXPORT_C void CBasePlugin::AuthenticateL( |
74 MFSMailRequestObserver& /*aOperationObserver*/, |
74 MFSMailRequestObserver& /*aOperationObserver*/, |
75 TInt /*aRequestId*/ ) |
75 TInt /*aRequestId*/ ) |
76 { |
76 { |
77 |
77 |
78 } |
78 } |
79 |
79 |
80 |
80 |
81 /** |
81 /** |
82 */ |
82 */ |
83 void CBasePlugin::SetCredentialsL( |
83 EXPORT_C void CBasePlugin::SetCredentialsL( |
84 const TFSMailMsgId& /* aMailBoxId */, |
84 const TFSMailMsgId& /* aMailBoxId */, |
85 const TDesC& /* aUsername */, |
85 const TDesC& /* aUsername */, |
86 const TDesC& /* aPassword */ ) |
86 const TDesC& /* aPassword */ ) |
87 { |
87 { |
88 User::Leave( KErrNotSupported ); |
88 User::Leave( KErrNotSupported ); |
90 |
90 |
91 |
91 |
92 /** |
92 /** |
93 * |
93 * |
94 */ |
94 */ |
95 TDesC& CBasePlugin::GetBrandingIdL( const TFSMailMsgId& aMailboxId ) |
95 EXPORT_C TDesC& CBasePlugin::GetBrandingIdL( const TFSMailMsgId& aMailboxId ) |
96 { |
96 { |
97 CMailboxInfo& mailbox = GetMailboxInfoL( aMailboxId.Id() ); |
97 CMailboxInfo& mailbox = GetMailboxInfoL( aMailboxId.Id() ); |
98 return *mailbox.iBrandingId; |
98 return *mailbox.iBrandingId; |
99 } |
99 } |
100 |
100 |
101 |
101 |
102 /** |
102 /** |
103 * |
103 * |
104 */ |
104 */ |
105 TInt CBasePlugin::CancelSyncL( const TFSMailMsgId& /*aMailBoxId*/ ) |
105 EXPORT_C TInt CBasePlugin::CancelSyncL( const TFSMailMsgId& /*aMailBoxId*/ ) |
106 { |
106 { |
107 return KErrNotSupported; |
107 return KErrNotSupported; |
108 } |
108 } |
109 |
109 |
110 |
110 |
169 |
169 |
170 |
170 |
171 /** |
171 /** |
172 * |
172 * |
173 */ |
173 */ |
174 void CBasePlugin::SearchL( |
174 EXPORT_C void CBasePlugin::SearchL( |
175 const TFSMailMsgId& aMailBoxId, |
175 const TFSMailMsgId& aMailBoxId, |
176 const RArray<TFSMailMsgId>& aFolderIds, |
176 const RArray<TFSMailMsgId>& aFolderIds, |
177 const RPointerArray<TDesC>& aSearchStrings, |
177 const RPointerArray<TDesC>& aSearchStrings, |
178 const TFSMailSortCriteria& aSortCriteria, |
178 const TFSMailSortCriteria& aSortCriteria, |
179 MFSMailBoxSearchObserver& aSearchObserver ) |
179 MFSMailBoxSearchObserver& aSearchObserver ) |
221 |
221 |
222 |
222 |
223 /** |
223 /** |
224 * |
224 * |
225 */ |
225 */ |
226 void CBasePlugin::CancelSearch( |
226 EXPORT_C void CBasePlugin::CancelSearch( |
227 const TFSMailMsgId& aMailBoxId ) |
227 const TFSMailMsgId& aMailBoxId ) |
228 |
228 |
229 { |
229 { |
230 TRAP_IGNORE( DoCancelSearchL( aMailBoxId ) ); |
230 TRAP_IGNORE( DoCancelSearchL( aMailBoxId ) ); |
231 } |
231 } |
232 |
232 |
233 |
233 |
234 /** |
234 /** |
235 * |
235 * |
236 */ |
236 */ |
237 void CBasePlugin::ClearSearchResultCache( |
237 EXPORT_C void CBasePlugin::ClearSearchResultCache( |
238 const TFSMailMsgId& aMailBoxId ) |
238 const TFSMailMsgId& aMailBoxId ) |
239 |
239 |
240 { |
240 { |
241 TRAP_IGNORE( DoClearSearchResultCacheL( aMailBoxId ) ); |
241 TRAP_IGNORE( DoClearSearchResultCacheL( aMailBoxId ) ); |
242 } |
242 } |
246 |
246 |
247 |
247 |
248 /** |
248 /** |
249 * |
249 * |
250 */ |
250 */ |
251 void CBasePlugin::GoOfflineL( |
251 EXPORT_C void CBasePlugin::GoOfflineL( |
252 const TFSMailMsgId& /*aMailBoxId*/ ) |
252 const TFSMailMsgId& /*aMailBoxId*/ ) |
253 { |
253 { |
254 } |
254 } |
255 |
255 |
256 |
256 |
257 /** |
257 /** |
258 * |
258 * |
259 */ |
259 */ |
260 void CBasePlugin::GoOnlineL( |
260 EXPORT_C void CBasePlugin::GoOnlineL( |
261 const TFSMailMsgId& /*aMailBoxId*/ ) |
261 const TFSMailMsgId& /*aMailBoxId*/ ) |
262 { |
262 { |
263 } |
263 } |
264 |
264 |
265 |
265 |
266 /** |
266 /** |
267 * |
267 * |
268 */ |
268 */ |
269 void CBasePlugin::RefreshNowL( |
269 EXPORT_C void CBasePlugin::RefreshNowL( |
270 const TFSMailMsgId& /*aMailBoxId*/, |
270 const TFSMailMsgId& /*aMailBoxId*/, |
271 MFSMailRequestObserver& /*aOperationObserver*/, |
271 MFSMailRequestObserver& /*aOperationObserver*/, |
272 TInt /*aRequestId*/, |
272 TInt /*aRequestId*/ ) |
273 const TBool /*aSilentConnection=EFalse*/ ) |
|
274 { |
273 { |
275 |
274 |
276 } |
275 } |
277 |
276 |
278 |
277 |
352 |
351 |
353 |
352 |
354 /** |
353 /** |
355 * |
354 * |
356 */ |
355 */ |
357 TFSProgress CBasePlugin::StatusL( TInt /*aRequestId*/ ) |
356 EXPORT_C TFSProgress CBasePlugin::StatusL( TInt /*aRequestId*/ ) |
358 { |
357 { |
359 TFSProgress result = { TFSProgress::EFSStatus_Waiting, 0, 0, 0 }; |
358 TFSProgress result = { TFSProgress::EFSStatus_Waiting, 0, 0, 0 }; |
360 return result; |
359 return result; |
361 } |
360 } |
362 |
361 |
363 |
362 |
364 /** |
363 /** |
365 * Concrete plugins need to call the base plugin's implementation. |
364 * Concrete plugins need to call the base plugin's implementation. |
366 * @param aRequestId |
365 * @param aRequestId |
367 */ |
366 */ |
368 void CBasePlugin::CancelL( TInt aRequestId ) |
367 EXPORT_C void CBasePlugin::CancelL( TInt aRequestId ) |
369 { |
368 { |
370 //find the fetch request and notify the observer. |
369 //find the fetch request and notify the observer. |
371 TInt count = iReqs.Count(); |
370 TInt count = iReqs.Count(); |
372 for ( TInt i = 0; i < count; i++ ) |
371 for ( TInt i = 0; i < count; i++ ) |
373 { |
372 { |
374 if ( iReqs[i]->iRequestId == aRequestId ) |
373 if ( iReqs[i]->iRequestId == aRequestId ) |
375 { |
374 { |
376 CFetchRequester* request = iReqs[i]; |
375 CFetchRequester* request = iReqs[i]; |
377 //<qmail> |
376 |
378 TFSProgress progress = TFSProgress(); |
377 TFSProgress progress; |
379 //</qmail> |
|
380 progress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled; |
378 progress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled; |
381 progress.iCounter = progress.iMaxCount = 1; |
379 progress.iCounter = progress.iMaxCount = 1; |
382 progress.iError = KErrNone; |
380 progress.iError = KErrNone; |
383 request->iObserver.RequestResponseL( progress, aRequestId ); |
381 request->iObserver.RequestResponseL( progress, aRequestId ); |
384 |
382 |
385 iReqs.Remove( i ); |
383 iReqs.Remove( i ); |
386 delete request; |
384 delete request; |
387 break; |
385 break; |
388 } |
386 } |
389 } |
387 } |
390 //<qmail> |
388 } |
391 count = iDelayedOpReqs.Count(); |
389 |
392 for ( TInt i = 0; i < count; i++ ) |
390 |
393 { |
391 /** |
394 if ( iDelayedOpReqs[i]->iRequestId == aRequestId ) |
392 * |
395 { |
393 */ |
396 CDelayedOp* request = iDelayedOpReqs[i]; |
394 EXPORT_C const TFSProgress CBasePlugin::GetLastSyncStatusL( |
397 TFSProgress progress = TFSProgress(); |
|
398 progress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled; |
|
399 progress.iCounter = progress.iMaxCount = 1; |
|
400 progress.iError = KErrNone; |
|
401 request->iOperationObserver->RequestResponseL( progress, aRequestId ); |
|
402 iDelayedOpsManager->DequeueOp(*request); |
|
403 iDelayedOpReqs.Remove( i ); |
|
404 delete request; |
|
405 break; |
|
406 } |
|
407 } |
|
408 //</qmail> |
|
409 } |
|
410 |
|
411 |
|
412 /** |
|
413 * |
|
414 */ |
|
415 const TFSProgress CBasePlugin::GetLastSyncStatusL( |
|
416 const TFSMailMsgId& /*aMailBoxId*/ ) |
395 const TFSMailMsgId& /*aMailBoxId*/ ) |
417 |
396 |
418 { |
397 { |
419 User::Leave( KErrNotSupported ); |
398 User::Leave( KErrNotSupported ); |
420 |
399 |
492 } |
470 } |
493 |
471 |
494 /** |
472 /** |
495 * |
473 * |
496 */ |
474 */ |
497 /*virtual*/ void CBasePlugin::SetMailboxName( |
475 EXPORT_C /*virtual*/ void CBasePlugin::SetMailboxName( |
498 const TFSMailMsgId& /*aMailboxId*/, |
476 const TFSMailMsgId& /*aMailboxId*/, |
499 const TDesC& /*aMailboxName*/ ) |
477 const TDesC& /*aMailboxName*/ ) |
500 { |
478 { |
501 } |
479 } |
502 |
480 |
503 /** |
481 /** |
504 * |
482 * |
505 */ |
483 */ |
506 /*protected*/ void CBasePlugin::ResetCache() |
484 /*protected*/ EXPORT_C void CBasePlugin::ResetCache() |
507 { |
485 { |
508 __LOG_ENTER_SUPPRESS( "ResetCache" ); |
486 __LOG_ENTER_SUPPRESS( "ResetCache" ); |
509 |
487 |
510 ResetBodyCache(); |
488 ResetBodyCache(); |
511 |
489 |
569 |
547 |
570 /** |
548 /** |
571 * |
549 * |
572 */ |
550 */ |
573 /*protected*/ |
551 /*protected*/ |
574 CMsgStoreMessagePart* CBasePlugin::GetCachedBodyL( |
552 EXPORT_C CMsgStoreMessagePart* CBasePlugin::GetCachedBodyL( |
575 TMsgStoreId aPartId ) |
553 TMsgStoreId aPartId ) |
576 { |
554 { |
577 __LOG_ENTER_SUPPRESS( "GetCachedBodyL" ); |
555 __LOG_ENTER_SUPPRESS( "GetCachedBodyL" ); |
578 __ASSERT_DEBUG( NULL != iCacheLine.iMsg, |
556 __ASSERT_DEBUG( NULL != iCacheLine.iMsg, |
579 BasePluginPanic( EInvalidMsgStoreCacheState ) ); |
557 BasePluginPanic( EInvalidMsgStoreCacheState ) ); |