|
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: Decleares main dialog class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IPSSETUI_H |
|
20 #define IPSSETUI_H |
|
21 |
|
22 |
|
23 #include <AknForm.h> // CAknDialog |
|
24 #include <msvapi.h> |
|
25 #include <ConeResLoader.h> // RConeResourceLoader |
|
26 |
|
27 /** |
|
28 * Flags to control the UI. |
|
29 */ |
|
30 enum TIpsSetUiFlags |
|
31 { |
|
32 // Indicates that the settings should be closed |
|
33 EIpsSetUiShouldClose = 0x01, |
|
34 // Indicates if the settings should be exitted |
|
35 EIpsSetUiShouldExit = 0x02, |
|
36 // Indicates the need of query in exit |
|
37 EIpsSetUiQueryClose = 0x04, |
|
38 // Indicates the need of opening settings menu |
|
39 EIpsSetUiOpenOptionsMenu = 0x08, |
|
40 // Indicates if the submenu item is currently selected |
|
41 EIpsSetUiPositionSubMenu = 0x10, |
|
42 // Indicates, if the main settings view is open |
|
43 EIpsSetUiMainSettingsMenu = 0x20, |
|
44 // Allow saving |
|
45 EIpsSetUiAllowSave = 0x40, |
|
46 // Indicates if settings item is currently selected |
|
47 //<cmail> |
|
48 EIpsSetUiSettingsMenuItem = 0x80, |
|
49 // Indicates if account data should be hidden |
|
50 EIpsSetUiHideAccountData = 0x100 |
|
51 //</cmail> |
|
52 }; |
|
53 |
|
54 class CEikFormattedCellListBox; |
|
55 class CIpsSetDataManager; |
|
56 class CAknTitlePane; |
|
57 class CEikEdwin; |
|
58 class CEikRichTextEditor; |
|
59 class CIpsSetData; |
|
60 class CIpsSetUiDialogCtrl; |
|
61 |
|
62 |
|
63 |
|
64 /** |
|
65 * Main dialog class. |
|
66 * |
|
67 * @since FS v1.0 |
|
68 * @lib IpsSosSettings.lib |
|
69 */ |
|
70 class CIpsSetUi : |
|
71 public CAknDialog, |
|
72 public MMsvSessionObserver |
|
73 { |
|
74 public: // Constructors and destructor |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 virtual ~CIpsSetUi(); |
|
80 |
|
81 /** |
|
82 * 2 phase construction. |
|
83 * |
|
84 * @return Ui object with client ownership. |
|
85 */ |
|
86 static CIpsSetUi* NewL( const TMsvId aMailboxId, TBool aFolderSettingView = EFalse ); //<cmail> |
|
87 |
|
88 /** |
|
89 * 2 phase construction with stack push. |
|
90 * |
|
91 * @return Ui object with client ownership. |
|
92 */ |
|
93 static CIpsSetUi* NewLC( const TMsvId aMailboxId, TBool aFolderSettingView = EFalse ); //<cmail> |
|
94 |
|
95 // New Functions |
|
96 |
|
97 /** |
|
98 * Launches help dialog. |
|
99 */ |
|
100 void LaunchHelpL(); |
|
101 |
|
102 /** |
|
103 * Launches menu |
|
104 */ |
|
105 void LaunchMenuL(); |
|
106 |
|
107 /** |
|
108 * Returns the id of the mailbox |
|
109 * |
|
110 * @return Current mailbox Id |
|
111 */ |
|
112 TMsvId MailboxId(); |
|
113 |
|
114 // From base class CAknDialog |
|
115 |
|
116 /** |
|
117 * Processes command |
|
118 * |
|
119 * @param aCommandId Command id |
|
120 */ |
|
121 void ProcessCommandL( TInt aCommandId ); |
|
122 |
|
123 /** |
|
124 * Used here to handle exit event from subsettings |
|
125 * |
|
126 * @param aKeyEvent event id |
|
127 * @param aType event type |
|
128 * @return Information of event handling. |
|
129 */ |
|
130 TKeyResponse OfferKeyEventL( |
|
131 const TKeyEvent& aKeyEvent, |
|
132 TEventCode aType ); |
|
133 |
|
134 /** |
|
135 * Handles invoked commands. |
|
136 * |
|
137 * @param aCommand Invoked command. |
|
138 */ |
|
139 void HandleCommandL( TInt aCommand ); |
|
140 |
|
141 /** |
|
142 * Handles resource changes, such as screen switch. |
|
143 * |
|
144 * @param aType Change type. |
|
145 */ |
|
146 virtual void HandleResourceChange( TInt aType ); |
|
147 |
|
148 /** |
|
149 * Gets outta here. |
|
150 */ |
|
151 void DoQuitL(); |
|
152 |
|
153 //<cmail> |
|
154 /** |
|
155 * Setter for iIgnoreOneBackKey. See iIgnoreOneBackKey for more info. |
|
156 * |
|
157 * @param aIgnoreBackKey iIgnoreOneBackKey value |
|
158 */ |
|
159 void SetIgnoreOneBackKey(TBool aIgnoreBackKey); |
|
160 //</cmail> |
|
161 |
|
162 protected: // Functions from base classes |
|
163 |
|
164 //From CEikDialog |
|
165 |
|
166 /** |
|
167 * Check wheter its ok to exit or not. |
|
168 * |
|
169 * @param aButtonId, button id |
|
170 * @return ETrue, when exit is ok. |
|
171 */ |
|
172 virtual TBool OkToExitL( TInt aButtonId ); |
|
173 |
|
174 /** |
|
175 * Dialog initialization. |
|
176 */ |
|
177 virtual void PreLayoutDynInitL(); |
|
178 |
|
179 /** |
|
180 * Initializes menu pane. |
|
181 * |
|
182 * @param aResourceId Type of id. |
|
183 * @param aMenuPane Menupane object |
|
184 */ |
|
185 virtual void DynInitMenuPaneL( |
|
186 TInt aResourceId, |
|
187 CEikMenuPane* aMenuPane ); |
|
188 |
|
189 /** |
|
190 * Retrieves current help context. |
|
191 * |
|
192 * @param aContext Return parameter for context. |
|
193 */ |
|
194 virtual void GetHelpContext( |
|
195 TCoeHelpContext& aContext ) const; |
|
196 |
|
197 // From MMsvSessionObserver |
|
198 |
|
199 /* |
|
200 * |
|
201 */ |
|
202 virtual void HandleSessionEventL( |
|
203 TMsvSessionEvent aEvent, |
|
204 TAny* aArg1, TAny* aArg2, TAny* aArg3 ); |
|
205 |
|
206 private: // Constructors |
|
207 |
|
208 /** |
|
209 * C++ default constructor. |
|
210 * |
|
211 * @param aMailboxd Currently edited mailbox |
|
212 */ |
|
213 CIpsSetUi( const TMsvId aMailboxId, TBool aFolderSettingView = EFalse ); //<cmail> |
|
214 |
|
215 /** |
|
216 * 2nd phase of construction. |
|
217 */ |
|
218 void ConstructL(); |
|
219 |
|
220 private: // New functions |
|
221 |
|
222 /** |
|
223 * Check to see if we are editing an existing |
|
224 * or a new account |
|
225 * |
|
226 * @return ETrue if editing, EFalse if creating new |
|
227 */ |
|
228 inline TBool EditingAnAccount() const; |
|
229 |
|
230 /** |
|
231 * Change font color in startup and when skin is changed. |
|
232 */ |
|
233 void SetFontAndSkin(); |
|
234 |
|
235 /** |
|
236 * Opens the resource file. |
|
237 */ |
|
238 void LoadResourceL(); |
|
239 /* |
|
240 * Check mailbox online state or ask user for |
|
241 * disconnection, leave in case of error or if user |
|
242 * choose not to disconnect |
|
243 */ |
|
244 void DisconnectIfOnlineL( TBool aDoShowQuery = ETrue ); |
|
245 |
|
246 private: // Data |
|
247 |
|
248 /** |
|
249 * Flags of settings |
|
250 */ |
|
251 TUint64 iFlags; |
|
252 |
|
253 /** |
|
254 * The listbox with skin support |
|
255 * Owned. |
|
256 */ |
|
257 CEikFormattedCellListBox* iListBox; |
|
258 |
|
259 /** |
|
260 * Richtext editor. |
|
261 * Owned. |
|
262 */ |
|
263 CEikRichTextEditor* iTextEditor; |
|
264 |
|
265 /** |
|
266 * Setting dialog controller. |
|
267 * Owned. |
|
268 */ |
|
269 CIpsSetUiDialogCtrl* iSettings; |
|
270 |
|
271 /** |
|
272 * Used when loading settings |
|
273 */ |
|
274 CMsvSession* iSession; |
|
275 |
|
276 /** |
|
277 * Menubar resource. |
|
278 */ |
|
279 TInt iResourceMenuBar; |
|
280 |
|
281 /** |
|
282 * Object to load the resources |
|
283 */ |
|
284 RConeResourceLoader iResourceLoader; |
|
285 |
|
286 /** |
|
287 * Stored mailbox ID |
|
288 */ |
|
289 TMsvId iMailboxId; |
|
290 |
|
291 //<cmail> |
|
292 /** |
|
293 * This shows that settings are opened from folder list view. |
|
294 * When settings are opened from folder list view, we go directly to |
|
295 * 'what to sync' dialog. Bypassing mailbox's main settings view |
|
296 */ |
|
297 TBool iShowFolderSettings; |
|
298 |
|
299 /** |
|
300 * When settings are shown from folder list view, open returning we |
|
301 * need to ignore one back key. Logic is so that we go back from 'what to sync' |
|
302 * view to folder list view directly, bypassing mailbox's main settings view |
|
303 */ |
|
304 TBool iIgnoreOneBackKey; |
|
305 //<cmail> |
|
306 |
|
307 }; |
|
308 |
|
309 #endif // IPSSETUI_H |
|
310 |
|
311 // End of File |