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