1 /* |
|
2 * Copyright (c) 2007-2010 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: Declarition of CSCSettingsUiMainContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CSCSETTINGSUIMAINCONTAINER_H |
|
20 #define C_CSCSETTINGSUIMAINCONTAINER_H |
|
21 |
|
22 #include "mcscengserviceobserver.h" |
|
23 #include "mcscengprovisioningobserver.h" |
|
24 |
|
25 class CCSCSettingsUiModel; |
|
26 class CAknSettingStyleListBox; |
|
27 class MCSCEngServiceObserver; |
|
28 class MCSCEngProvisioningObserver; |
|
29 |
|
30 /** |
|
31 * TListBoxItem class |
|
32 * |
|
33 * @lib CSCSettingsUi.lib |
|
34 * @since S60 v3.2 |
|
35 */ |
|
36 NONSHARABLE_CLASS( TMainListBoxItem ) |
|
37 { |
|
38 public: |
|
39 |
|
40 /** Enumeration of setting items **/ |
|
41 enum TSettingItems |
|
42 { |
|
43 EUsername = 0, |
|
44 EPassword, |
|
45 EPreferredService, |
|
46 EVccPreferredService, |
|
47 EHandoverNotifTone, |
|
48 EImTone, |
|
49 EAutoacceptInv, |
|
50 EServiceConn |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Constructor. |
|
55 * |
|
56 * @since S60 3.2 |
|
57 */ |
|
58 TMainListBoxItem() |
|
59 : iItem( EUsername ) |
|
60 {} |
|
61 |
|
62 public: // data |
|
63 |
|
64 /** |
|
65 * Listbox item |
|
66 */ |
|
67 TSettingItems iItem; |
|
68 }; |
|
69 |
|
70 /** |
|
71 * CCSCSettingsUiMainContainer class |
|
72 * Declarition of CCSCSettingsUiMainContainer. |
|
73 * |
|
74 * @lib CSCSettingsUi.lib |
|
75 * @since S60 v3.2 |
|
76 */ |
|
77 NONSHARABLE_CLASS( CCSCSettingsUiMainContainer ) : public CCoeControl |
|
78 { |
|
79 public: |
|
80 |
|
81 CCSCSettingsUiMainContainer( |
|
82 CCSCSettingsUiModel& aModel ); |
|
83 void ConstructL( const TRect& aRect ); |
|
84 virtual ~CCSCSettingsUiMainContainer(); |
|
85 |
|
86 /** |
|
87 * Updates container and redraws listbox items. |
|
88 * |
|
89 * @since S60 v3.2 |
|
90 */ |
|
91 void UpdateContainerL(); |
|
92 |
|
93 /** |
|
94 * Shows a query which changes handover notification tone setting |
|
95 * |
|
96 * @since S60 v5.0 |
|
97 */ |
|
98 void HandoverNotificationToneQueryL(); |
|
99 |
|
100 /** |
|
101 * Shows a query which changes presence request preference |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 */ |
|
105 void PresenceReqPrefQueryL(); |
|
106 |
|
107 /** |
|
108 * For saving IM tone path to service tab storage. |
|
109 * |
|
110 * @param aTonePath tone path to be saved. |
|
111 * @since S60 v5.0 |
|
112 */ |
|
113 void SaveImTonePathL( const TDesC& aTonePath ); |
|
114 |
|
115 /** |
|
116 * Returns handle to the listbox. |
|
117 * |
|
118 * @since S60 v3.2 |
|
119 * @return handle to the listbox |
|
120 */ |
|
121 CAknSettingStyleListBox* ListBox(); |
|
122 |
|
123 /** |
|
124 * Returns selected list box item |
|
125 * |
|
126 * @since S60 v3.2 |
|
127 * @return selected list box item |
|
128 */ |
|
129 TMainListBoxItem CurrentItem() const; |
|
130 |
|
131 /** |
|
132 * Deletes the service in hand. |
|
133 * |
|
134 * @since S60 v5.2 |
|
135 */ |
|
136 TBool DeleteServiceL(); |
|
137 |
|
138 /** |
|
139 * Launches cleanup plugin to remove settings. |
|
140 * |
|
141 * @since S60 v5.2 |
|
142 * @param aServiceId ID of service to be removed. |
|
143 */ |
|
144 void LaunchCleanupPluginL( TUint aServiceId ) const; |
|
145 |
|
146 // from base class CCoeControl |
|
147 |
|
148 /** |
|
149 * From CCoeControl. |
|
150 */ |
|
151 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
152 |
|
153 /** |
|
154 * From CCoeControl. |
|
155 */ |
|
156 TKeyResponse OfferKeyEventL( |
|
157 const TKeyEvent& aKeyEvent, |
|
158 TEventCode aType ); |
|
159 |
|
160 /** |
|
161 * From CCoeControl. |
|
162 */ |
|
163 void HandleResourceChange( TInt aType ); |
|
164 |
|
165 private: |
|
166 |
|
167 /** |
|
168 * Creates listbox item for setting items. |
|
169 * |
|
170 * @since S60 v3.2 |
|
171 */ |
|
172 void ConstructListBoxL(); |
|
173 |
|
174 /** |
|
175 * Return caption for setting item. |
|
176 * |
|
177 * @since S60 v3.2 |
|
178 * @param aItem for setting list item to be constructed |
|
179 * @return setting item caption |
|
180 */ |
|
181 HBufC* GetCaptionL( TMainListBoxItem::TSettingItems aItem ); |
|
182 |
|
183 /** |
|
184 * Get username. |
|
185 * |
|
186 * @since S60 v5.0 |
|
187 * @param aUsername username is set to this. |
|
188 */ |
|
189 void GetUsernameL( RBuf& aUsername ); |
|
190 |
|
191 /** |
|
192 * Get preferred service setting. |
|
193 * |
|
194 * @since S60 v5.0 |
|
195 * @param aValue presence pref setting value is stored to this. |
|
196 */ |
|
197 void GetPreferredServiceSettingL( RBuf& aValue ); |
|
198 |
|
199 /** |
|
200 * Get preferred service setting when VCC is supported. |
|
201 * |
|
202 * @since S60 v5.0 |
|
203 * @param aValue presence pref setting value is stored to this. |
|
204 */ |
|
205 void GetVccPreferredServiceSettingL( RBuf& aValue ); |
|
206 |
|
207 /** |
|
208 * Get handover notification tone setting. |
|
209 * |
|
210 * @since S60 v5.0 |
|
211 * @param aValue handover notification tone setting value is stored |
|
212 * to this. |
|
213 */ |
|
214 void GetHandoverNotificationTonePrefL( RBuf& aValue ); |
|
215 |
|
216 /** |
|
217 * Get precence preferred setting. |
|
218 * |
|
219 * @since S60 v5.0 |
|
220 * @param aValue presence pref setting value is stored to this. |
|
221 */ |
|
222 void GetPresencePrefSettingL( RBuf& aValue ); |
|
223 |
|
224 /** |
|
225 * Get IM message tone setting. |
|
226 * |
|
227 * @since S60 v5.0 |
|
228 * @param aValue im tone setting value is stored to this. |
|
229 */ |
|
230 void GetImToneSettingL( RBuf& aValue ); |
|
231 |
|
232 /** |
|
233 * Get SNAP settings. |
|
234 * |
|
235 * @since S60 v5.0 |
|
236 * @param aValue snap setting value is stored to this. |
|
237 */ |
|
238 void GetSnapSettingL( RBuf& aValue ); |
|
239 |
|
240 /** |
|
241 * Draws setting items at the first time |
|
242 * after the initialization is completed. |
|
243 * |
|
244 * @since S60 v3.2 |
|
245 */ |
|
246 void InitializeSettingItemsL(); |
|
247 |
|
248 /** |
|
249 * Constructs setting list items. |
|
250 * |
|
251 * @since S60 v3.2 |
|
252 * @param aItem for setting list item to be constructed |
|
253 */ |
|
254 void MakeSettingItemL( TMainListBoxItem::TSettingItems aItem ); |
|
255 |
|
256 /** |
|
257 * Cleanup RImplInfoPtrArray |
|
258 * |
|
259 * @since S60 v5.2 |
|
260 * @param aArray Array to be destroyed. |
|
261 */ |
|
262 static void ResetAndDestroy( TAny* aArray ); |
|
263 |
|
264 // from base class CCoeControl |
|
265 |
|
266 /** |
|
267 * From CCoeControl. |
|
268 */ |
|
269 TInt CountComponentControls() const; |
|
270 |
|
271 /** |
|
272 * From CCoeControl |
|
273 */ |
|
274 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
275 |
|
276 /** |
|
277 * From CCoeControl. |
|
278 */ |
|
279 void SizeChanged(); |
|
280 |
|
281 /** |
|
282 * From CoeControl. |
|
283 */ |
|
284 void FocusChanged( TDrawNow aDrawNow ); |
|
285 |
|
286 private: // data |
|
287 |
|
288 /** |
|
289 * Reference to model class for settings handling. |
|
290 */ |
|
291 CCSCSettingsUiModel& iModel; |
|
292 |
|
293 /** |
|
294 * Listbox for main view setting page items. |
|
295 * Own. |
|
296 */ |
|
297 CAknSettingStyleListBox* iListBox; |
|
298 |
|
299 /** |
|
300 * Listbox item array |
|
301 */ |
|
302 RArray<TMainListBoxItem> iListBoxItemArray; |
|
303 |
|
304 /** |
|
305 * Setting item caption |
|
306 */ |
|
307 HBufC* iCaption; |
|
308 |
|
309 #ifdef _DEBUG |
|
310 friend class UT_cscsettingsui; |
|
311 #endif |
|
312 |
|
313 }; |
|
314 |
|
315 #endif // C_CSCSETTINGSUIMAINCONTAINER_H |
|
316 |
|