|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declares plugin settings interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _ESMAILSESETTINGSPLUGIN_H_ |
|
20 #define _ESMAILSESETTINGSPLUGIN_H_ |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <aknview.h> |
|
24 |
|
25 /** |
|
26 * In addition to the pure virtuals below, the plug-in implementers must implement |
|
27 * following methods of CAknView |
|
28 * |
|
29 * -DoActivate() |
|
30 * * The EMail UI will pass the account id object (provided by the FW) and the subview id |
|
31 * packaged to a package buffer in the custom message. The implementations should save the |
|
32 * aPrevViewId to be able to reactivate the EMail UI settings view when the user wants to |
|
33 * return from the subview. The custom message id contains enumeration |
|
34 * TESEmailSettingsPluginCustomMessageId |
|
35 * -DoDeactivate() |
|
36 * -Id() |
|
37 * * The plug-ins should return their implementation UID as the view's id to ensure |
|
38 * unique ids. The EMail UI will also use this id to map the accounts to correct settings |
|
39 * plug-ins with the help of FWs Settings Info API (which returns the settings UI plug-in |
|
40 * implementation UID for an account). |
|
41 * |
|
42 */ |
|
43 |
|
44 // INTERFACE DECLARATION |
|
45 class CESMailSettingsPlugin : public CAknView |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Creates instance of a CESMailSettingsPlugin |
|
50 * |
|
51 * @param aImplementationUid protocol plugin Id reveiced from Freestyle Framework |
|
52 * @return CESMailSettingsPlugin pointer |
|
53 */ |
|
54 inline static CESMailSettingsPlugin* NewL( const TUid& aImplementationUid ); |
|
55 |
|
56 /** |
|
57 * Destructor |
|
58 */ |
|
59 inline virtual ~CESMailSettingsPlugin(); |
|
60 |
|
61 public: |
|
62 /** |
|
63 * Returns the number of subviews visible under the mail settings. The subviews will |
|
64 * be presented in the settings UI in the same order as their ids (0, 1, 2, 3, ...). |
|
65 */ |
|
66 virtual TInt MailSettingsSubviewCount() = 0; |
|
67 |
|
68 /** |
|
69 * Returns the caption for a mail settings subview. |
|
70 * |
|
71 * @param aAccountId Freestyle email account information |
|
72 * @param aSubviewIndex index of a settings subview |
|
73 * @param aLongCaption if ETrue long version of caption is returned |
|
74 * @return TPtrC to caption |
|
75 |
|
76 */ |
|
77 virtual TPtrC MailSettingsSubviewCaption( |
|
78 TFSMailMsgId aAccountId, |
|
79 TInt aSubviewIndex, |
|
80 TBool aLongCaption ) = 0; |
|
81 |
|
82 /** |
|
83 * Returns ETrue if the protocol can handle syncing of PIM data (calendar, contacts, etc...), EFalse if not. |
|
84 * Returning ETrue will make the protocol visible in the Personal Information Management / PIM Source radio selection |
|
85 */ |
|
86 virtual TBool CanHandlePIMSync() = 0; |
|
87 |
|
88 /** |
|
89 * Returns the localized protocol name that is shown in the |
|
90 * Personal Information Management / PIM Source radio selection |
|
91 */ |
|
92 virtual TPtrC LocalizedProtocolName() = 0; |
|
93 |
|
94 /** |
|
95 * Returns ETrue if the protocol is selected for PIM sync, EFalse if not. The information is used |
|
96 * to show the correct protocol name in the settings UI |
|
97 */ |
|
98 virtual TBool IsSelectedForPIMSync() = 0; |
|
99 |
|
100 /** |
|
101 * Selects or disables the protocol for PIM sync. |
|
102 */ |
|
103 virtual void SelectForPIMSync( TBool aSelectForSync ) = 0; |
|
104 |
|
105 /** |
|
106 * Returns the number of subviews visible under the PIM settings. The subviews will |
|
107 * be presented in the settings UI in the same order as their ids (0, 1, 2, 3, ...). |
|
108 */ |
|
109 virtual TInt PIMSettingsSubviewCount() = 0; |
|
110 |
|
111 /** |
|
112 * Returns the caption for a PIM settings subview. |
|
113 * |
|
114 * @param aAccountId Freestyle email account information |
|
115 * @param aSubviewIndex index of a settings subview |
|
116 * @param aLongCaption if ETrue long version of caption is returned |
|
117 * @return TPtrC to caption |
|
118 */ |
|
119 virtual TPtrC PIMSettingsSubviewCaption( |
|
120 TFSMailMsgId aAccountId, |
|
121 TInt aSubviewIndex, |
|
122 TBool aLongCaption ) = 0; |
|
123 |
|
124 // DATA TYPES |
|
125 public: |
|
126 /** |
|
127 * Container for the data needed to activate |
|
128 * a subview in a setings UI plug-in. |
|
129 * This class gets passed in the custom message |
|
130 * part of the view activation message. |
|
131 */ |
|
132 class TSubViewActivationData |
|
133 { |
|
134 public: |
|
135 //<cmail> Initialize variables |
|
136 TSubViewActivationData(): |
|
137 iPimAccount(EFalse), iLaunchedOutsideFSEmail(EFalse), iLaunchFolderSettings(EFalse) |
|
138 { |
|
139 //intentionally left empty |
|
140 }; |
|
141 //</cmail> |
|
142 TFSMailMsgId iAccount; |
|
143 TInt iSubviewId; |
|
144 TBool iPimAccount; |
|
145 TBool iLaunchedOutsideFSEmail; |
|
146 TBool iLaunchFolderSettings; //<cmail> |
|
147 }; |
|
148 |
|
149 enum TESEmailSettingsPluginCustomMessageId |
|
150 { |
|
151 EActivateMailSettingsSubview, |
|
152 EActivatePIMSettingsSubview |
|
153 }; |
|
154 private: |
|
155 /** |
|
156 * Unique instance identifier key (needed for ECom) |
|
157 */ |
|
158 TUid iDtor_ID_Key; |
|
159 }; |
|
160 |
|
161 #include "esmailsettingsplugin.inl" |
|
162 |
|
163 #endif /*_ESMAILSESETTINGSPLUGIN_H_*/ |