13 * |
13 * |
14 * Description: email framework user interface |
14 * Description: email framework user interface |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
|
19 #include "emailtrace.h" |
18 #include "emailtrace.h" |
20 #include "cfsmailclient.h" |
19 |
21 #include "cfsfwimplementation.h" |
20 //<qmail> |
22 #include "cfsmailpluginmanager.h" |
21 #include <nmcommonheaders.h> |
23 #include "cfsmailrequestobserver.h" |
22 //</qmail> |
24 #include "cfsmailiterator.h" |
23 |
25 #include "cfsmailbrandmanagerimpl.h" |
24 #include "CFSMailClient.h" |
|
25 #include "CFSFWImplementation.h" |
|
26 #include "CFSMailPluginManager.h" |
|
27 #include "CFSMailRequestObserver.h" |
|
28 #include "CFSMailIterator.h" |
|
29 #include "CFSMailBrandManagerImpl.h" |
26 |
30 |
27 |
31 |
28 // ================= MEMBER FUNCTIONS ========================================== |
32 // ================= MEMBER FUNCTIONS ========================================== |
29 // ----------------------------------------------------------------------------- |
33 // ----------------------------------------------------------------------------- |
30 // CFSMailClient::NewLC |
34 // CFSMailClient::NewLC |
31 // ----------------------------------------------------------------------------- |
35 // ----------------------------------------------------------------------------- |
32 EXPORT_C CFSMailClient* CFSMailClient::NewLC(TInt aConfiguration) |
36 EXPORT_C CFSMailClient* CFSMailClient::NewLC(TInt aConfiguration) |
33 { |
37 { |
34 FUNC_LOG; |
38 NM_FUNCTION; |
35 |
39 |
36 CFSMailClient* client = Instance(); |
40 CFSMailClient* client = Instance(); |
37 if( !client ) |
41 if( !client ) |
38 { |
42 { |
39 client = new (ELeave) CFSMailClient(); |
43 client = new (ELeave) CFSMailClient(); |
60 // ----------------------------------------------------------------------------- |
64 // ----------------------------------------------------------------------------- |
61 // CFSMailClient::NewL |
65 // CFSMailClient::NewL |
62 // ----------------------------------------------------------------------------- |
66 // ----------------------------------------------------------------------------- |
63 EXPORT_C CFSMailClient* CFSMailClient::NewL() |
67 EXPORT_C CFSMailClient* CFSMailClient::NewL() |
64 { |
68 { |
65 FUNC_LOG; |
69 NM_FUNCTION; |
66 CFSMailClient* client = CFSMailClient::NewLC(EFSLoadPlugins); |
70 |
67 CleanupStack:: Pop(client); |
71 CFSMailClient* client = CFSMailClient::NewLC(EFSLoadPlugins); |
68 return client; |
72 CleanupStack:: Pop(client); |
|
73 return client; |
69 } |
74 } |
70 |
75 |
71 // ----------------------------------------------------------------------------- |
76 // ----------------------------------------------------------------------------- |
72 // CFSMailClient::NewL |
77 // CFSMailClient::NewL |
73 // ----------------------------------------------------------------------------- |
78 // ----------------------------------------------------------------------------- |
74 EXPORT_C CFSMailClient* CFSMailClient::NewL(TInt aConfiguration) |
79 EXPORT_C CFSMailClient* CFSMailClient::NewL(TInt aConfiguration) |
75 { |
80 { |
76 FUNC_LOG; |
81 NM_FUNCTION; |
77 |
82 |
78 CFSMailClient* client = CFSMailClient::NewLC(aConfiguration); |
83 CFSMailClient* client = CFSMailClient::NewLC(aConfiguration); |
79 CleanupStack:: Pop(client); |
84 CleanupStack:: Pop(client); |
80 return client; |
85 return client; |
81 } |
86 } |
82 |
87 |
83 // ----------------------------------------------------------------------------- |
88 // ----------------------------------------------------------------------------- |
84 // CFSMailClient::ConstructL |
89 // CFSMailClient::ConstructL |
85 // ----------------------------------------------------------------------------- |
90 // ----------------------------------------------------------------------------- |
86 void CFSMailClient::ConstructL(TInt aConfiguration) |
91 void CFSMailClient::ConstructL(TInt aConfiguration) |
87 { |
92 { |
88 FUNC_LOG; |
93 NM_FUNCTION; |
|
94 |
89 iFWImplementation = CFSFWImplementation::NewL(aConfiguration); |
95 iFWImplementation = CFSFWImplementation::NewL(aConfiguration); |
90 } |
96 } |
91 |
97 |
92 // ----------------------------------------------------------------------------- |
98 // ----------------------------------------------------------------------------- |
93 // CFSMailClient::CFSMailClient |
99 // CFSMailClient::CFSMailClient |
94 // ----------------------------------------------------------------------------- |
100 // ----------------------------------------------------------------------------- |
95 CFSMailClient::CFSMailClient() |
101 CFSMailClient::CFSMailClient() |
96 { |
102 { |
97 FUNC_LOG; |
103 NM_FUNCTION; |
|
104 |
98 // clear pointers |
105 // clear pointers |
99 iFWImplementation = NULL; |
106 iFWImplementation = NULL; |
100 iBrandManager = NULL; |
107 iBrandManager = NULL; |
101 } |
108 } |
102 |
109 |
116 |
124 |
117 // ----------------------------------------------------------------------------- |
125 // ----------------------------------------------------------------------------- |
118 // CFSMailClient::GetMailBoxByUidL |
126 // CFSMailClient::GetMailBoxByUidL |
119 // ----------------------------------------------------------------------------- |
127 // ----------------------------------------------------------------------------- |
120 EXPORT_C CFSMailBox* CFSMailClient::GetMailBoxByUidL(const TFSMailMsgId aMailBoxId) |
128 EXPORT_C CFSMailBox* CFSMailClient::GetMailBoxByUidL(const TFSMailMsgId aMailBoxId) |
121 { |
129 { |
122 FUNC_LOG; |
130 NM_FUNCTION; |
|
131 |
123 // select plugin |
132 // select plugin |
124 CFSMailBox* mailBox = NULL; |
133 CFSMailBox* mailBox = NULL; |
125 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId); |
134 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId); |
126 if(plugin) |
135 if(plugin) |
127 { |
136 { |
128 // get mailbox from plugin |
137 // get mailbox from plugin |
129 mailBox = plugin->GetMailBoxByUidL(aMailBoxId); |
138 mailBox = plugin->GetMailBoxByUidL(aMailBoxId); |
130 } |
139 } |
131 else |
140 |
132 { |
|
133 iFWImplementation->GetPluginManager().RecheckPlugins(); |
|
134 plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId); |
|
135 if(plugin) |
|
136 { |
|
137 // get mailbox from plugin |
|
138 mailBox = plugin->GetMailBoxByUidL(aMailBoxId); |
|
139 } |
|
140 } |
|
141 return mailBox; |
141 return mailBox; |
142 } |
142 } |
143 |
143 |
144 // ----------------------------------------------------------------------------- |
144 // ----------------------------------------------------------------------------- |
145 // CFSMailClient::GetMailBoxByUidLC |
145 // CFSMailClient::GetMailBoxByUidLC |
146 // ----------------------------------------------------------------------------- |
146 // ----------------------------------------------------------------------------- |
147 EXPORT_C CFSMailBox* CFSMailClient::GetMailBoxByUidLC(const TFSMailMsgId aMailBoxId) |
147 EXPORT_C CFSMailBox* CFSMailClient::GetMailBoxByUidLC(const TFSMailMsgId aMailBoxId) |
148 { |
148 { |
149 FUNC_LOG; |
149 NM_FUNCTION; |
150 CFSMailBox* mailBox = GetMailBoxByUidL( aMailBoxId ); |
150 CFSMailBox* mailBox = GetMailBoxByUidL( aMailBoxId ); |
151 CleanupStack::PushL( mailBox ); |
151 CleanupStack::PushL( mailBox ); |
152 return mailBox; |
152 return mailBox; |
153 } |
153 } |
154 |
154 |
158 // CFSMailClient::GetFolderByUidL |
158 // CFSMailClient::GetFolderByUidL |
159 // ----------------------------------------------------------------------------- |
159 // ----------------------------------------------------------------------------- |
160 EXPORT_C CFSMailFolder* CFSMailClient::GetFolderByUidL( const TFSMailMsgId aMailBoxId, |
160 EXPORT_C CFSMailFolder* CFSMailClient::GetFolderByUidL( const TFSMailMsgId aMailBoxId, |
161 const TFSMailMsgId aFolderId ) |
161 const TFSMailMsgId aFolderId ) |
162 { |
162 { |
163 FUNC_LOG; |
163 NM_FUNCTION; |
|
164 |
164 CFSMailFolder* folder = NULL; |
165 CFSMailFolder* folder = NULL; |
165 |
166 |
166 // select plugin |
167 // select plugin |
167 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aFolderId); |
168 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aFolderId); |
168 if(plugin) |
169 if(plugin) |
179 EXPORT_C CFSMailMessage* CFSMailClient::GetMessageByUidL( const TFSMailMsgId aMailBoxId, |
180 EXPORT_C CFSMailMessage* CFSMailClient::GetMessageByUidL( const TFSMailMsgId aMailBoxId, |
180 const TFSMailMsgId aFolderId, |
181 const TFSMailMsgId aFolderId, |
181 const TFSMailMsgId aMessageId, |
182 const TFSMailMsgId aMessageId, |
182 const TFSMailDetails aDetails) |
183 const TFSMailDetails aDetails) |
183 { |
184 { |
184 FUNC_LOG; |
185 NM_FUNCTION; |
|
186 |
185 CFSMailMessage* message = NULL; |
187 CFSMailMessage* message = NULL; |
186 // select plugin |
188 // select plugin |
187 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMessageId); |
189 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMessageId); |
188 if(plugin) |
190 if(plugin) |
189 { |
191 { |
199 // ----------------------------------------------------------------------------- |
201 // ----------------------------------------------------------------------------- |
200 EXPORT_C void CFSMailClient::DeleteMessagesByUidL( const TFSMailMsgId aMailBoxId, |
202 EXPORT_C void CFSMailClient::DeleteMessagesByUidL( const TFSMailMsgId aMailBoxId, |
201 const TFSMailMsgId aFolderId, |
203 const TFSMailMsgId aFolderId, |
202 const RArray<TFSMailMsgId>& aMessages ) |
204 const RArray<TFSMailMsgId>& aMessages ) |
203 { |
205 { |
204 FUNC_LOG; |
206 NM_FUNCTION; |
205 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aFolderId); |
207 |
|
208 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId); |
206 if(plugin) |
209 if(plugin) |
207 { |
210 { |
208 plugin->DeleteMessagesByUidL(aMailBoxId,aFolderId,aMessages); |
211 plugin->DeleteMessagesByUidL(aMailBoxId,aFolderId,aMessages); |
209 } |
212 } |
210 } |
213 } |
213 // CFSMailClient::DeleteMailBoxByUidL |
216 // CFSMailClient::DeleteMailBoxByUidL |
214 // ----------------------------------------------------------------------------- |
217 // ----------------------------------------------------------------------------- |
215 EXPORT_C TInt CFSMailClient::DeleteMailBoxByUidL( const TFSMailMsgId aMailBoxId, |
218 EXPORT_C TInt CFSMailClient::DeleteMailBoxByUidL( const TFSMailMsgId aMailBoxId, |
216 MFSMailRequestObserver& aOperationObserver ) |
219 MFSMailRequestObserver& aOperationObserver ) |
217 { |
220 { |
218 FUNC_LOG; |
221 NM_FUNCTION; |
|
222 |
219 // select plugin |
223 // select plugin |
220 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId); |
224 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId); |
221 if(plugin) |
225 if(plugin) |
222 { |
226 { |
223 // init asynchronous request |
227 // init asynchronous request |
239 // CFSMailClient::ListMailBoxes |
243 // CFSMailClient::ListMailBoxes |
240 // ----------------------------------------------------------------------------- |
244 // ----------------------------------------------------------------------------- |
241 EXPORT_C TInt CFSMailClient::ListMailBoxes(const TFSMailMsgId aPlugin, |
245 EXPORT_C TInt CFSMailClient::ListMailBoxes(const TFSMailMsgId aPlugin, |
242 RPointerArray<CFSMailBox>& aMailBoxes) |
246 RPointerArray<CFSMailBox>& aMailBoxes) |
243 { |
247 { |
244 FUNC_LOG; |
248 NM_FUNCTION; |
245 |
249 |
246 RArray<TFSMailMsgId> mailBoxList; |
250 RArray<TFSMailMsgId> mailBoxList; |
247 mailBoxList.Reset(); |
251 mailBoxList.Reset(); |
248 TInt ret = KErrNone; |
252 TInt ret = KErrNone; |
249 |
253 |
250 // <cmail> |
254 // <cmail> |
251 CFSMailBox *mailBox = NULL; |
255 CFSMailBox *mailBox = NULL; |
252 // </cmail> |
256 // </cmail> |
253 |
|
254 iFWImplementation->GetPluginManager().RecheckPlugins(); |
|
255 |
257 |
256 if(aPlugin.IsNullId()) |
258 if(aPlugin.IsNullId()) |
257 { |
259 { |
258 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
260 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
259 { |
261 { |
334 // ----------------------------------------------------------------------------- |
336 // ----------------------------------------------------------------------------- |
335 EXPORT_C MFSMailIterator* CFSMailClient::ListMessages(const TFSMailMsgId aMailBoxId, |
337 EXPORT_C MFSMailIterator* CFSMailClient::ListMessages(const TFSMailMsgId aMailBoxId, |
336 const TFSMailMsgId aFolderId, const TFSMailDetails aDetails, |
338 const TFSMailMsgId aFolderId, const TFSMailDetails aDetails, |
337 const RArray<TFSMailSortCriteria>& aSorting) |
339 const RArray<TFSMailSortCriteria>& aSorting) |
338 { |
340 { |
339 FUNC_LOG; |
341 NM_FUNCTION; |
340 |
342 |
341 MFSMailIterator* iterator = NULL; |
343 MFSMailIterator* iterator = NULL; |
342 MFSMailIterator* pluginIterator = NULL; |
344 MFSMailIterator* pluginIterator = NULL; |
343 |
345 |
344 // select plugin |
346 // select plugin |
362 // ----------------------------------------------------------------------------- |
364 // ----------------------------------------------------------------------------- |
363 // CFSMailClient::GetBrandManagerL |
365 // CFSMailClient::GetBrandManagerL |
364 // ----------------------------------------------------------------------------- |
366 // ----------------------------------------------------------------------------- |
365 EXPORT_C MFSMailBrandManager& CFSMailClient::GetBrandManagerL( void ) |
367 EXPORT_C MFSMailBrandManager& CFSMailClient::GetBrandManagerL( void ) |
366 { |
368 { |
367 FUNC_LOG; |
369 NM_FUNCTION; |
368 |
370 |
369 if(iBrandManager == NULL) |
371 if(iBrandManager == NULL) |
370 { |
372 { |
371 TRAPD( creationError, |
373 TRAPD( creationError, |
372 iBrandManager = CFSMailBrandManagerImpl::NewL( *this ) ); |
374 iBrandManager = CFSMailBrandManagerImpl::NewL( *this ) ); |
383 // ----------------------------------------------------------------------------- |
385 // ----------------------------------------------------------------------------- |
384 // CFSMailClient::AddObserverL |
386 // CFSMailClient::AddObserverL |
385 // ----------------------------------------------------------------------------- |
387 // ----------------------------------------------------------------------------- |
386 EXPORT_C void CFSMailClient::AddObserverL(MFSMailEventObserver& aObserver) |
388 EXPORT_C void CFSMailClient::AddObserverL(MFSMailEventObserver& aObserver) |
387 { |
389 { |
388 FUNC_LOG; |
390 NM_FUNCTION; |
|
391 |
389 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
392 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
390 { |
393 { |
391 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i); |
394 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i); |
392 if(plugin) |
395 if(plugin) |
393 { |
396 { |
399 // ----------------------------------------------------------------------------- |
402 // ----------------------------------------------------------------------------- |
400 // CFSMailClient::RemoveObserver |
403 // CFSMailClient::RemoveObserver |
401 // ----------------------------------------------------------------------------- |
404 // ----------------------------------------------------------------------------- |
402 EXPORT_C void CFSMailClient::RemoveObserver(MFSMailEventObserver& aObserver) |
405 EXPORT_C void CFSMailClient::RemoveObserver(MFSMailEventObserver& aObserver) |
403 { |
406 { |
404 FUNC_LOG; |
407 NM_FUNCTION; |
|
408 |
405 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
409 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
406 { |
410 { |
407 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i); |
411 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i); |
408 if(plugin) |
412 if(plugin) |
409 { |
413 { |
415 // ----------------------------------------------------------------------------- |
419 // ----------------------------------------------------------------------------- |
416 // CFSMailClient::UnregisterRequestObserver |
420 // CFSMailClient::UnregisterRequestObserver |
417 // ----------------------------------------------------------------------------- |
421 // ----------------------------------------------------------------------------- |
418 EXPORT_C void CFSMailClient::UnregisterRequestObserver(TInt aRequestId) |
422 EXPORT_C void CFSMailClient::UnregisterRequestObserver(TInt aRequestId) |
419 { |
423 { |
420 FUNC_LOG; |
424 NM_FUNCTION; |
|
425 |
421 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
426 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
422 { |
427 { |
423 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i)) |
428 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i)) |
424 { |
429 { |
425 plugin->UnregisterRequestObserver(aRequestId); |
430 plugin->UnregisterRequestObserver(aRequestId); |
432 // CFSMailClient::SubscribeMailboxEventsL |
437 // CFSMailClient::SubscribeMailboxEventsL |
433 // ----------------------------------------------------------------------------- |
438 // ----------------------------------------------------------------------------- |
434 EXPORT_C void CFSMailClient::SubscribeMailboxEventsL(TFSMailMsgId aMailBoxId, |
439 EXPORT_C void CFSMailClient::SubscribeMailboxEventsL(TFSMailMsgId aMailBoxId, |
435 MFSMailEventObserver& aObserver) |
440 MFSMailEventObserver& aObserver) |
436 { |
441 { |
437 FUNC_LOG; |
442 NM_FUNCTION; |
|
443 |
438 // select plugin |
444 // select plugin |
439 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId)) |
445 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId)) |
440 { |
446 { |
441 // set observer |
447 // set observer |
442 plugin->SubscribeMailboxEventsL( aMailBoxId, aObserver ); |
448 plugin->SubscribeMailboxEventsL( aMailBoxId, aObserver ); |
447 // CFSMailClient::UnsubscribeMailboxEvents |
453 // CFSMailClient::UnsubscribeMailboxEvents |
448 // ----------------------------------------------------------------------------- |
454 // ----------------------------------------------------------------------------- |
449 EXPORT_C void CFSMailClient::UnsubscribeMailboxEvents(TFSMailMsgId aMailBoxId, |
455 EXPORT_C void CFSMailClient::UnsubscribeMailboxEvents(TFSMailMsgId aMailBoxId, |
450 MFSMailEventObserver& aObserver) |
456 MFSMailEventObserver& aObserver) |
451 { |
457 { |
452 FUNC_LOG; |
458 NM_FUNCTION; |
|
459 |
453 // select plugin |
460 // select plugin |
454 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId)) |
461 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId)) |
455 { |
462 { |
456 // set observer |
463 // set observer |
457 plugin->UnsubscribeMailboxEvents( aMailBoxId, aObserver ); |
464 plugin->UnsubscribeMailboxEvents( aMailBoxId, aObserver ); |
461 // ----------------------------------------------------------------------------- |
468 // ----------------------------------------------------------------------------- |
462 // CFSMailClient::WizardDataAvailableL |
469 // CFSMailClient::WizardDataAvailableL |
463 // ----------------------------------------------------------------------------- |
470 // ----------------------------------------------------------------------------- |
464 EXPORT_C TInt CFSMailClient::WizardDataAvailableL() |
471 EXPORT_C TInt CFSMailClient::WizardDataAvailableL() |
465 { |
472 { |
466 FUNC_LOG; |
473 NM_FUNCTION; |
467 |
474 |
468 TInt ret = KErrNone; |
475 TInt ret = KErrNone; |
469 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
476 for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++) |
470 { |
477 { |
471 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i)) |
478 if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i)) |
519 // ----------------------------------------------------------------------------- |
526 // ----------------------------------------------------------------------------- |
520 // CFSMailClient::CleanTempDirL |
527 // CFSMailClient::CleanTempDirL |
521 // ----------------------------------------------------------------------------- |
528 // ----------------------------------------------------------------------------- |
522 EXPORT_C void CFSMailClient::CleanTempDirL( ) |
529 EXPORT_C void CFSMailClient::CleanTempDirL( ) |
523 { |
530 { |
524 FUNC_LOG; |
531 NM_FUNCTION; |
|
532 |
525 iFWImplementation->GetPluginManager().CleanTempDirL(); |
533 iFWImplementation->GetPluginManager().CleanTempDirL(); |
526 } |
534 } |
527 |
535 |
528 // ----------------------------------------------------------------------------- |
536 // ----------------------------------------------------------------------------- |
529 // CFSMailClient::GetTempDir |
537 // CFSMailClient::GetTempDir |
530 // ----------------------------------------------------------------------------- |
538 // ----------------------------------------------------------------------------- |
531 EXPORT_C TDesC& CFSMailClient::GetTempDirL( ) |
539 EXPORT_C TDesC& CFSMailClient::GetTempDirL( ) |
532 { |
540 { |
533 FUNC_LOG; |
541 NM_FUNCTION; |
|
542 |
534 return iFWImplementation->GetPluginManager().GetTempDirL(); |
543 return iFWImplementation->GetPluginManager().GetTempDirL(); |
535 } |
544 } |
536 |
545 |
537 // ----------------------------------------------------------------------------- |
546 // ----------------------------------------------------------------------------- |
538 // CFSMailClient::CancelL |
547 // CFSMailClient::CancelL |
539 // ----------------------------------------------------------------------------- |
548 // ----------------------------------------------------------------------------- |
540 EXPORT_C void CFSMailClient::CancelL( const TInt aRequestId ) |
549 EXPORT_C void CFSMailClient::CancelL( const TInt aRequestId ) |
541 { |
550 { |
542 FUNC_LOG; |
551 NM_FUNCTION; |
|
552 |
543 iFWImplementation->GetPluginManager().CancelRequestL(aRequestId); |
553 iFWImplementation->GetPluginManager().CancelRequestL(aRequestId); |
544 } |
554 } |
545 |
555 |
546 // ----------------------------------------------------------------------------- |
556 // ----------------------------------------------------------------------------- |
547 // CFSMailClient::CancelAllL |
557 // CFSMailClient::CancelAllL |
548 // ----------------------------------------------------------------------------- |
558 // ----------------------------------------------------------------------------- |
549 EXPORT_C void CFSMailClient::CancelAllL( ) |
559 EXPORT_C void CFSMailClient::CancelAllL( ) |
550 { |
560 { |
551 FUNC_LOG; |
561 NM_FUNCTION; |
|
562 |
552 iFWImplementation->GetPluginManager().CancelAllRequestsL(); |
563 iFWImplementation->GetPluginManager().CancelAllRequestsL(); |
553 } |
564 } |
554 |
565 |
555 // ----------------------------------------------------------------------------- |
566 // ----------------------------------------------------------------------------- |
556 // CFSMailClient::SetMailboxName |
567 // CFSMailClient::SetMailboxName |
557 // ----------------------------------------------------------------------------- |
568 // ----------------------------------------------------------------------------- |
558 EXPORT_C void CFSMailClient::SetMailboxName( const TFSMailMsgId aMailboxId, const TDesC& aMailboxName ) |
569 EXPORT_C void CFSMailClient::SetMailboxName( const TFSMailMsgId aMailboxId, const TDesC& aMailboxName ) |
559 { |
570 { |
560 FUNC_LOG; |
571 NM_FUNCTION; |
|
572 |
561 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid( aMailboxId ); |
573 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid( aMailboxId ); |
562 if ( plugin ) |
574 if ( plugin ) |
563 { |
575 { |
564 plugin->SetMailboxName( aMailboxId, aMailboxName ); |
576 plugin->SetMailboxName( aMailboxId, aMailboxName ); |
565 } |
577 } |
569 // CFSMailClient::PrepareMrDescriptionL |
581 // CFSMailClient::PrepareMrDescriptionL |
570 // ----------------------------------------------------------------------------- |
582 // ----------------------------------------------------------------------------- |
571 EXPORT_C void CFSMailClient::PrepareMrDescriptionL( const TFSMailMsgId& aMailBoxId, |
583 EXPORT_C void CFSMailClient::PrepareMrDescriptionL( const TFSMailMsgId& aMailBoxId, |
572 const TFSMailMsgId& aMessageId ) |
584 const TFSMailMsgId& aMessageId ) |
573 { |
585 { |
574 FUNC_LOG; |
586 NM_FUNCTION; |
575 CFSMailMessage* message = NULL; |
|
576 // select plugin |
587 // select plugin |
577 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid( aMessageId ); |
588 CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid( aMessageId ); |
578 if ( plugin ) |
589 if ( plugin ) |
579 { |
590 { |
580 // set MR description from the plugin |
591 // set MR description from the plugin |
581 plugin->PrepareMrDescriptionL( aMailBoxId, aMessageId ); |
592 plugin->PrepareMrDescriptionL( aMailBoxId, aMessageId ); |
582 } |
593 } |
583 } |
594 } |
584 |
595 |
|
596 // <qmail> |
|
597 // ----------------------------------------------------------------------------- |
|
598 // CFSMailClient::GetSignatureL |
|
599 // ----------------------------------------------------------------------------- |
|
600 EXPORT_C HBufC* CFSMailClient::GetSignatureL( const TFSMailMsgId& aMailBoxId ) |
|
601 { |
|
602 NM_FUNCTION; |
|
603 HBufC* ret = NULL; |
|
604 |
|
605 // select plugin |
|
606 CFSMailPlugin* plugin = |
|
607 iFWImplementation->GetPluginManager().GetPluginByUid( aMailBoxId ); |
|
608 if ( plugin ) |
|
609 { |
|
610 ret = plugin->GetSignatureL( aMailBoxId ); |
|
611 } |
|
612 |
|
613 return ret; |
|
614 } |
|
615 // </qmail> |
|
616 |
585 // ----------------------------------------------------------------------------- |
617 // ----------------------------------------------------------------------------- |
586 // CFSMailClient::Close |
618 // CFSMailClient::Close |
587 // ----------------------------------------------------------------------------- |
619 // ----------------------------------------------------------------------------- |
588 EXPORT_C void CFSMailClient::Close() |
620 EXPORT_C void CFSMailClient::Close() |
589 { |
621 { |
590 FUNC_LOG; |
622 NM_FUNCTION; |
|
623 |
591 CFSMailClient* instance = Instance(); |
624 CFSMailClient* instance = Instance(); |
592 if(!instance) |
625 if(!instance) |
593 { |
626 { |
594 return; |
627 return; |
595 } |
628 } |
609 // ----------------------------------------------------------------------------- |
642 // ----------------------------------------------------------------------------- |
610 // CFSMailClient::Instance |
643 // CFSMailClient::Instance |
611 // ----------------------------------------------------------------------------- |
644 // ----------------------------------------------------------------------------- |
612 CFSMailClient* CFSMailClient::Instance() |
645 CFSMailClient* CFSMailClient::Instance() |
613 { |
646 { |
614 FUNC_LOG; |
647 NM_FUNCTION; |
|
648 |
615 return static_cast<CFSMailClient*>(Dll::Tls()); |
649 return static_cast<CFSMailClient*>(Dll::Tls()); |
616 } |
650 } |
617 |
651 |
618 // ----------------------------------------------------------------------------- |
652 // ----------------------------------------------------------------------------- |
619 // CFSMailClient::IncReferenceCount |
653 // CFSMailClient::IncReferenceCount |
620 // ----------------------------------------------------------------------------- |
654 // ----------------------------------------------------------------------------- |
621 TInt CFSMailClient::IncReferenceCount() |
655 EXPORT_C TInt CFSMailClient::IncReferenceCount() |
622 { |
656 { |
623 FUNC_LOG; |
657 NM_FUNCTION; |
|
658 |
624 return ++iReferenceCount; |
659 return ++iReferenceCount; |
625 } |
660 } |
626 |
661 |
627 // ----------------------------------------------------------------------------- |
662 // ----------------------------------------------------------------------------- |
628 // CFSMailClient::DecReferenceCount |
663 // CFSMailClient::DecReferenceCount |
629 // ----------------------------------------------------------------------------- |
664 // ----------------------------------------------------------------------------- |
630 TInt CFSMailClient::DecReferenceCount() |
665 TInt CFSMailClient::DecReferenceCount() |
631 { |
666 { |
632 FUNC_LOG; |
667 NM_FUNCTION; |
|
668 |
633 return --iReferenceCount; |
669 return --iReferenceCount; |
634 } |
670 } |
635 |
671 |
636 // ----------------------------------------------------------------------------- |
672 // ----------------------------------------------------------------------------- |
637 // CFSMailClient::ReleaseExtension |
673 // CFSMailClient::ReleaseExtension |
638 // ----------------------------------------------------------------------------- |
674 // ----------------------------------------------------------------------------- |
639 EXPORT_C void CFSMailClient::ReleaseExtension( CEmailExtension* aExtension ) |
675 EXPORT_C void CFSMailClient::ReleaseExtension( CEmailExtension* aExtension ) |
640 { |
676 { |
|
677 NM_FUNCTION; |
|
678 |
641 CExtendableEmail::ReleaseExtension( aExtension ); |
679 CExtendableEmail::ReleaseExtension( aExtension ); |
642 } |
680 } |
643 |
681 |
644 // ----------------------------------------------------------------------------- |
682 // ----------------------------------------------------------------------------- |
645 // CFSMailClient::ExtensionL |
683 // CFSMailClient::ExtensionL |
646 // ----------------------------------------------------------------------------- |
684 // ----------------------------------------------------------------------------- |
647 EXPORT_C CEmailExtension* CFSMailClient::ExtensionL( const TUid& aInterfaceUid ) |
685 EXPORT_C CEmailExtension* CFSMailClient::ExtensionL( const TUid& aInterfaceUid ) |
648 { |
686 { |
|
687 NM_FUNCTION; |
|
688 |
649 return CExtendableEmail::ExtensionL( aInterfaceUid ); |
689 return CExtendableEmail::ExtensionL( aInterfaceUid ); |
650 } |
690 } |
651 |
691 |