1 /* |
|
2 * Copyright (c) 2007-2009 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 class CCSCSettingsUiModel; |
|
23 class CAknSettingStyleListBox; |
|
24 |
|
25 /** |
|
26 * TListBoxItem class |
|
27 * |
|
28 * @lib CSCSettingsUi.lib |
|
29 * @since S60 v3.2 |
|
30 */ |
|
31 NONSHARABLE_CLASS( TMainListBoxItem ) |
|
32 { |
|
33 public: |
|
34 |
|
35 /** Enumeration of setting items **/ |
|
36 enum TSettingItems |
|
37 { |
|
38 EUsername = 0, |
|
39 EPassword, |
|
40 EPreferredService, |
|
41 EVccPreferredService, |
|
42 EHandoverNotifTone, |
|
43 EImTone, |
|
44 EAutoacceptInv, |
|
45 EServiceConn |
|
46 }; |
|
47 |
|
48 /** |
|
49 * Constructor. |
|
50 * |
|
51 * @since S60 3.2 |
|
52 */ |
|
53 TMainListBoxItem() |
|
54 : iItem( EUsername ) |
|
55 {} |
|
56 |
|
57 public: // data |
|
58 |
|
59 /** |
|
60 * Listbox item |
|
61 */ |
|
62 TSettingItems iItem; |
|
63 }; |
|
64 |
|
65 /** |
|
66 * CCSCSettingsUiMainContainer class |
|
67 * Declarition of CCSCSettingsUiMainContainer. |
|
68 * |
|
69 * @lib CSCSettingsUi.lib |
|
70 * @since S60 v3.2 |
|
71 */ |
|
72 NONSHARABLE_CLASS( CCSCSettingsUiMainContainer ) : public CCoeControl |
|
73 { |
|
74 public: |
|
75 |
|
76 CCSCSettingsUiMainContainer( |
|
77 CCSCSettingsUiModel& aModel ); |
|
78 |
|
79 |
|
80 void ConstructL( |
|
81 const TRect& aRect ); |
|
82 |
|
83 |
|
84 virtual ~CCSCSettingsUiMainContainer(); |
|
85 |
|
86 |
|
87 /** |
|
88 * Updates container and redraws listbox items. |
|
89 * |
|
90 * @since S60 v3.2 |
|
91 */ |
|
92 void UpdateContainerL(); |
|
93 |
|
94 |
|
95 /** |
|
96 * Shows a query which changes handover notification tone setting |
|
97 * |
|
98 * @since S60 v5.0 |
|
99 */ |
|
100 void HandoverNotificationToneQueryL(); |
|
101 |
|
102 |
|
103 /** |
|
104 * Shows a query which changes presence request preference |
|
105 * |
|
106 * @since S60 v3.2 |
|
107 */ |
|
108 void PresenceReqPrefQueryL(); |
|
109 |
|
110 /** |
|
111 * For saving IM tone path to service tab storage. |
|
112 * |
|
113 * @param aTonePath tone path to be saved. |
|
114 * @since S60 v5.0 |
|
115 */ |
|
116 void SaveImTonePathL( const TDesC& aTonePath ); |
|
117 |
|
118 |
|
119 /** |
|
120 * Returns handle to the listbox. |
|
121 * |
|
122 * @since S60 v3.2 |
|
123 * @return handle to the listbox |
|
124 */ |
|
125 CAknSettingStyleListBox* ListBox(); |
|
126 |
|
127 |
|
128 /** |
|
129 * Returns selected list box item |
|
130 * |
|
131 * @since S60 v3.2 |
|
132 * @return selected list box item |
|
133 */ |
|
134 TMainListBoxItem CurrentItem() const; |
|
135 |
|
136 |
|
137 // from base class CCoeControl |
|
138 |
|
139 /** |
|
140 * From CCoeControl. |
|
141 */ |
|
142 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
143 |
|
144 |
|
145 /** |
|
146 * From CCoeControl. |
|
147 */ |
|
148 TKeyResponse OfferKeyEventL( |
|
149 const TKeyEvent& aKeyEvent, |
|
150 TEventCode aType ); |
|
151 |
|
152 |
|
153 /** |
|
154 * From CCoeControl. |
|
155 */ |
|
156 void HandleResourceChange( TInt aType ); |
|
157 |
|
158 |
|
159 private: |
|
160 |
|
161 /** |
|
162 * Creates listbox item for setting items. |
|
163 * |
|
164 * @since S60 v3.2 |
|
165 */ |
|
166 void ConstructListBoxL(); |
|
167 |
|
168 |
|
169 /** |
|
170 * Return caption for setting item. |
|
171 * |
|
172 * @since S60 v3.2 |
|
173 * @param aItem for setting list item to be constructed |
|
174 * @return setting item caption |
|
175 */ |
|
176 HBufC* GetCaptionL( TMainListBoxItem::TSettingItems aItem ); |
|
177 |
|
178 |
|
179 /** |
|
180 * Get username. |
|
181 * |
|
182 * @since S60 v5.0 |
|
183 * @param aUsername username is set to this. |
|
184 */ |
|
185 void GetUsernameL( RBuf& aUsername ); |
|
186 |
|
187 |
|
188 /** |
|
189 * Get preferred service setting. |
|
190 * |
|
191 * @since S60 v5.0 |
|
192 * @param aValue presence pref setting value is stored to this. |
|
193 */ |
|
194 void GetPreferredServiceSettingL( RBuf& aValue ); |
|
195 |
|
196 |
|
197 /** |
|
198 * Get preferred service setting when VCC is supported. |
|
199 * |
|
200 * @since S60 v5.0 |
|
201 * @param aValue presence pref setting value is stored to this. |
|
202 */ |
|
203 void GetVccPreferredServiceSettingL( RBuf& aValue ); |
|
204 |
|
205 |
|
206 /** |
|
207 * Get handover notification tone setting. |
|
208 * |
|
209 * @since S60 v5.0 |
|
210 * @param aValue handover notification tone setting value is stored |
|
211 * to this. |
|
212 */ |
|
213 void GetHandoverNotificationTonePrefL( RBuf& aValue ); |
|
214 |
|
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 /** |
|
226 * Get IM message tone setting. |
|
227 * |
|
228 * @since S60 v5.0 |
|
229 * @param aValue im tone setting value is stored to this. |
|
230 */ |
|
231 void GetImToneSettingL( RBuf& aValue ); |
|
232 |
|
233 |
|
234 /** |
|
235 * Get SNAP settings. |
|
236 * |
|
237 * @since S60 v5.0 |
|
238 * @param aValue snap setting value is stored to this. |
|
239 */ |
|
240 void GetSnapSettingL( RBuf& aValue ); |
|
241 |
|
242 |
|
243 /** |
|
244 * Draws setting items at the first time |
|
245 * after the initialization is completed. |
|
246 * |
|
247 * @since S60 v3.2 |
|
248 */ |
|
249 void InitializeSettingItemsL(); |
|
250 |
|
251 |
|
252 /** |
|
253 * Constructs setting list items. |
|
254 * |
|
255 * @since S60 v3.2 |
|
256 * @param aItem for setting list item to be constructed |
|
257 */ |
|
258 void MakeSettingItemL( TMainListBoxItem::TSettingItems aItem ); |
|
259 |
|
260 |
|
261 // from base class CCoeControl |
|
262 |
|
263 /** |
|
264 * From CCoeControl. |
|
265 */ |
|
266 TInt CountComponentControls() const; |
|
267 |
|
268 |
|
269 /** |
|
270 * From CCoeControl |
|
271 */ |
|
272 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
273 |
|
274 |
|
275 /** |
|
276 * From CCoeControl. |
|
277 */ |
|
278 void SizeChanged(); |
|
279 |
|
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 |
|