18 |
18 |
19 #ifndef __CMAILCPSHANDLER_H__ |
19 #ifndef __CMAILCPSHANDLER_H__ |
20 #define __CMAILCPSHANDLER_H__ |
20 #define __CMAILCPSHANDLER_H__ |
21 |
21 |
22 #include <aknappui.h> |
22 #include <aknappui.h> |
|
23 #include <memailobserverlistener.h> // base class |
|
24 |
23 // FSMailServer classes (base classes and callback interfaces) |
25 // FSMailServer classes (base classes and callback interfaces) |
24 #include "fsnotificationhandlerbase.h" |
26 #include "fsnotificationhandlerbase.h" |
25 #include "fsnotificationhandlernotifierinitiator.h" |
27 #include "fsnotificationhandlernotifierinitiator.h" |
26 #include "fsnotificationhandlernotifierinitiatorobserver.h" |
28 #include "fsnotificationhandlernotifierinitiatorobserver.h" |
27 // Member classes |
29 // Member classes |
29 |
31 |
30 class CMailCpsIf; |
32 class CMailCpsIf; |
31 class CFSMailBox; |
33 class CFSMailBox; |
32 class CMailMailboxDetails; |
34 class CMailMailboxDetails; |
33 class CMailCpsSettings; |
35 class CMailCpsSettings; |
|
36 class CMailExternalAccount; |
|
37 class CMailPluginProxy; |
|
38 class CEmailObserverPlugin; |
34 |
39 |
35 /** |
40 /** |
36 * CMail ContentPublishingService Handler class |
41 * CMail ContentPublishingService Handler class |
37 * Class implementing a handler functionality towards rest of the MailServer |
42 * Class implementing a handler functionality towards rest of the MailServer |
38 * |
43 * |
39 * @lib fsmailserver.exe |
44 * @lib fsmailserver.exe |
40 * @since S60 v5.1 |
45 * @since S60 v5.1 |
41 */ |
46 */ |
42 NONSHARABLE_CLASS( CMailCpsHandler ) : |
47 NONSHARABLE_CLASS( CMailCpsHandler ) : |
43 public CFSNotificationHandlerBase, |
48 public CFSNotificationHandlerBase, |
44 public MMailCpsSettingsCallback |
49 public MMailCpsSettingsCallback, |
|
50 public EmailInterface::MEmailObserverListener |
45 { |
51 { |
46 public: |
52 public: |
47 |
53 |
48 /** |
54 /** |
49 * Two-phased constructor. |
55 * Two-phased constructor. |
94 * |
113 * |
95 */ |
114 */ |
96 void DissociateWidgetFromSettingL( const TDesC& aContentId ); |
115 void DissociateWidgetFromSettingL( const TDesC& aContentId ); |
97 |
116 |
98 /** |
117 /** |
99 * |
118 * Return total number of mailboxes (native+3rd party) in the system |
|
119 */ |
|
120 TInt TotalMailboxCountL(); |
|
121 |
|
122 /** |
|
123 * Return total number of native mailboxes in the system |
100 */ |
124 */ |
101 TInt GetMailboxCount(); |
125 TInt TotalIntMailboxCount(); |
|
126 |
|
127 /** |
|
128 * Return total number of 3rd party mailboxes in the system |
|
129 */ |
|
130 TInt TotalExtMailboxCountL(); |
102 |
131 |
103 /** |
132 /** |
104 * |
133 * |
105 */ |
134 */ |
106 void ManualAccountSelectionL( const TDesC& aContentId ); |
135 void ManualAccountSelectionL( const TDesC& aContentId ); |
107 |
136 |
|
137 /** |
|
138 * Gets correct localised format for time (or date) string |
|
139 */ |
|
140 static HBufC* GetMessageTimeStringL( TTime aMessageTime ); |
|
141 |
|
142 // From MEmailObserverListener |
|
143 void EmailObserverEvent( EmailInterface::MEmailData& aData ); |
|
144 |
108 protected: |
145 protected: |
109 /** |
146 /** |
110 * From CFSNotificationHandlerBase |
147 * From CFSNotificationHandlerBase |
111 * see baseclass for details |
148 * see baseclass for details |
112 */ |
149 */ |
176 */ |
218 */ |
177 void UpdateMessagesL( const TInt aMailBoxNumber, |
219 void UpdateMessagesL( const TInt aMailBoxNumber, |
178 const TInt aWidgetInstance, |
220 const TInt aWidgetInstance, |
179 const TInt aMessageNumber, |
221 const TInt aMessageNumber, |
180 const TInt aFirstRow ); |
222 const TInt aFirstRow ); |
181 |
|
182 /** |
|
183 * Gets correct localised format for time (or date) string |
|
184 */ |
|
185 HBufC* GetMessageTimeStringL( TTime aMessageTime ); |
|
186 |
223 |
187 /** |
224 /** |
188 * |
225 * |
189 */ |
226 */ |
190 void UpdateEmptyMessagesL( const TInt aWidgetInstance, |
227 void UpdateEmptyMessagesL( const TInt aWidgetInstance, |
336 * @param aMailbox specifies the mailboxdetails object where duplicate is searched from |
373 * @param aMailbox specifies the mailboxdetails object where duplicate is searched from |
337 * @param aMsgId Id of the new message |
374 * @param aMsgId Id of the new message |
338 * @return ETrue if duplicate, EFalse if new message |
375 * @return ETrue if duplicate, EFalse if new message |
339 */ |
376 */ |
340 TBool IsDuplicate( const CMailMailboxDetails& aMailbox, const TFSMailMsgId& aMsgId ); |
377 TBool IsDuplicate( const CMailMailboxDetails& aMailbox, const TFSMailMsgId& aMsgId ); |
341 |
378 |
342 /** |
379 // |
343 * |
380 // Private methods related to 3rd party email widget publishers |
344 */ |
381 // |
|
382 /** |
|
383 * Removes all plugin proxies (and plugins) that are not listed in aAccounts |
|
384 * @param aAccounts up-to-date list of external (3rd party) email accounts |
|
385 * that are specified in settings |
|
386 */ |
|
387 void RemoveUnusedPluginsL( RPointerArray<CMailExternalAccount>& aAccounts ); |
|
388 |
|
389 /** |
|
390 * Goes through the array of external accounts and instantiates (newly added) |
|
391 * 3rd party plugins |
|
392 * @param aAccounts up-to-date list of external (3rd party) email accounts |
|
393 * that are specified in settings |
|
394 */ |
|
395 void AddNewPluginsL( RPointerArray<CMailExternalAccount>& aAccounts ); |
|
396 |
|
397 /** |
|
398 * Goes through the array of existing 3rd party plugin (proxies) and |
|
399 * lets them take the accounts given in the param array. |
|
400 * Plugin proxies also update the widget data. |
|
401 * @param aAccounts up-to-date list of external (3rd party) email accounts |
|
402 * that are specified in settings |
|
403 */ |
|
404 void SelectAndUpdateExtAccountsL( RPointerArray<CMailExternalAccount>& aAccounts ); |
|
405 |
345 TBool FirstBootL(); |
406 TBool FirstBootL(); |
346 |
407 |
|
408 /** |
|
409 * Checks whether aAccounts array has entries relating to plugin with id aPluginId |
|
410 * @param aPluginId 3rd party plugin identifier (implementation uid) |
|
411 * @param aAccounts array of 3rd party email account information |
|
412 * @return true or false |
|
413 */ |
|
414 TBool IsPluginInArray( const TInt aPluginId, RPointerArray<CMailExternalAccount>& aAccounts ); |
|
415 |
|
416 /** |
|
417 * Checks whether aPlugins array has entries relating to plugin with id aPluginId |
|
418 * @param aPluginId 3rd party plugin identifier (implementation uid) |
|
419 * @param aPlugins array of plugin proxies |
|
420 * @return true or false |
|
421 */ |
|
422 TBool IsPluginInArray( const TInt aPluginId, RPointerArray<CMailPluginProxy>& aPlugins ); |
|
423 |
|
424 /** |
|
425 * Goes through iExternalPlugins array and finds correct entry |
|
426 * @param aContentId specifying a widget/account |
|
427 * @return correct plugin proxy instance pointer (ownership not transferred) |
|
428 * if not found, NULL is retuned |
|
429 */ |
|
430 CMailPluginProxy* GetExtPluginL( const TDesC& aContentId ); |
|
431 |
347 private: // data |
432 private: // data |
348 CEikonEnv* iEnv; |
433 CEikonEnv* iEnv; |
349 // pointer to liw wrapper that handles actual publishing |
434 // pointer to liw wrapper that handles actual publishing |
350 CMailCpsIf* iLiwIf; |
435 CMailCpsIf* iLiwIf; |
351 // pointer to settings class that handles settings loading and observing logic |
436 // pointer to settings class that handles settings loading and observing logic |
352 CMailCpsSettings* iSettings; |
437 CMailCpsSettings* iSettings; |
353 // local cache of mailbox details |
438 // local cache of mailbox details |
354 RPointerArray<CMailMailboxDetails> iAccountsArray; |
439 RPointerArray<CMailMailboxDetails> iAccountsArray; |
|
440 // array of plugin proxies. One plugin proxy handles one 3rd party plugin and its accounts |
|
441 RPointerArray<CMailPluginProxy> iExternalPlugins; |
355 }; |
442 }; |
356 |
443 |
357 #endif //__CMAILCPSHANDLER_H__ |
444 #endif //__CMAILCPSHANDLER_H__ |