|
1 /* |
|
2 * Copyright (c) 2002 - 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: |
|
15 * Message centre's mail dialog. |
|
16 * Includes "mtm mailboxes" and "mtm mailbox in use" setting items. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __MCESETTINGSMULTIPLESERVICESDIALOG_H__ |
|
23 #define __MCESETTINGSMULTIPLESERVICESDIALOG_H__ |
|
24 |
|
25 // INCLUDES |
|
26 #include <AiwServiceHandler.h> |
|
27 #ifdef RD_MESSAGING_GENERAL_SETTINGS_RENOVATION |
|
28 #include <ConeResLoader.h> |
|
29 #endif // RD_MESSAGING_GENERAL_SETTINGS_RENOVATION |
|
30 |
|
31 #include <msvapi.h> |
|
32 #include <ImumInHealthServices.h> |
|
33 #include "MceSettingsTitlePaneHandlerDialog.h" |
|
34 |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class MMceSettingsAccountManager; |
|
38 class CMceSettingsMultipleServicesDialog; |
|
39 class CImumInternalApi; |
|
40 class TUidNameInfo; |
|
41 class CUidNameArray; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Message centre's mail dialog. |
|
47 * Includes "remote mailboxes" and "Mailbox in use" setting items. |
|
48 */ |
|
49 class CMceSettingsMultipleServicesDialog : |
|
50 public CMceSettingsTitlePaneHandlerDialog, |
|
51 public MMsvSessionObserver |
|
52 |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Constructor. |
|
58 */ |
|
59 CMceSettingsMultipleServicesDialog( |
|
60 MMceSettingsAccountManager& aManager, TUid aMessageType, CMsvSession* aSession ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CMceSettingsMultipleServicesDialog(); |
|
66 |
|
67 /** |
|
68 * |
|
69 */ |
|
70 IMPORT_C static TInt CreateAndExecuteL( |
|
71 MMceSettingsAccountManager& aManager, |
|
72 TUid aMessageType, |
|
73 CMsvSession* aSession ); |
|
74 |
|
75 public: // new methods |
|
76 |
|
77 /** |
|
78 * Launches the dialog |
|
79 * |
|
80 * @since S60 v3.2 |
|
81 * @param aManager |
|
82 * @param aMessageType |
|
83 * @param aSession |
|
84 * @param aMenuResource |
|
85 * @param aDialogResource |
|
86 * @leave KErrNoMemory |
|
87 */ |
|
88 static void LaunchDialogL( |
|
89 MMceSettingsAccountManager& aManager, |
|
90 const TUid& aMessageType, |
|
91 CMsvSession& aSession, |
|
92 const TInt& aMenuResource, |
|
93 const TInt& aDialogResource ); |
|
94 |
|
95 /** |
|
96 * Launches new dialog for editing mailboxes. |
|
97 */ |
|
98 void EditServicesL(); |
|
99 |
|
100 /** |
|
101 * Handles entries created session event |
|
102 * Called from HandleSessionEventL |
|
103 * @param aSelection: pointer to created entries |
|
104 */ |
|
105 void HandleEntriesCreatedL( CMsvEntrySelection* aSelection ); |
|
106 |
|
107 /* |
|
108 * Informs that subdialog is closed |
|
109 */ |
|
110 void SubdialogClosed(); |
|
111 |
|
112 public: // Functions from base classes |
|
113 /** |
|
114 * From CAknDialog |
|
115 */ |
|
116 void ProcessCommandL( TInt aCommandId ); |
|
117 |
|
118 /** |
|
119 * From MEikMenuObserver |
|
120 */ |
|
121 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
122 |
|
123 /** |
|
124 * MMsvSessionObserver |
|
125 */ |
|
126 void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); |
|
127 |
|
128 /** |
|
129 * From CoeControl |
|
130 */ |
|
131 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
132 |
|
133 /** |
|
134 * Sets the flag to indicate that the MTM services subdialog |
|
135 * is not open |
|
136 */ |
|
137 static void ResetMtmServicesDialog(TAny* aAny); |
|
138 |
|
139 protected: // Functions from base classes |
|
140 |
|
141 /** |
|
142 * From CEikDialog |
|
143 */ |
|
144 virtual void PreLayoutDynInitL(); |
|
145 |
|
146 /** |
|
147 * From CEikDialog |
|
148 */ |
|
149 virtual TBool OkToExitL(TInt aButtonId); |
|
150 |
|
151 /** |
|
152 * From MEikListBoxObserver |
|
153 */ |
|
154 virtual void HandleListBoxEventL( |
|
155 CEikListBox* aListBox, |
|
156 TListBoxEvent aEventType ); |
|
157 |
|
158 /** |
|
159 * Handles this application view's command keys. Forwards other keys. |
|
160 * |
|
161 * @return EKeyWasConsumed if the keyboard event was consumed or |
|
162 * EKeyWasNotConsumed otherwise. |
|
163 */ |
|
164 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
165 TEventCode aType ); |
|
166 |
|
167 private: |
|
168 /** |
|
169 * Symbian constructor |
|
170 * |
|
171 * @since S60 v3.2 |
|
172 */ |
|
173 void ConstructL(TInt aResource ); |
|
174 |
|
175 /** |
|
176 * Symbian constructor |
|
177 * |
|
178 * @since S60 v3.2 |
|
179 */ |
|
180 void ConstructL(); |
|
181 |
|
182 /** |
|
183 * Updates the internal mailbox data information |
|
184 * |
|
185 * @since S60 v3.2 |
|
186 * @leave KErrNoMemory |
|
187 */ |
|
188 void UpdateMailboxDataL(); |
|
189 |
|
190 /** |
|
191 * Launches setting page "Mailbox in use" |
|
192 * to select mailbox to be used for sending by default. |
|
193 */ |
|
194 void ShowListBoxSettingPageL(); |
|
195 |
|
196 /** |
|
197 * Sets mailbox in use and sets up correct array |
|
198 * for this dialog to be displayed. |
|
199 */ |
|
200 void SetAccountInUseL(); |
|
201 |
|
202 /** |
|
203 * Should be called if no mailboxes defined. |
|
204 * Displayes query to create new mailbox and then creates one. |
|
205 * @return ETrue if user created mailbox, EFalse if they didn't. |
|
206 */ |
|
207 TBool HandleNoMailboxesL(); |
|
208 |
|
209 /** |
|
210 * Launches help application |
|
211 */ |
|
212 void LaunchHelpL() const; |
|
213 |
|
214 /** |
|
215 * Sets the label of the MSK button for the dialog |
|
216 */ |
|
217 void SetMSKButtonL(); |
|
218 |
|
219 /** |
|
220 * Lists email accounts |
|
221 * @return Returns array of email accounts |
|
222 */ |
|
223 CMsvEntrySelection* GetEmailAccountsL( CMsvSession& aSession ); |
|
224 |
|
225 /** |
|
226 * Lists email accounts |
|
227 * @return Returns array of email accounts |
|
228 */ |
|
229 CUidNameArray* MtmEmailAccountsL(); |
|
230 |
|
231 /** |
|
232 * Updates arrays |
|
233 */ |
|
234 void UpdateServicesArrayL(); |
|
235 |
|
236 /** |
|
237 * Creates new IMAP/POP mailbox. |
|
238 * @return ETrue if mailbox created, |
|
239 */ |
|
240 TBool CreateNewImapPopL(); |
|
241 |
|
242 /** |
|
243 * Launches a setup wizard. |
|
244 */ |
|
245 TBool LaunchWizardL(); |
|
246 |
|
247 private: |
|
248 enum EActiveMenuBar { |
|
249 EMultipleServices, |
|
250 EMtmServices |
|
251 }; |
|
252 private: // Data |
|
253 MMceSettingsAccountManager& iManager; |
|
254 TUid iMessageType; |
|
255 CDesCArrayFlat* iSettingsItemArray; |
|
256 TBool iSessionObserverAdded; |
|
257 CMsvSession* iSession; |
|
258 TBool iStartMailboxCreationWaiter; |
|
259 TBool iSubDialogForceClosed; |
|
260 // Owned: Pointer to email API object |
|
261 CImumInternalApi* iEmailApi; |
|
262 // Array of mailbox ids |
|
263 MImumInHealthServices::RMailboxIdArray iMailboxArray; |
|
264 TInt iNumberOfMailboxes; |
|
265 #ifdef RD_MESSAGING_GENERAL_SETTINGS_RENOVATION |
|
266 RConeResourceLoader iResources; |
|
267 #endif // RD_MESSAGING_GENERAL_SETTINGS_RENOVATION |
|
268 TBool iSubDialogOpen; |
|
269 CUidNameArray* iAccountArray; |
|
270 TInt iActiveMenuBar; |
|
271 CAiwServiceHandler* iAiwServiceHandler; |
|
272 TBool iS60WizLaunched; |
|
273 TBool iProductIncludesSelectableEmail; |
|
274 TBool iMceIntegration; |
|
275 // Id of the email application (other than platform email application) |
|
276 TInt iMtmPluginId; |
|
277 }; |
|
278 |
|
279 #endif // __MCESETTINGSMULTIPLESERVICESDIALOG_H__ |
|
280 |
|
281 // End of File |