|
1 /* |
|
2 * Copyright (c) 2003 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: Setting item creator |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "CWVSettingsUISettingItemCreator.h" |
|
21 #include "CWVSettingsUIDialogImp.h" |
|
22 #include "WVSettingsUIPanics.h" |
|
23 #include "CWVSettingsUIDefs.h" |
|
24 |
|
25 #include <cwvsettingsUING.rsg> |
|
26 #include <aknsettingitemlist.h> |
|
27 #include <aknsettingpage.h> |
|
28 #include <featmgr.h> |
|
29 #ifdef RD_MULTIPLE_DRIVE |
|
30 #include <CAknMemorySelectionSettingItemMultiDrive.h> |
|
31 #endif |
|
32 |
|
33 #include "variantkeys.h" |
|
34 #include <centralrepository.h> |
|
35 #include <barsread.H> |
|
36 // CONSTANTS |
|
37 |
|
38 |
|
39 // ================= MEMBER FUNCTIONS ======================= |
|
40 |
|
41 // --------------------------------------------------------- |
|
42 // CWVSettingsUISettingItemCreator::CreateSettingItemListL() |
|
43 // |
|
44 // (other items were commented in a header). |
|
45 // --------------------------------------------------------- |
|
46 // |
|
47 CAknSettingItemArray* CWVSettingsUISettingItemCreator::CreateSettingItemListL( TBool aCASettings, |
|
48 TDes& aServerInUse, |
|
49 TInt& aImLoginType, |
|
50 #ifdef RD_MULTIPLE_DRIVE |
|
51 TDes& aMemorySelectionType, |
|
52 #endif |
|
53 TDes& aConnectionDaysIM, |
|
54 TDes& aConnectionHoursIM ) |
|
55 { |
|
56 // granularity = 6, since there can be 6 items, and we start the numbering from 1 |
|
57 CAknSettingItemArray* settingItemArray = settingItemArray = |
|
58 new ( ELeave ) CAknSettingItemArray( 7, EFalse, 1 ); |
|
59 CleanupStack::PushL( settingItemArray ); |
|
60 |
|
61 // count for cleanupstack pop |
|
62 TInt count( 0 ); |
|
63 |
|
64 // add setting items |
|
65 |
|
66 if ( aCASettings ) |
|
67 { |
|
68 |
|
69 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
70 CWVSettingsUIDialogImp::EWVSettingsCASettings, |
|
71 R_WVSETTINGSVIEW_SETTING_PREFERENCES_TITLE, |
|
72 0, |
|
73 0, |
|
74 aServerInUse, |
|
75 aImLoginType, |
|
76 #ifdef RD_MULTIPLE_DRIVE |
|
77 aMemorySelectionType, |
|
78 #endif |
|
79 aConnectionDaysIM, |
|
80 aConnectionHoursIM ) ); |
|
81 count++; |
|
82 } |
|
83 |
|
84 // edit servers |
|
85 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
86 CWVSettingsUIDialogImp::EWVSettingsServers, |
|
87 R_WVSETTINGSVIEW_SETTING_EDITSERVER_TITLE, |
|
88 0, |
|
89 0, |
|
90 aServerInUse, |
|
91 aImLoginType, |
|
92 #ifdef RD_MULTIPLE_DRIVE |
|
93 aMemorySelectionType, |
|
94 #endif |
|
95 aConnectionDaysIM, |
|
96 aConnectionHoursIM ) ); |
|
97 count++; |
|
98 // server in use |
|
99 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
100 CWVSettingsUIDialogImp::EWVSettingsServerInUse, |
|
101 R_WVSETTINGSVIEW_SETTING_SERVERINUSE_TITLE, |
|
102 0, |
|
103 0, |
|
104 aServerInUse, |
|
105 aImLoginType, |
|
106 #ifdef RD_MULTIPLE_DRIVE |
|
107 aMemorySelectionType, |
|
108 #endif |
|
109 aConnectionDaysIM, |
|
110 aConnectionHoursIM ) ); |
|
111 count++; |
|
112 |
|
113 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
114 CWVSettingsUIDialogImp::EWVSettingsIMLoginType, |
|
115 R_WVSETTINGSVIEW_SETTING_IM_LOGINTYPE_TITLE, |
|
116 R_WVSETTINGSVIEW_SET_LOGIN, |
|
117 R_WVSETTINGSVIEW_SET_IM_LOGIN_TEXTS, |
|
118 aServerInUse, |
|
119 aImLoginType, |
|
120 #ifdef RD_MULTIPLE_DRIVE |
|
121 aMemorySelectionType, |
|
122 #endif |
|
123 aConnectionDaysIM, |
|
124 aConnectionHoursIM ) ); |
|
125 count++; |
|
126 |
|
127 #ifdef RD_MULTIPLE_DRIVE |
|
128 // Memory Selection |
|
129 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
130 CWVSettingsUIDialogImp::EWVSettingsSaveChatsTo, |
|
131 R_WVSETTINGSVIEW_SETTING_MEMORY_SELECTION_TYPE, |
|
132 0, |
|
133 0, |
|
134 aServerInUse, |
|
135 aImLoginType, |
|
136 aMemorySelectionType, |
|
137 aConnectionDaysIM, |
|
138 aConnectionHoursIM ) ); |
|
139 count++; |
|
140 |
|
141 #endif |
|
142 |
|
143 if ( ( aImLoginType == EWVSettingsChatLoginAutoAlways ) || |
|
144 ( aImLoginType == EWVSettingsChatLoginAutoInHomeNW ) ) |
|
145 { |
|
146 // PEC login type automatic, we have to show the scheduling setting items also |
|
147 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
148 CWVSettingsUIDialogImp::EWVSettingsIMConnDays, |
|
149 R_WVSETTINGSVIEW_SETTING_PEC_CONN_ALLDAYS_TITLE, |
|
150 0, |
|
151 0, |
|
152 aServerInUse, |
|
153 aImLoginType, |
|
154 #ifdef RD_MULTIPLE_DRIVE |
|
155 aMemorySelectionType, |
|
156 #endif |
|
157 aConnectionDaysIM, |
|
158 aConnectionHoursIM ) ); |
|
159 count++; |
|
160 |
|
161 settingItemArray->AppendL( CWVSettingsUISettingItemCreator::CreateSettingItemLC( |
|
162 CWVSettingsUIDialogImp::EWVSettingsIMConnHours, |
|
163 R_WVSETTINGSVIEW_SETTING_PEC_CONN_ALLHOURS_TITLE, |
|
164 0, |
|
165 0, |
|
166 aServerInUse, |
|
167 aImLoginType, |
|
168 #ifdef RD_MULTIPLE_DRIVE |
|
169 aMemorySelectionType, |
|
170 #endif |
|
171 aConnectionDaysIM, |
|
172 aConnectionHoursIM ) ); |
|
173 count++; |
|
174 } |
|
175 |
|
176 CleanupStack::Pop( count ); // setting items |
|
177 CleanupStack::Pop( settingItemArray ); |
|
178 return settingItemArray; |
|
179 } |
|
180 |
|
181 // --------------------------------------------------------- |
|
182 // CWVSettingsUISettingItemCreator::CreateSettingItemLC() |
|
183 // |
|
184 // (other items were commented in a header). |
|
185 // --------------------------------------------------------- |
|
186 // |
|
187 CAknSettingItem* CWVSettingsUISettingItemCreator::CreateSettingItemLC( TInt aIndex, |
|
188 TInt aResourceId, |
|
189 TInt aSettingPageResourceId, |
|
190 TInt aAssosiatedResource, |
|
191 TDes& aServerInUse, |
|
192 TInt& aImLoginType, |
|
193 #ifdef RD_MULTIPLE_DRIVE |
|
194 TDes& aMemorySelectionType, |
|
195 #endif |
|
196 TDes& aConnectionDaysIM, |
|
197 TDes& aConnectionHoursIM ) |
|
198 { |
|
199 CAknSettingItem* settingItem = NULL; |
|
200 HBufC* itemTitle = NULL; |
|
201 |
|
202 CEikonEnv* eikonEnv = CEikonEnv::Static(); |
|
203 switch ( aIndex ) |
|
204 { |
|
205 case CWVSettingsUIDialogImp::EWVSettingsCASettings: |
|
206 { |
|
207 settingItem = new ( ELeave ) CAknBigSettingItemBase( 0 ); |
|
208 CleanupStack::PushL( settingItem ); |
|
209 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
210 settingItem->ConstructL( EFalse, aIndex, *itemTitle, NULL, NULL, NULL ); |
|
211 break; |
|
212 } |
|
213 |
|
214 case CWVSettingsUIDialogImp::EWVSettingsServers: |
|
215 { |
|
216 settingItem = new ( ELeave ) CAknBigSettingItemBase( 0 ); |
|
217 CleanupStack::PushL( settingItem ); |
|
218 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
219 settingItem->ConstructL( EFalse, aIndex, *itemTitle, NULL, NULL, NULL ); |
|
220 break; |
|
221 } |
|
222 case CWVSettingsUIDialogImp::EWVSettingsServerInUse: |
|
223 { |
|
224 settingItem = new ( ELeave ) CAknTextSettingItem( 0, aServerInUse ); |
|
225 CleanupStack::PushL( settingItem ); |
|
226 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
227 settingItem->SetEmptyItemTextL( KEmptyDesC ); |
|
228 settingItem->ConstructL( EFalse, aIndex, *itemTitle, NULL, NULL, EEikCtEdwin ); |
|
229 break; |
|
230 } |
|
231 case CWVSettingsUIDialogImp::EWVSettingsIMLoginType: |
|
232 { |
|
233 settingItem = new ( ELeave ) CAknEnumeratedTextPopupSettingItem( 0, aImLoginType ); |
|
234 CleanupStack::PushL( settingItem ); |
|
235 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
236 settingItem->ConstructL( EFalse, aIndex, *itemTitle, |
|
237 NULL, aSettingPageResourceId, |
|
238 EAknCtPopupField, NULL, aAssosiatedResource ); |
|
239 break; |
|
240 } |
|
241 |
|
242 #ifdef RD_MULTIPLE_DRIVE |
|
243 case CWVSettingsUIDialogImp::EWVSettingsSaveChatsTo: |
|
244 { |
|
245 settingItem = new ( ELeave ) CAknTextSettingItem( 0, aMemorySelectionType ); |
|
246 CleanupStack::PushL( settingItem ); |
|
247 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
248 settingItem->ConstructL( EFalse, aIndex, *itemTitle, NULL, NULL, EEikCtEdwin ); |
|
249 break; |
|
250 } |
|
251 |
|
252 #endif |
|
253 |
|
254 case CWVSettingsUIDialogImp::EWVSettingsIMConnDays: |
|
255 { |
|
256 settingItem = new ( ELeave ) CAknTextSettingItem( 0, aConnectionDaysIM ); |
|
257 CleanupStack::PushL( settingItem ); |
|
258 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
259 settingItem->SetEmptyItemTextL( KEmptyDesC ); |
|
260 settingItem->ConstructL( EFalse, aIndex, *itemTitle, NULL, NULL, EEikCtEdwin ); |
|
261 break; |
|
262 } |
|
263 |
|
264 |
|
265 case CWVSettingsUIDialogImp::EWVSettingsIMConnHours: |
|
266 { |
|
267 settingItem = new ( ELeave ) CAknTextSettingItem( 0, aConnectionHoursIM ); |
|
268 CleanupStack::PushL( settingItem ); |
|
269 itemTitle = eikonEnv->AllocReadResourceLC( aResourceId ); |
|
270 settingItem->SetEmptyItemTextL( KEmptyDesC ); |
|
271 settingItem->ConstructL( EFalse, aIndex, *itemTitle, NULL, NULL, EEikCtEdwin ); |
|
272 break; |
|
273 } |
|
274 |
|
275 default: |
|
276 { |
|
277 break; |
|
278 } |
|
279 } |
|
280 CleanupStack::PopAndDestroy( itemTitle ); |
|
281 |
|
282 return settingItem; |
|
283 } |
|
284 |
|
285 // --------------------------------------------------------- |
|
286 // CWVSettingsUISettingItemCreator::SchdeulingSupported() |
|
287 // |
|
288 // (other items were commented in a header). |
|
289 // --------------------------------------------------------- |
|
290 // |
|
291 TBool CWVSettingsUISettingItemCreator::SchedulingSupported() |
|
292 { |
|
293 return ETrue; |
|
294 } |
|
295 |
|
296 // End of File |