37 // ----------------------------------------------------------------------------- |
38 // ----------------------------------------------------------------------------- |
38 // CFSMailBox::NewLC |
39 // CFSMailBox::NewLC |
39 // ----------------------------------------------------------------------------- |
40 // ----------------------------------------------------------------------------- |
40 EXPORT_C CFSMailBox* CFSMailBox::NewLC(TFSMailMsgId aMailBoxId) |
41 EXPORT_C CFSMailBox* CFSMailBox::NewLC(TFSMailMsgId aMailBoxId) |
41 { |
42 { |
42 FUNC_LOG; |
43 NM_FUNCTION; |
43 CFSMailBox* api = new (ELeave) CFSMailBox(); |
44 |
44 CleanupStack:: PushL(api); |
45 CFSMailBox* api = new (ELeave) CFSMailBox(); |
45 api->ConstructL(aMailBoxId); |
46 CleanupStack:: PushL(api); |
46 return api; |
47 api->ConstructL(aMailBoxId); |
|
48 return api; |
47 } |
49 } |
48 |
50 |
49 // ----------------------------------------------------------------------------- |
51 // ----------------------------------------------------------------------------- |
50 // CFSMailBox::NewL |
52 // CFSMailBox::NewL |
51 // ----------------------------------------------------------------------------- |
53 // ----------------------------------------------------------------------------- |
52 EXPORT_C CFSMailBox* CFSMailBox::NewL(TFSMailMsgId aMailBoxId) |
54 EXPORT_C CFSMailBox* CFSMailBox::NewL(TFSMailMsgId aMailBoxId) |
53 { |
55 { |
54 FUNC_LOG; |
56 NM_FUNCTION; |
55 CFSMailBox* api = CFSMailBox::NewLC(aMailBoxId); |
57 |
56 CleanupStack:: Pop(api); |
58 CFSMailBox* api = CFSMailBox::NewLC(aMailBoxId); |
57 return api; |
59 CleanupStack:: Pop(api); |
|
60 return api; |
58 } |
61 } |
59 |
62 |
60 // ----------------------------------------------------------------------------- |
63 // ----------------------------------------------------------------------------- |
61 // CFSMailBox::CFSMailBox |
64 // CFSMailBox::CFSMailBox |
62 // ----------------------------------------------------------------------------- |
65 // ----------------------------------------------------------------------------- |
63 CFSMailBox::CFSMailBox() |
66 CFSMailBox::CFSMailBox() |
64 { |
67 { |
65 FUNC_LOG; |
68 NM_FUNCTION; |
|
69 |
66 // get requesthandler pointer |
70 // get requesthandler pointer |
67 iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls()); |
71 iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls()); |
68 } |
72 } |
69 |
73 |
70 // ----------------------------------------------------------------------------- |
74 // ----------------------------------------------------------------------------- |
71 // CFSMailBox::~CFSMailBox |
75 // CFSMailBox::~CFSMailBox |
72 // ----------------------------------------------------------------------------- |
76 // ----------------------------------------------------------------------------- |
73 EXPORT_C CFSMailBox::~CFSMailBox() |
77 EXPORT_C CFSMailBox::~CFSMailBox() |
74 { |
78 { |
75 FUNC_LOG; |
79 NM_FUNCTION; |
|
80 |
76 iFolders.ResetAndDestroy(); |
81 iFolders.ResetAndDestroy(); |
77 } |
82 } |
78 |
83 |
79 // ----------------------------------------------------------------------------- |
84 // ----------------------------------------------------------------------------- |
80 // CFSMailBox::ConstructL |
85 // CFSMailBox::ConstructL |
81 // ----------------------------------------------------------------------------- |
86 // ----------------------------------------------------------------------------- |
82 void CFSMailBox::ConstructL(TFSMailMsgId aMailBoxId) |
87 void CFSMailBox::ConstructL(TFSMailMsgId aMailBoxId) |
83 { |
88 { |
84 FUNC_LOG; |
89 NM_FUNCTION; |
|
90 |
85 // <qmail> |
91 // <qmail> |
86 CFSMailBoxBase::ConstructL(aMailBoxId); |
92 CFSMailBoxBase::ConstructL(aMailBoxId); |
87 // </qmail> |
93 // </qmail> |
88 } |
94 } |
89 |
95 |
90 // ----------------------------------------------------------------------------- |
96 // ----------------------------------------------------------------------------- |
91 // CFSMailBox::GoOnlineL |
97 // CFSMailBox::GoOnlineL |
92 // ----------------------------------------------------------------------------- |
98 // ----------------------------------------------------------------------------- |
93 EXPORT_C void CFSMailBox::GoOnlineL() |
99 EXPORT_C void CFSMailBox::GoOnlineL() |
94 { |
100 { |
95 FUNC_LOG; |
101 NM_FUNCTION; |
96 |
102 |
97 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
103 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
98 { |
104 { |
99 plugin->GoOnlineL( GetId() ); |
105 plugin->GoOnlineL( GetId() ); |
100 } |
106 } |
130 // ----------------------------------------------------------------------------- |
136 // ----------------------------------------------------------------------------- |
131 // CFSMailBox::GetLastSyncStatusL |
137 // CFSMailBox::GetLastSyncStatusL |
132 // ----------------------------------------------------------------------------- |
138 // ----------------------------------------------------------------------------- |
133 EXPORT_C TFSProgress CFSMailBox::GetLastSyncStatusL() |
139 EXPORT_C TFSProgress CFSMailBox::GetLastSyncStatusL() |
134 { |
140 { |
135 FUNC_LOG; |
141 NM_FUNCTION; |
|
142 |
136 TFSProgress progress; |
143 TFSProgress progress; |
137 progress.iError = EFalse; |
144 progress.iError = EFalse; |
138 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
145 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
139 { |
146 { |
140 progress = plugin->GetLastSyncStatusL( GetId() ); |
147 progress = plugin->GetLastSyncStatusL( GetId() ); |
146 // CFSMailBox::RefreshNowL |
153 // CFSMailBox::RefreshNowL |
147 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
148 EXPORT_C TInt CFSMailBox::RefreshNowL( |
155 EXPORT_C TInt CFSMailBox::RefreshNowL( |
149 MFSMailRequestObserver& aOperationObserver ) |
156 MFSMailRequestObserver& aOperationObserver ) |
150 { |
157 { |
151 FUNC_LOG; |
158 NM_FUNCTION; |
152 |
159 |
153 TFSPendingRequest request; |
160 TFSPendingRequest request; |
154 request.iRequestId = 0; |
161 request.iRequestId = 0; |
155 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
162 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
156 { |
163 { |
157 // init asynchronous request |
164 // init asynchronous request |
164 iRequestHandler->CompleteRequest(request.iRequestId); |
171 iRequestHandler->CompleteRequest(request.iRequestId); |
165 User::Leave(err); |
172 User::Leave(err); |
166 } |
173 } |
167 } |
174 } |
168 return request.iRequestId; |
175 return request.iRequestId; |
169 |
176 } |
170 } |
|
171 |
177 |
172 // ----------------------------------------------------------------------------- |
178 // ----------------------------------------------------------------------------- |
173 // CFSMailBox::RefreshNowL |
179 // CFSMailBox::RefreshNowL |
174 // ----------------------------------------------------------------------------- |
180 // ----------------------------------------------------------------------------- |
175 EXPORT_C TInt CFSMailBox::RefreshNowL( ) |
181 EXPORT_C TInt CFSMailBox::RefreshNowL( ) |
176 { |
182 { |
177 FUNC_LOG; |
183 NM_FUNCTION; |
178 |
184 |
179 TFSPendingRequest request; |
185 TFSPendingRequest request; |
180 request.iRequestId = 0; |
186 request.iRequestId = 0; |
181 MFSMailRequestObserver* observer = NULL; |
187 MFSMailRequestObserver* observer = NULL; |
182 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
188 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
183 { |
189 { |
191 iRequestHandler->CompleteRequest(request.iRequestId); |
197 iRequestHandler->CompleteRequest(request.iRequestId); |
192 User::Leave(err); |
198 User::Leave(err); |
193 } |
199 } |
194 } |
200 } |
195 return request.iRequestId; |
201 return request.iRequestId; |
196 |
202 } |
197 } |
|
198 |
203 |
199 // ----------------------------------------------------------------------------- |
204 // ----------------------------------------------------------------------------- |
200 // CFSMailBox::CreateMessageToSend |
205 // CFSMailBox::CreateMessageToSend |
201 // ----------------------------------------------------------------------------- |
206 // ----------------------------------------------------------------------------- |
202 EXPORT_C CFSMailMessage* CFSMailBox::CreateMessageToSend( ) |
207 EXPORT_C CFSMailMessage* CFSMailBox::CreateMessageToSend( ) |
203 { |
208 { |
204 FUNC_LOG; |
209 NM_FUNCTION; |
205 |
210 |
206 CFSMailMessage* message = NULL; |
211 CFSMailMessage* message = NULL; |
207 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
212 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
208 { |
213 { |
209 TRAPD(err,message = plugin->CreateMessageToSendL( GetId() )); |
214 TRAPD(err,message = plugin->CreateMessageToSendL( GetId() )); |
210 if(err != KErrNone) |
215 if(err != KErrNone) |
256 EXPORT_C int CFSMailBox::UpdateMessageFlagsL( |
263 EXPORT_C int CFSMailBox::UpdateMessageFlagsL( |
257 const TFSMailMsgId aMailboxId, |
264 const TFSMailMsgId aMailboxId, |
258 RPointerArray<CFSMailMessage> &messages, |
265 RPointerArray<CFSMailMessage> &messages, |
259 MFSMailRequestObserver& aOperationObserver) |
266 MFSMailRequestObserver& aOperationObserver) |
260 { |
267 { |
|
268 NM_FUNCTION; |
|
269 |
261 Q_UNUSED(aMailboxId); |
270 Q_UNUSED(aMailboxId); |
262 TFSPendingRequest request; |
271 TFSPendingRequest request; |
263 |
272 |
264 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
273 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
265 |
274 |
296 // CFSMailBox::CreateForwardMessage |
305 // CFSMailBox::CreateForwardMessage |
297 // ----------------------------------------------------------------------------- |
306 // ----------------------------------------------------------------------------- |
298 EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage( TFSMailMsgId aOriginalMessageId, |
307 EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage( TFSMailMsgId aOriginalMessageId, |
299 const TDesC& aHeaderDescriptor ) |
308 const TDesC& aHeaderDescriptor ) |
300 { |
309 { |
301 FUNC_LOG; |
310 NM_FUNCTION; |
|
311 |
302 CFSMailMessage* message = NULL; |
312 CFSMailMessage* message = NULL; |
303 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
313 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
304 { |
314 { |
305 TRAPD(err,message = plugin->CreateForwardMessageL( GetId(), |
315 TRAPD(err,message = plugin->CreateForwardMessageL( GetId(), |
306 aOriginalMessageId, |
316 aOriginalMessageId, |
319 // ----------------------------------------------------------------------------- |
329 // ----------------------------------------------------------------------------- |
320 EXPORT_C TInt CFSMailBox::CreateForwardMessageL( const TFSMailMsgId aOriginalMessageId, |
330 EXPORT_C TInt CFSMailBox::CreateForwardMessageL( const TFSMailMsgId aOriginalMessageId, |
321 MFSMailRequestObserver& aOperationObserver, |
331 MFSMailRequestObserver& aOperationObserver, |
322 const TDesC& aHeaderDescriptor ) |
332 const TDesC& aHeaderDescriptor ) |
323 { |
333 { |
|
334 NM_FUNCTION; |
|
335 |
324 TFSPendingRequest request; |
336 TFSPendingRequest request; |
325 |
337 |
326 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
338 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
327 |
339 |
328 if ( plugin ) |
340 if ( plugin ) |
356 // ----------------------------------------------------------------------------- |
368 // ----------------------------------------------------------------------------- |
357 EXPORT_C CFSMailMessage* CFSMailBox::CreateReplyMessage( TFSMailMsgId aOriginalMessageId, |
369 EXPORT_C CFSMailMessage* CFSMailBox::CreateReplyMessage( TFSMailMsgId aOriginalMessageId, |
358 TBool aReplyToAll, |
370 TBool aReplyToAll, |
359 const TDesC& aHeaderDescriptor ) |
371 const TDesC& aHeaderDescriptor ) |
360 { |
372 { |
361 FUNC_LOG; |
373 NM_FUNCTION; |
|
374 |
362 CFSMailMessage* message = NULL; |
375 CFSMailMessage* message = NULL; |
363 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
376 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
364 { |
377 { |
365 TRAPD(err,message = plugin->CreateReplyMessageL( GetId(), |
378 TRAPD(err,message = plugin->CreateReplyMessageL( GetId(), |
366 aOriginalMessageId, |
379 aOriginalMessageId, |
381 EXPORT_C TInt CFSMailBox::CreateReplyMessageL( const TFSMailMsgId aOriginalMessageId, |
394 EXPORT_C TInt CFSMailBox::CreateReplyMessageL( const TFSMailMsgId aOriginalMessageId, |
382 const TBool aReplyToAll, |
395 const TBool aReplyToAll, |
383 MFSMailRequestObserver& aOperationObserver, |
396 MFSMailRequestObserver& aOperationObserver, |
384 const TDesC& aHeaderDescriptor ) |
397 const TDesC& aHeaderDescriptor ) |
385 { |
398 { |
|
399 NM_FUNCTION; |
|
400 |
386 TFSPendingRequest request; |
401 TFSPendingRequest request; |
387 |
402 |
388 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
403 CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ); |
389 |
404 |
390 if ( plugin ) |
405 if ( plugin ) |
416 // ----------------------------------------------------------------------------- |
431 // ----------------------------------------------------------------------------- |
417 // CFSMailBox::GetStandardFolderId |
432 // CFSMailBox::GetStandardFolderId |
418 // ----------------------------------------------------------------------------- |
433 // ----------------------------------------------------------------------------- |
419 EXPORT_C TFSMailMsgId CFSMailBox::GetStandardFolderId(TFSFolderType aFolderType) |
434 EXPORT_C TFSMailMsgId CFSMailBox::GetStandardFolderId(TFSFolderType aFolderType) |
420 { |
435 { |
421 FUNC_LOG; |
436 NM_FUNCTION; |
422 |
437 |
423 TFSMailMsgId folderId; |
438 TFSMailMsgId folderId; |
424 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
439 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
425 { |
440 { |
426 TRAPD(err, folderId = plugin->GetStandardFolderIdL(GetId(), aFolderType )); |
441 TRAPD(err, folderId = plugin->GetStandardFolderIdL(GetId(), aFolderType )); |
427 if(err != KErrNone) |
442 if(err != KErrNone) |
435 // ----------------------------------------------------------------------------- |
450 // ----------------------------------------------------------------------------- |
436 // CFSMailBox::SendMessageL |
451 // CFSMailBox::SendMessageL |
437 // ----------------------------------------------------------------------------- |
452 // ----------------------------------------------------------------------------- |
438 EXPORT_C void CFSMailBox::SendMessageL( CFSMailMessage& aMessage ) |
453 EXPORT_C void CFSMailBox::SendMessageL( CFSMailMessage& aMessage ) |
439 { |
454 { |
440 FUNC_LOG; |
455 NM_FUNCTION; |
|
456 |
441 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
457 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
442 { |
458 { |
443 // <qmail> Not activated yet. |
459 // <qmail> Not activated yet. |
444 //UpdateMrusL( aMessage.GetToRecipients(), |
460 //UpdateMrusL( aMessage.GetToRecipients(), |
445 // aMessage.GetCCRecipients(), |
461 // aMessage.GetCCRecipients(), |
499 // CFSMailBox::ListFolders |
515 // CFSMailBox::ListFolders |
500 // ----------------------------------------------------------------------------- |
516 // ----------------------------------------------------------------------------- |
501 EXPORT_C void CFSMailBox::ListFolders( TFSMailMsgId aFolder, |
517 EXPORT_C void CFSMailBox::ListFolders( TFSMailMsgId aFolder, |
502 RPointerArray<CFSMailFolder>& aFolderList) |
518 RPointerArray<CFSMailFolder>& aFolderList) |
503 { |
519 { |
504 FUNC_LOG; |
520 NM_FUNCTION; |
505 |
521 |
506 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
522 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
507 { |
523 { |
508 TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList)); |
524 TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList)); |
509 if(err != KErrNone) |
525 if(err != KErrNone) |
510 { |
526 { |
516 // ----------------------------------------------------------------------------- |
532 // ----------------------------------------------------------------------------- |
517 // CFSMailBox::ListFolders |
533 // CFSMailBox::ListFolders |
518 // ----------------------------------------------------------------------------- |
534 // ----------------------------------------------------------------------------- |
519 EXPORT_C RPointerArray<CFSMailFolder>& CFSMailBox::ListFolders( ) |
535 EXPORT_C RPointerArray<CFSMailFolder>& CFSMailBox::ListFolders( ) |
520 { |
536 { |
|
537 NM_FUNCTION; |
|
538 |
521 iFolders.ResetAndDestroy(); |
539 iFolders.ResetAndDestroy(); |
522 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
540 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
523 { |
541 { |
524 TRAPD(err,plugin->ListFoldersL(GetId(),iFolders)); |
542 TRAPD(err,plugin->ListFoldersL(GetId(),iFolders)); |
525 if(err != KErrNone) |
543 if(err != KErrNone) |
534 // ----------------------------------------------------------------------------- |
552 // ----------------------------------------------------------------------------- |
535 // CFSMailBox::GetBrandingIdL |
553 // CFSMailBox::GetBrandingIdL |
536 // ----------------------------------------------------------------------------- |
554 // ----------------------------------------------------------------------------- |
537 EXPORT_C TDesC& CFSMailBox::GetBrandingIdL( ) |
555 EXPORT_C TDesC& CFSMailBox::GetBrandingIdL( ) |
538 { |
556 { |
539 FUNC_LOG; |
557 NM_FUNCTION; |
|
558 |
540 return BrandingId(); |
559 return BrandingId(); |
541 } |
560 } |
542 |
561 |
543 // ----------------------------------------------------------------------------- |
562 // ----------------------------------------------------------------------------- |
544 // CFSMailBox::MoveMessagesL |
563 // CFSMailBox::MoveMessagesL |
545 // ----------------------------------------------------------------------------- |
564 // ----------------------------------------------------------------------------- |
546 EXPORT_C void CFSMailBox::MoveMessagesL( const RArray<TFSMailMsgId>& aMessageIds, |
565 EXPORT_C void CFSMailBox::MoveMessagesL( const RArray<TFSMailMsgId>& aMessageIds, |
547 const TFSMailMsgId aSourceFolderId, |
566 const TFSMailMsgId aSourceFolderId, |
548 const TFSMailMsgId aDestinationFolderId ) |
567 const TFSMailMsgId aDestinationFolderId ) |
549 { |
568 { |
550 FUNC_LOG; |
569 NM_FUNCTION; |
|
570 |
551 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
571 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
552 { |
572 { |
553 plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId); |
573 plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId); |
554 } |
574 } |
555 } |
575 } |
560 EXPORT_C TInt CFSMailBox::MoveMessagesL( MFSMailRequestObserver& aOperationObserver, |
580 EXPORT_C TInt CFSMailBox::MoveMessagesL( MFSMailRequestObserver& aOperationObserver, |
561 const RArray<TFSMailMsgId>& aMessageIds, |
581 const RArray<TFSMailMsgId>& aMessageIds, |
562 const TFSMailMsgId aSourceFolderId, |
582 const TFSMailMsgId aSourceFolderId, |
563 const TFSMailMsgId aDestinationFolderId ) |
583 const TFSMailMsgId aDestinationFolderId ) |
564 { |
584 { |
565 FUNC_LOG; |
585 NM_FUNCTION; |
|
586 |
566 TFSPendingRequest request; |
587 TFSPendingRequest request; |
567 if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
588 if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
568 { |
589 { |
569 // init asynchronous request |
590 // init asynchronous request |
570 request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), |
591 request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), |
586 EXPORT_C void CFSMailBox::CopyMessagesL( const RArray<TFSMailMsgId>& aMessageIds, |
607 EXPORT_C void CFSMailBox::CopyMessagesL( const RArray<TFSMailMsgId>& aMessageIds, |
587 RArray<TFSMailMsgId>& aNewMessages, |
608 RArray<TFSMailMsgId>& aNewMessages, |
588 const TFSMailMsgId aSourceFolderId, |
609 const TFSMailMsgId aSourceFolderId, |
589 const TFSMailMsgId aDestinationFolderId ) |
610 const TFSMailMsgId aDestinationFolderId ) |
590 { |
611 { |
591 FUNC_LOG; |
612 NM_FUNCTION; |
|
613 |
592 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
614 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
593 { |
615 { |
594 plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages, |
616 plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages, |
595 aSourceFolderId, aDestinationFolderId ); |
617 aSourceFolderId, aDestinationFolderId ); |
596 } |
618 } |
602 EXPORT_C void CFSMailBox::SearchL( const RPointerArray<TDesC>& /*aSearchStrings*/, |
624 EXPORT_C void CFSMailBox::SearchL( const RPointerArray<TDesC>& /*aSearchStrings*/, |
603 const TFSMailSortCriteria& /*aSortCriteria*/, |
625 const TFSMailSortCriteria& /*aSortCriteria*/, |
604 MFSMailBoxSearchObserver& /*aSearchObserver*/, |
626 MFSMailBoxSearchObserver& /*aSearchObserver*/, |
605 const RArray<TFSMailMsgId> /*aFolderIds */ ) |
627 const RArray<TFSMailMsgId> /*aFolderIds */ ) |
606 { |
628 { |
607 FUNC_LOG; |
629 NM_FUNCTION; |
608 |
|
609 } |
630 } |
610 |
631 |
611 // ----------------------------------------------------------------------------- |
632 // ----------------------------------------------------------------------------- |
612 // CFSMailBox::SearchL |
633 // CFSMailBox::SearchL |
613 // ----------------------------------------------------------------------------- |
634 // ----------------------------------------------------------------------------- |
614 EXPORT_C void CFSMailBox::SearchL( const RPointerArray<TDesC>& aSearchStrings, |
635 EXPORT_C void CFSMailBox::SearchL( const RPointerArray<TDesC>& aSearchStrings, |
615 const TFSMailSortCriteria& aSortCriteria, |
636 const TFSMailSortCriteria& aSortCriteria, |
616 MFSMailBoxSearchObserver& aSearchObserver ) |
637 MFSMailBoxSearchObserver& aSearchObserver ) |
617 { |
638 { |
618 FUNC_LOG; |
639 NM_FUNCTION; |
|
640 |
619 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
641 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
620 { |
642 { |
621 |
643 |
622 // get mailbox folder list |
644 // get mailbox folder list |
623 iFolders.ResetAndDestroy(); |
645 iFolders.ResetAndDestroy(); |
671 // ----------------------------------------------------------------------------- |
695 // ----------------------------------------------------------------------------- |
672 // CFSMailBox::ListMrusL |
696 // CFSMailBox::ListMrusL |
673 // ----------------------------------------------------------------------------- |
697 // ----------------------------------------------------------------------------- |
674 EXPORT_C MDesCArray* CFSMailBox::ListMrusL() const |
698 EXPORT_C MDesCArray* CFSMailBox::ListMrusL() const |
675 { |
699 { |
676 FUNC_LOG; |
700 NM_FUNCTION; |
|
701 |
677 MDesCArray* mruList(0); |
702 MDesCArray* mruList(0); |
678 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) |
703 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) |
679 { |
704 { |
680 mruList = plugin->GetMrusL( GetId() ); |
705 mruList = plugin->GetMrusL( GetId() ); |
681 } |
706 } |
686 // ----------------------------------------------------------------------------- |
711 // ----------------------------------------------------------------------------- |
687 // CFSMailBox::CurrentSyncState |
712 // CFSMailBox::CurrentSyncState |
688 // ----------------------------------------------------------------------------- |
713 // ----------------------------------------------------------------------------- |
689 EXPORT_C TSSMailSyncState CFSMailBox::CurrentSyncState() const |
714 EXPORT_C TSSMailSyncState CFSMailBox::CurrentSyncState() const |
690 { |
715 { |
691 FUNC_LOG; |
716 NM_FUNCTION; |
|
717 |
692 TSSMailSyncState syncState(Idle); |
718 TSSMailSyncState syncState(Idle); |
693 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
719 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
694 { |
720 { |
695 syncState = plugin->CurrentSyncState( GetId() ); |
721 syncState = plugin->CurrentSyncState( GetId() ); |
696 } |
722 } |
700 // ----------------------------------------------------------------------------- |
726 // ----------------------------------------------------------------------------- |
701 // CFSMailBox::HasCapability |
727 // CFSMailBox::HasCapability |
702 // ----------------------------------------------------------------------------- |
728 // ----------------------------------------------------------------------------- |
703 EXPORT_C TBool CFSMailBox::HasCapability( const TFSMailBoxCapabilities aCapability ) const |
729 EXPORT_C TBool CFSMailBox::HasCapability( const TFSMailBoxCapabilities aCapability ) const |
704 { |
730 { |
705 FUNC_LOG; |
731 NM_FUNCTION; |
|
732 |
706 TBool capability = EFalse; |
733 TBool capability = EFalse; |
707 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
734 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
708 { |
735 { |
709 TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ; |
736 TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ; |
710 if ( err != KErrNone ) |
737 if ( err != KErrNone ) |
718 // ----------------------------------------------------------------------------- |
745 // ----------------------------------------------------------------------------- |
719 // CFSMailBox::GetMailBoxStatus |
746 // CFSMailBox::GetMailBoxStatus |
720 // ----------------------------------------------------------------------------- |
747 // ----------------------------------------------------------------------------- |
721 EXPORT_C TFSMailBoxStatus CFSMailBox::GetMailBoxStatus() |
748 EXPORT_C TFSMailBoxStatus CFSMailBox::GetMailBoxStatus() |
722 { |
749 { |
723 FUNC_LOG; |
750 NM_FUNCTION; |
|
751 |
724 TFSMailBoxStatus status(EFSMailBoxOffline); |
752 TFSMailBoxStatus status(EFSMailBoxOffline); |
725 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) |
753 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) |
726 { |
754 { |
727 status = plugin->GetMailBoxStatus( GetId() ); |
755 status = plugin->GetMailBoxStatus( GetId() ); |
728 } |
756 } |
732 // ----------------------------------------------------------------------------- |
760 // ----------------------------------------------------------------------------- |
733 // CFSMailBox::SetCredentialsL |
761 // CFSMailBox::SetCredentialsL |
734 // ----------------------------------------------------------------------------- |
762 // ----------------------------------------------------------------------------- |
735 EXPORT_C void CFSMailBox::SetCredentialsL( const TDesC& aUsername, const TDesC& aPassword ) |
763 EXPORT_C void CFSMailBox::SetCredentialsL( const TDesC& aUsername, const TDesC& aPassword ) |
736 { |
764 { |
737 FUNC_LOG; |
765 NM_FUNCTION; |
|
766 |
738 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) |
767 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) |
739 { |
768 { |
740 plugin->SetCredentialsL( GetId(), aUsername, aPassword ); |
769 plugin->SetCredentialsL( GetId(), aUsername, aPassword ); |
741 } |
770 } |
742 } |
771 } |
765 // ----------------------------------------------------------------------------- |
794 // ----------------------------------------------------------------------------- |
766 // CFSMailBox::GetConnectionId |
795 // CFSMailBox::GetConnectionId |
767 // ----------------------------------------------------------------------------- |
796 // ----------------------------------------------------------------------------- |
768 EXPORT_C TInt CFSMailBox::GetConnectionId( TUint32& aConnectionId ) |
797 EXPORT_C TInt CFSMailBox::GetConnectionId( TUint32& aConnectionId ) |
769 { |
798 { |
770 FUNC_LOG; |
799 NM_FUNCTION; |
|
800 |
771 TInt rcode = KErrNotSupported; |
801 TInt rcode = KErrNotSupported; |
772 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
802 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
773 { |
803 { |
774 rcode = plugin->GetConnectionId( GetId(), aConnectionId ); |
804 rcode = plugin->GetConnectionId( GetId(), aConnectionId ); |
775 } |
805 } |
779 // ----------------------------------------------------------------------------- |
809 // ----------------------------------------------------------------------------- |
780 // CFSMailBox::IsConnectionAllowedWhenRoaming |
810 // CFSMailBox::IsConnectionAllowedWhenRoaming |
781 // ----------------------------------------------------------------------------- |
811 // ----------------------------------------------------------------------------- |
782 EXPORT_C TInt CFSMailBox::IsConnectionAllowedWhenRoaming( TBool& aConnectionAllowed ) |
812 EXPORT_C TInt CFSMailBox::IsConnectionAllowedWhenRoaming( TBool& aConnectionAllowed ) |
783 { |
813 { |
784 FUNC_LOG; |
814 NM_FUNCTION; |
|
815 |
785 TInt rcode = KErrNotSupported; |
816 TInt rcode = KErrNotSupported; |
786 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
817 if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) |
787 { |
818 { |
788 rcode = plugin->IsConnectionAllowedWhenRoaming( GetId(), aConnectionAllowed ); |
819 rcode = plugin->IsConnectionAllowedWhenRoaming( GetId(), aConnectionAllowed ); |
789 } |
820 } |
793 // ----------------------------------------------------------------------------- |
824 // ----------------------------------------------------------------------------- |
794 // CFSMailBox::CreateMessageFromFileL |
825 // CFSMailBox::CreateMessageFromFileL |
795 // ----------------------------------------------------------------------------- |
826 // ----------------------------------------------------------------------------- |
796 EXPORT_C CFSMailMessage* CFSMailBox::CreateMessageFromFileL( const RFile& aFile ) |
827 EXPORT_C CFSMailMessage* CFSMailBox::CreateMessageFromFileL( const RFile& aFile ) |
797 { |
828 { |
798 FUNC_LOG; |
829 NM_FUNCTION; |
|
830 |
799 CFSMailMessage* message = NULL; |
831 CFSMailMessage* message = NULL; |
800 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
832 if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) |
801 { |
833 { |
802 message = plugin->CreateMessageFromFileL( GetId(), aFile ); |
834 message = plugin->CreateMessageFromFileL( GetId(), aFile ); |
803 } |
835 } |
810 void CFSMailBox::UpdateMrusL( |
842 void CFSMailBox::UpdateMrusL( |
811 const RPointerArray<CFSMailAddress>& aRecipients, |
843 const RPointerArray<CFSMailAddress>& aRecipients, |
812 const RPointerArray<CFSMailAddress>& aCCRecipients, |
844 const RPointerArray<CFSMailAddress>& aCCRecipients, |
813 const RPointerArray<CFSMailAddress>& aBCCRecipients ) const |
845 const RPointerArray<CFSMailAddress>& aBCCRecipients ) const |
814 { |
846 { |
815 FUNC_LOG; |
847 NM_FUNCTION; |
816 |
848 |
817 // First lets make a copy of the current mru list |
849 // First lets make a copy of the current mru list |
818 // whose content we can later alter as we wish |
850 // whose content we can later alter as we wish |
819 MDesCArray* currentMruList( NULL ); |
851 MDesCArray* currentMruList( NULL ); |
820 |
852 |
865 // ----------------------------------------------------------------------------- |
897 // ----------------------------------------------------------------------------- |
866 // CFSMailBox::CopyArrayL |
898 // CFSMailBox::CopyArrayL |
867 // ----------------------------------------------------------------------------- |
899 // ----------------------------------------------------------------------------- |
868 CDesCArraySeg* CFSMailBox::CopyArrayL( MDesCArray& aArrayToBeCopied ) const |
900 CDesCArraySeg* CFSMailBox::CopyArrayL( MDesCArray& aArrayToBeCopied ) const |
869 { |
901 { |
870 FUNC_LOG; |
902 NM_FUNCTION; |
|
903 |
871 CDesCArraySeg* newArray = new (ELeave) CDesCArraySeg( 10 ); |
904 CDesCArraySeg* newArray = new (ELeave) CDesCArraySeg( 10 ); |
872 CleanupStack::PushL( newArray ); |
905 CleanupStack::PushL( newArray ); |
873 |
906 |
874 TInt itemCount( aArrayToBeCopied.MdcaCount() ); |
907 TInt itemCount( aArrayToBeCopied.MdcaCount() ); |
875 TInt index( 0 ); |
908 TInt index( 0 ); |
888 // ----------------------------------------------------------------------------- |
921 // ----------------------------------------------------------------------------- |
889 void CFSMailBox::UpdateMruListL( |
922 void CFSMailBox::UpdateMruListL( |
890 CDesCArraySeg& aMruList, |
923 CDesCArraySeg& aMruList, |
891 const RPointerArray<CFSMailAddress>& aNewRecentlyUsedOnes ) const |
924 const RPointerArray<CFSMailAddress>& aNewRecentlyUsedOnes ) const |
892 { |
925 { |
893 FUNC_LOG; |
926 NM_FUNCTION; |
|
927 |
894 TUint newCount( aNewRecentlyUsedOnes.Count() ); |
928 TUint newCount( aNewRecentlyUsedOnes.Count() ); |
895 TUint newIndexer( 0 ); |
929 TUint newIndexer( 0 ); |
896 |
930 |
897 while ( newIndexer < newCount ) |
931 while ( newIndexer < newCount ) |
898 { |
932 { |
929 // ----------------------------------------------------------------------------- |
963 // ----------------------------------------------------------------------------- |
930 TInt CFSMailBox::FindAddressFromMruList( CDesCArraySeg& aMruList, |
964 TInt CFSMailBox::FindAddressFromMruList( CDesCArraySeg& aMruList, |
931 TDesC& searchedAddress, |
965 TDesC& searchedAddress, |
932 TInt& aPos ) const |
966 TInt& aPos ) const |
933 { |
967 { |
934 FUNC_LOG; |
968 NM_FUNCTION; |
|
969 |
935 // CDesCArray::Find() is not used here because there is |
970 // CDesCArray::Find() is not used here because there is |
936 // possibility that we have to go through the whole array |
971 // possibility that we have to go through the whole array |
937 // and return the index for one specific match. Find() returns |
972 // and return the index for one specific match. Find() returns |
938 // only the index of the first match and searching for the rest |
973 // only the index of the first match and searching for the rest |
939 // using Find() would cause undesired complexity. |
974 // using Find() would cause undesired complexity. |
969 // CFSMailBox::AddAndRemoveExcessMruL |
1004 // CFSMailBox::AddAndRemoveExcessMruL |
970 // ----------------------------------------------------------------------------- |
1005 // ----------------------------------------------------------------------------- |
971 void CFSMailBox::AddAndRemoveExcessMruL( CDesCArraySeg& aMruList, |
1006 void CFSMailBox::AddAndRemoveExcessMruL( CDesCArraySeg& aMruList, |
972 CFSMailAddress& aToBeAdded ) const |
1007 CFSMailAddress& aToBeAdded ) const |
973 { |
1008 { |
974 FUNC_LOG; |
1009 NM_FUNCTION; |
|
1010 |
975 if ( aMruList.Count() == KMaxMruEntries ) |
1011 if ( aMruList.Count() == KMaxMruEntries ) |
976 { |
1012 { |
977 // Remove the oldest entry pair from the beginning |
1013 // Remove the oldest entry pair from the beginning |
978 aMruList.Delete( 0, 2 ); |
1014 aMruList.Delete( 0, 2 ); |
979 } |
1015 } |
986 // ----------------------------------------------------------------------------- |
1022 // ----------------------------------------------------------------------------- |
987 void CFSMailBox::SetAsMostRecentMruL( CDesCArraySeg& aMruList, |
1023 void CFSMailBox::SetAsMostRecentMruL( CDesCArraySeg& aMruList, |
988 TInt aPosition, |
1024 TInt aPosition, |
989 CFSMailAddress& aMostRecent ) const |
1025 CFSMailAddress& aMostRecent ) const |
990 { |
1026 { |
991 FUNC_LOG; |
1027 NM_FUNCTION; |
|
1028 |
992 // Position of the address is given so the possible display name is |
1029 // Position of the address is given so the possible display name is |
993 // in the previous slot. Delete both. |
1030 // in the previous slot. Delete both. |
994 aMruList.Delete( aPosition - 1, 2 ); |
1031 aMruList.Delete( aPosition - 1, 2 ); |
995 // Latest address is always found from the end. |
1032 // Latest address is always found from the end. |
996 AppendMruItemL( aMruList, aMostRecent ); |
1033 AppendMruItemL( aMruList, aMostRecent ); |
1000 // CFSMailBox::AppendMruItemL |
1037 // CFSMailBox::AppendMruItemL |
1001 // ----------------------------------------------------------------------------- |
1038 // ----------------------------------------------------------------------------- |
1002 void CFSMailBox::AppendMruItemL( CDesCArraySeg& aMruList, |
1039 void CFSMailBox::AppendMruItemL( CDesCArraySeg& aMruList, |
1003 CFSMailAddress& aToBeAppended ) const |
1040 CFSMailAddress& aToBeAppended ) const |
1004 { |
1041 { |
1005 FUNC_LOG; |
1042 NM_FUNCTION; |
|
1043 |
1006 // In the array, display name is always the first and then comes |
1044 // In the array, display name is always the first and then comes |
1007 // the actual address. |
1045 // the actual address. |
1008 |
1046 |
1009 // <cmail> avoid setting email address as display name so it won't |
1047 // <cmail> avoid setting email address as display name so it won't |
1010 // be displayed twice in the list |
1048 // be displayed twice in the list |
1026 // ----------------------------------------------------------------------------- |
1064 // ----------------------------------------------------------------------------- |
1027 // CFSMailBox::ReleaseExtension |
1065 // CFSMailBox::ReleaseExtension |
1028 // ----------------------------------------------------------------------------- |
1066 // ----------------------------------------------------------------------------- |
1029 EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension ) |
1067 EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension ) |
1030 { |
1068 { |
1031 FUNC_LOG; |
1069 NM_FUNCTION; |
|
1070 |
1032 // no specialized behaviour, call base class |
1071 // no specialized behaviour, call base class |
1033 CExtendableEmail::ReleaseExtension( aExtension ); |
1072 CExtendableEmail::ReleaseExtension( aExtension ); |
1034 } |
1073 } |
1035 |
1074 |
1036 // ----------------------------------------------------------------------------- |
1075 // ----------------------------------------------------------------------------- |
1037 // CFSMailBox::ExtensionL |
1076 // CFSMailBox::ExtensionL |
1038 // ----------------------------------------------------------------------------- |
1077 // ----------------------------------------------------------------------------- |
1039 EXPORT_C CEmailExtension* CFSMailBox::ExtensionL( const TUid& aInterfaceUid ) |
1078 EXPORT_C CEmailExtension* CFSMailBox::ExtensionL( const TUid& aInterfaceUid ) |
1040 { |
1079 { |
1041 FUNC_LOG; |
1080 NM_FUNCTION; |
|
1081 |
1042 CEmailExtension* extension = NULL; |
1082 CEmailExtension* extension = NULL; |
|
1083 // <qmail> |
|
1084 extension = CExtendableEmail::ExtensionL( aInterfaceUid ); |
1043 if ( aInterfaceUid == KMailboxExtMrCalInfo ) |
1085 if ( aInterfaceUid == KMailboxExtMrCalInfo ) |
1044 { |
1086 { |
1045 extension = CExtendableEmail::ExtensionL( aInterfaceUid ); |
1087 // </qmail> |
1046 if ( extension == NULL ) |
1088 if ( extension == NULL ) |
1047 { |
1089 { |
1048 extension = new ( ELeave ) CMRCalendarInfoImpl(); |
1090 extension = new ( ELeave ) CMRCalendarInfoImpl(); |
1049 CleanupStack::PushL( extension ); |
1091 CleanupStack::PushL( extension ); |
1050 iExtensions.AddL( extension ); |
1092 iExtensions.AddL( extension ); |