|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 #include <barsc.h> |
|
18 #include <bautils.h> |
|
19 #include <coemain.h> |
|
20 #include <pathinfo.h> |
|
21 #include <s32file.h> |
|
22 #include <centralrepository.h> |
|
23 |
|
24 #include "irdebug.h" |
|
25 #include "irsettings.h" |
|
26 #include "irinternalcrkeys.h" |
|
27 |
|
28 // Constants |
|
29 const TInt KSix = 6; |
|
30 const TInt KFifty = 50; |
|
31 const TInt KTimeSize = 60000000 ; |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // description_if_needed |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 EXPORT_C CIRSettings* CIRSettings::OpenL() |
|
38 { |
|
39 IRLOG_DEBUG( "CIRSettings::OpenL() - Entering" ); |
|
40 CIRSettings* self = static_cast<CIRSettings*>( Dll::Tls() ); |
|
41 |
|
42 if ( self ) |
|
43 { |
|
44 User::LeaveIfError( self->Open() ); |
|
45 } |
|
46 else |
|
47 { |
|
48 self = new ( ELeave ) CIRSettings; |
|
49 CleanupClosePushL( *self ); |
|
50 self->ConstructL(); |
|
51 CleanupStack::Pop( self ); |
|
52 } |
|
53 IRLOG_DEBUG( "CIRSettings::OpenL() - Exiting" ); |
|
54 return self; |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // description_if_needed |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 CIRSettings::CIRSettings() |
|
62 { |
|
63 IRLOG_DEBUG( "CIRSettings::CIRSettings" ); |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // description_if_needed |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 void CIRSettings::ConstructL() |
|
71 { |
|
72 IRLOG_DEBUG( "CIRSettings::ConstructL() - Enter" ); |
|
73 |
|
74 iRepository = CRepository::NewL(KCRUidInternetRadio); |
|
75 |
|
76 User::LeaveIfError( iFs.Connect() ); |
|
77 TParse parse; |
|
78 // Parses out the private path of the running process. |
|
79 User::LeaveIfError( iFs.PrivatePath( iPrivatePath ) ); |
|
80 |
|
81 TParsePtrC phoneMemoryRootPath( PathInfo::PhoneMemoryRootPath() ); |
|
82 TPtrC drive( phoneMemoryRootPath.Drive() ); |
|
83 User::LeaveIfError( parse.Set( iPrivatePath, &drive, NULL ) ); |
|
84 iPrivatePath = parse.FullName(); |
|
85 |
|
86 BaflUtils::EnsurePathExistsL( iFs, parse.FullName() ); |
|
87 |
|
88 IRLOG_DEBUG2("CIRSettings::ConstructL - iPrivatePath = %S", &iPrivatePath ); |
|
89 |
|
90 User::LeaveIfError( Dll::SetTls( this ) ); |
|
91 |
|
92 IRLOG_DEBUG( "CIRSettings::ConstructL() - Exit" ); |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // description_if_needed |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 CIRSettings::~CIRSettings() |
|
100 { |
|
101 IRLOG_DEBUG( "CIRSettings::~CIRSettings() - Entering" ); |
|
102 delete iRepository; |
|
103 iFs.Close(); |
|
104 |
|
105 Dll::FreeTls(); |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // description_if_needed |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 EXPORT_C TBool CIRSettings::IsFlagTermsAndConditionsL() |
|
113 { |
|
114 IRLOG_DEBUG( "CIRSettings::IsFlagTermsAndConditionsL() - Entering" ); |
|
115 TInt value = 0; |
|
116 User::LeaveIfError( iRepository->Get(KIRTermsAndConditionsFlag, value) ); |
|
117 IRLOG_DEBUG( "CIRSettings::IsFlagTermsAndConditionsL() - Exiting" ); |
|
118 return value == 1 ? ETrue : EFalse; |
|
119 } |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // description_if_needed |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 EXPORT_C void CIRSettings::SetFlagTermsAndConditionsL() |
|
126 { |
|
127 IRLOG_DEBUG( "CIRSettings::SetFlagTermsAndConditionsL() - Entering" ); |
|
128 User::LeaveIfError ( iRepository->Set(KIRTermsAndConditionsFlag, 1)); |
|
129 IRLOG_DEBUG( "CIRSettings::SetFlagTermsAndConditionsL() - Exiting" ); |
|
130 } |
|
131 |
|
132 // --------------------------------------------------------------------------- |
|
133 // description_if_needed |
|
134 // --------------------------------------------------------------------------- |
|
135 // |
|
136 EXPORT_C void CIRSettings::ReSetFlagTermsAndConditionsL() |
|
137 { |
|
138 IRLOG_DEBUG( "CIRSettings::ReSetFlagTermsAndConditionsL() - Entering" ); |
|
139 User::LeaveIfError ( iRepository->Set(KIRTermsAndConditionsFlag, 0)); |
|
140 IRLOG_DEBUG( "CIRSettings::ReSetFlagTermsAndConditionsL() - Exiting" ); |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------------------------- |
|
144 // description_if_needed |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 EXPORT_C const TDesC& CIRSettings::GetIrappVersionL() const |
|
148 { |
|
149 IRLOG_DEBUG( "CIRSettings::GetIrappVersionL() - Entering" ); |
|
150 User::LeaveIfError( iRepository->Get(KIRIrAppVersion, (TDes&)iIrappVersion) ); |
|
151 IRLOG_DEBUG( "CIRSettings::GetIrappVersionL() - Exiting" ); |
|
152 return iIrappVersion; |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // description_if_needed |
|
157 // --------------------------------------------------------------------------- |
|
158 // |
|
159 EXPORT_C void CIRSettings::SetIRIDL(const TDesC& aIrid) |
|
160 { |
|
161 IRLOG_DEBUG( "CIRSettings::SetIRIDL() - Entering" ); |
|
162 User::LeaveIfError ( iRepository->Set(KIRIrId, aIrid) ); |
|
163 IRLOG_DEBUG( "CIRSettings::SetIRIDL() - Exiting" ); |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------------------------- |
|
167 // description_if_needed |
|
168 // --------------------------------------------------------------------------- |
|
169 // |
|
170 EXPORT_C const TDesC& CIRSettings::GetIRIDL() const |
|
171 { |
|
172 IRLOG_DEBUG( "CIRSettings::GetIRIDL() - Entering" ); |
|
173 User::LeaveIfError( iRepository->Get(KIRIrId, (TDes&)iIRID) ); |
|
174 IRLOG_DEBUG( "CIRSettings::GetIRIDL() - Exiting" ); |
|
175 return iIRID; |
|
176 } |
|
177 |
|
178 // --------------------------------------------------------------------------- |
|
179 // description_if_needed |
|
180 // --------------------------------------------------------------------------- |
|
181 // |
|
182 EXPORT_C const TDesC& CIRSettings::GetISDSBaseUrlL() const |
|
183 { |
|
184 IRLOG_DEBUG( "CIRSettings::GetISDSBaseUrlL() - Entering" ); |
|
185 User::LeaveIfError( iRepository->Get(KIRIsdsUrl, (TDes&)iISDSBaseUrl) ); |
|
186 IRLOG_DEBUG( "CIRSettings::GetISDSBaseUrlL() - Exiting" ); |
|
187 return iISDSBaseUrl; |
|
188 } |
|
189 |
|
190 // --------------------------------------------------------------------------- |
|
191 // description_if_needed |
|
192 // --------------------------------------------------------------------------- |
|
193 // |
|
194 EXPORT_C void CIRSettings::SetISDSBaseUrlL(const TDesC& aIsdsUrl) |
|
195 { |
|
196 IRLOG_DEBUG( "CIRSettings::SetISDSBaseUrlL() - Entering" ); |
|
197 User::LeaveIfError ( iRepository->Set(KIRIsdsUrl, aIsdsUrl) ); |
|
198 IRLOG_DEBUG( "CIRSettings::SetISDSBaseUrlL() - Exiting" ); |
|
199 } |
|
200 |
|
201 // --------------------------------------------------------------------------- |
|
202 // description_if_needed |
|
203 // --------------------------------------------------------------------------- |
|
204 // |
|
205 EXPORT_C TInt CIRSettings::GetVolumeSetting() const |
|
206 { |
|
207 IRLOG_DEBUG( "CIRSettings::GetVolumeSetting() - Entering" ); |
|
208 TInt value = KSix; |
|
209 TInt err = iRepository->Get(KIRPlayerVolume, value); |
|
210 if(err) |
|
211 { |
|
212 IRLOG_DEBUG( "CIRSettings::GetVolumeSetting() - Error" ); |
|
213 } |
|
214 |
|
215 IRLOG_DEBUG( "CIRSettings::GetVolumeSetting() - Exiting" ); |
|
216 return value; |
|
217 } |
|
218 |
|
219 // --------------------------------------------------------------------------- |
|
220 // description_if_needed |
|
221 // --------------------------------------------------------------------------- |
|
222 // |
|
223 EXPORT_C void CIRSettings::SetVolumeSettingL(TInt aPlayVolume) |
|
224 { |
|
225 IRLOG_DEBUG( "CIRSettings::SetVolumeSettingL() - Entering" ); |
|
226 User::LeaveIfError ( iRepository->Set(KIRPlayerVolume, aPlayVolume)); |
|
227 IRLOG_DEBUG( "CIRSettings::SetVolumeSettingL() - Exiting" ); |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------------------------- |
|
231 // description_if_needed |
|
232 // --------------------------------------------------------------------------- |
|
233 // |
|
234 EXPORT_C TBool CIRSettings::IsUpdateAvailableL() |
|
235 { |
|
236 IRLOG_DEBUG( "CIRSettings::IsUpdateAvailableL() - Entering" ); |
|
237 TBool value = ETrue; |
|
238 User::LeaveIfError( iRepository->Get(KIRUpdateAvailablity, value) ); |
|
239 IRLOG_DEBUG( "CIRSettings::IsUpdateAvailableL() - Exiting" ); |
|
240 return value; |
|
241 } |
|
242 |
|
243 // --------------------------------------------------------------------------- |
|
244 // description_if_needed |
|
245 // --------------------------------------------------------------------------- |
|
246 // |
|
247 EXPORT_C void CIRSettings::SetUpdateAvailableL() |
|
248 { |
|
249 IRLOG_DEBUG( "CIRSettings::SetUpdateAvailableL() - Entering" ); |
|
250 User::LeaveIfError ( iRepository->Set(KIRUpdateAvailablity, 1)); |
|
251 IRLOG_DEBUG( "CIRSettings::SetUpdateAvailableL() - Exiting" ); |
|
252 } |
|
253 |
|
254 // --------------------------------------------------------------------------- |
|
255 // description_if_needed |
|
256 // --------------------------------------------------------------------------- |
|
257 // |
|
258 EXPORT_C void CIRSettings::ReSetUpdateAvailableL() |
|
259 { |
|
260 IRLOG_DEBUG( "CIRSettings::ReSetUpdateAvailableL() - Entering" ); |
|
261 User::LeaveIfError ( iRepository->Set(KIRUpdateAvailablity, 0)); |
|
262 IRLOG_DEBUG( "CIRSettings::ReSetUpdateAvailableL() - Exiting" ); |
|
263 } |
|
264 |
|
265 |
|
266 // --------------------------------------------------------------------------- |
|
267 // description_if_needed |
|
268 // --------------------------------------------------------------------------- |
|
269 // |
|
270 EXPORT_C TInt CIRSettings::GetLogRunningNo() const |
|
271 { |
|
272 IRLOG_DEBUG( "CIRSettings::GetLogRunningNo() - Entering" ); |
|
273 TInt value = 1; |
|
274 TInt err = iRepository->Get(KIRSessionLogIndex, value); |
|
275 if(err) |
|
276 { |
|
277 IRLOG_DEBUG( "CIRSettings::GetLogRunningNo() - Error" ); |
|
278 } |
|
279 IRLOG_DEBUG( "CIRSettings::GetLogRunningNo() - Exiting" ); |
|
280 return value; |
|
281 } |
|
282 |
|
283 // --------------------------------------------------------------------------- |
|
284 // description_if_needed |
|
285 // --------------------------------------------------------------------------- |
|
286 // |
|
287 EXPORT_C void CIRSettings::SetLogRunningNoL() |
|
288 { |
|
289 IRLOG_DEBUG( "CIRSettings::SetLogRunningNoL() - Entering" ); |
|
290 TInt value = GetLogRunningNo(); |
|
291 value++; |
|
292 User::LeaveIfError ( iRepository->Set(KIRSessionLogIndex,value)); |
|
293 IRLOG_DEBUG( "CIRSettings::SetLogRunningNoL() - Exiting" ); |
|
294 } |
|
295 |
|
296 |
|
297 // --------------------------------------------------------------------------- |
|
298 // description_if_needed |
|
299 // --------------------------------------------------------------------------- |
|
300 // |
|
301 EXPORT_C void CIRSettings::SetTimeOutL(TInt aTimeOut) |
|
302 { |
|
303 IRLOG_DEBUG( "CIRSettings::SetTimeOutL() - Entering" ); |
|
304 User::LeaveIfError ( iRepository->Set(KIRHttpTimeout, aTimeOut) ); |
|
305 IRLOG_DEBUG( "CIRSettings::SetTimeOutL() - Exiting" ); |
|
306 } |
|
307 |
|
308 // --------------------------------------------------------------------------- |
|
309 // description_if_needed |
|
310 // --------------------------------------------------------------------------- |
|
311 // |
|
312 EXPORT_C TInt CIRSettings::GetTimeOut() const |
|
313 { |
|
314 IRLOG_DEBUG( "CIRSettings::GetTimeOut() - Entering" ); |
|
315 TInt value = KTimeSize; |
|
316 TInt err = iRepository->Get(KIRHttpTimeout, value) ; |
|
317 if(err) |
|
318 { |
|
319 IRLOG_DEBUG( "CIRSettings::GetTimeOut() - Error" ); |
|
320 } |
|
321 |
|
322 IRLOG_DEBUG( "CIRSettings::GetTimeOut() - Exiting" ); |
|
323 return value; |
|
324 } |
|
325 |
|
326 // --------------------------------------------------------------------------- |
|
327 // description_if_needed |
|
328 // --------------------------------------------------------------------------- |
|
329 // |
|
330 EXPORT_C void CIRSettings::SetSilencePeriodL(TUint aSilencePeriod) |
|
331 { |
|
332 IRLOG_DEBUG( "CIRSettings::SetSilencePeriodL() - Entering" ); |
|
333 User::LeaveIfError ( iRepository->Set(KIRNewVersionNotificationInterval, (TInt)aSilencePeriod) ); |
|
334 IRLOG_DEBUG( "CIRSettings::SetSilencePeriodL() - Exiting" ); |
|
335 } |
|
336 |
|
337 // --------------------------------------------------------------------------- |
|
338 // description_if_needed |
|
339 // --------------------------------------------------------------------------- |
|
340 // |
|
341 EXPORT_C TUint CIRSettings::GetSilencePeriodL() const |
|
342 { |
|
343 IRLOG_DEBUG( "CIRSettings::GetSilencePeriodL() - Entering" ); |
|
344 TInt value =0; |
|
345 User::LeaveIfError( iRepository->Get(KIRNewVersionNotificationInterval, value) ); |
|
346 IRLOG_DEBUG( "CIRSettings::GetSilencePeriodL() - Exiting" ); |
|
347 return value; |
|
348 } |
|
349 |
|
350 // --------------------------------------------------------------------------- |
|
351 // description_if_needed |
|
352 // --------------------------------------------------------------------------- |
|
353 // |
|
354 EXPORT_C void CIRSettings::SetSilencePeriodStartL(const TDesC& aSilencePeriodStart) |
|
355 { |
|
356 IRLOG_DEBUG( "CIRSettings::SetSilencePeriodStartL() - Entering" ); |
|
357 User::LeaveIfError ( iRepository->Set(KIRNewVersionNotificationStartingTime, aSilencePeriodStart) ); |
|
358 IRLOG_DEBUG( "CIRSettings::SetSilencePeriodStartL() - Exiting" ); |
|
359 } |
|
360 |
|
361 // --------------------------------------------------------------------------- |
|
362 // description_if_needed |
|
363 // --------------------------------------------------------------------------- |
|
364 // |
|
365 EXPORT_C const TDesC& CIRSettings::GetSilencePeriodStartL() const |
|
366 { |
|
367 IRLOG_DEBUG( "CIRSettings::GetSilencePeriodStartL() - Entering" ); |
|
368 User::LeaveIfError( iRepository->Get(KIRNewVersionNotificationStartingTime, |
|
369 (TDes&)iSilencePeriodStartTime) ); |
|
370 IRLOG_DEBUG( "CIRSettings::GetSilencePeriodStartL() - Exiting" ); |
|
371 return iSilencePeriodStartTime; |
|
372 } |
|
373 |
|
374 // --------------------------------------------------------------------------- |
|
375 // description_if_needed |
|
376 // --------------------------------------------------------------------------- |
|
377 // |
|
378 EXPORT_C void CIRSettings::SetPreferredQualityL(TInt aQualityValue) |
|
379 { |
|
380 IRLOG_DEBUG( "CIRSettings::SetPreferredQualityL() - Entering" ); |
|
381 User::LeaveIfError ( iRepository->Set(KIRPreferredQuality, aQualityValue) ); |
|
382 IRLOG_DEBUG( "CIRSettings::SetPreferredQualityL() - Exiting" ); |
|
383 } |
|
384 |
|
385 |
|
386 // --------------------------------------------------------------------------- |
|
387 // description_if_needed |
|
388 // --------------------------------------------------------------------------- |
|
389 // |
|
390 EXPORT_C TInt CIRSettings::GetPreferredQuality() const |
|
391 { |
|
392 IRLOG_DEBUG( "CIRSettings::GetPreferredQuality() - Entering" ); |
|
393 TInt value = 0; |
|
394 TInt err = iRepository->Get(KIRPreferredQuality, value); |
|
395 if(err) |
|
396 { |
|
397 IRLOG_DEBUG( "CIRSettings::GetPreferredQuality() - Error" ); |
|
398 } |
|
399 |
|
400 IRLOG_DEBUG( "CIRSettings::GetPreferredQuality() - Exiting" ); |
|
401 return value; |
|
402 } |
|
403 |
|
404 EXPORT_C TInt CIRSettings::GetSongHistoryShow() const |
|
405 { |
|
406 IRLOG_DEBUG( "CIRSettings::GetSongHistoryShow() - Entering" ); |
|
407 TInt value = 0; |
|
408 TInt err = iRepository->Get(KIRSongHistoryFTU, value); |
|
409 if(err) |
|
410 { |
|
411 IRLOG_DEBUG( "CIRSettings::GetSongHistoryShow() - Error" ); |
|
412 } |
|
413 |
|
414 IRLOG_DEBUG( "CIRSettings::GetSongHistoryShow() - Exiting" ); |
|
415 return value; |
|
416 } |
|
417 |
|
418 EXPORT_C void CIRSettings::SetSongHisotryShowL(TInt aShowFlag) |
|
419 { |
|
420 IRLOG_DEBUG( "CIRSettings::SetSongHisotryShow() - Entering" ); |
|
421 User::LeaveIfError(iRepository->Set(KIRSongHistoryFTU, aShowFlag)); |
|
422 IRLOG_DEBUG( "CIRSettings::SetSongHisotryShow() - Exiting" ); |
|
423 } |
|
424 |
|
425 // --------------------------------------------------------------------------- |
|
426 // description_if_needed |
|
427 // --------------------------------------------------------------------------- |
|
428 // |
|
429 EXPORT_C void CIRSettings::SetMaxPresetCountL(TInt aMaxCount) |
|
430 { |
|
431 IRLOG_DEBUG( "CIRSettings::SetMaxPresetCountL() - Entering" ); |
|
432 User::LeaveIfError ( iRepository->Set(KIRFavoritesMaxNum, aMaxCount) ); |
|
433 IRLOG_DEBUG( "CIRSettings::SetMaxPresetCountL() - Exiting" ); |
|
434 } |
|
435 |
|
436 // --------------------------------------------------------------------------- |
|
437 // description_if_needed |
|
438 // --------------------------------------------------------------------------- |
|
439 // |
|
440 EXPORT_C TInt CIRSettings::MaxPresetCount() |
|
441 { |
|
442 IRLOG_DEBUG( "CIRSettings::MaxPresetCount() - Entering" ); |
|
443 TInt value = KFifty; |
|
444 TInt err = iRepository->Get(KIRFavoritesMaxNum, value) ; |
|
445 if(err) |
|
446 { |
|
447 IRLOG_DEBUG( "CIRSettings::MaxPresetCount() - Error" ); |
|
448 } |
|
449 |
|
450 IRLOG_DEBUG( "CIRSettings::MaxPresetCount() - Exiting" ); |
|
451 return value; |
|
452 } |
|
453 |
|
454 |
|
455 // --------------------------------------------------------------------------- |
|
456 // description_if_needed |
|
457 // --------------------------------------------------------------------------- |
|
458 // |
|
459 EXPORT_C void CIRSettings::SetTimeCorrectionL(TInt aCorrection) |
|
460 { |
|
461 IRLOG_DEBUG( "CIRSettings::SetTimeCorrectionL() - Entering" ); |
|
462 User::LeaveIfError ( iRepository->Set(KIRTimeOffset, aCorrection) ); |
|
463 IRLOG_DEBUG( "CIRSettings::SetTimeCorrectionL() - Exiting" ); |
|
464 } |
|
465 |
|
466 // --------------------------------------------------------------------------- |
|
467 // description_if_needed |
|
468 // --------------------------------------------------------------------------- |
|
469 // |
|
470 EXPORT_C TInt CIRSettings::TimeCorrection() const |
|
471 { |
|
472 IRLOG_DEBUG( "CIRSettings::TimeCorrection() - Entering" ); |
|
473 TInt value = 0; |
|
474 TInt err = iRepository->Get(KIRTimeOffset, value) ; |
|
475 if(err) |
|
476 { |
|
477 IRLOG_DEBUG( "CIRSettings::TimeCorrection() - Error" ); |
|
478 } |
|
479 |
|
480 IRLOG_DEBUG( "CIRSettings::TimeCorrection() - Exiting" ); |
|
481 return value; |
|
482 } |
|
483 |
|
484 // --------------------------------------------------------------------------- |
|
485 // description_if_needed |
|
486 // --------------------------------------------------------------------------- |
|
487 // |
|
488 EXPORT_C const TDesC& CIRSettings::PrivatePath() const |
|
489 { |
|
490 IRLOG_DEBUG( "CIRSettings::PrivatePath" ); |
|
491 return iPrivatePath; |
|
492 } |
|
493 |
|
494 // --------------------------------------------------------------------------- |
|
495 // SetStartingViewIdL() |
|
496 // Sets the starting view Id in cenrep |
|
497 // --------------------------------------------------------------------------- |
|
498 // |
|
499 EXPORT_C void CIRSettings::SetStartingViewIdL(TUint32 aStartingViewId) |
|
500 { |
|
501 IRLOG_DEBUG( "CIRSettings::SetStartingViewIdL() - Entering" ); |
|
502 User::LeaveIfError ( iRepository->Set(KIRStartingViewId, (TInt)aStartingViewId) ); |
|
503 IRLOG_DEBUG( "CIRSettings::SetStartingViewIdL() - Exiting" ); |
|
504 } |
|
505 |
|
506 // --------------------------------------------------------------------------- |
|
507 // GetStartingViewIdL() |
|
508 // Gets the starting view Id from cenrep |
|
509 // --------------------------------------------------------------------------- |
|
510 // |
|
511 EXPORT_C TUint32 CIRSettings::GetStartingViewIdL() const |
|
512 { |
|
513 IRLOG_DEBUG( "CIRSettings::GetStartingViewIdL() - Entering" ); |
|
514 TInt value = 0; |
|
515 User::LeaveIfError( iRepository->Get(KIRStartingViewId, value) ); |
|
516 IRLOG_DEBUG( "CIRSettings::GetStartingViewIdL() - Exiting" ); |
|
517 return value; |
|
518 } |
|
519 |
|
520 // --------------------------------------------------------------------------- |
|
521 // GetGlobalAdvFlagL() |
|
522 // Gets the global advertisement flag from cenrep |
|
523 // --------------------------------------------------------------------------- |
|
524 // |
|
525 EXPORT_C TBool CIRSettings::GetGlobalAdvFlagL() |
|
526 { |
|
527 IRLOG_DEBUG( "CIRSettings::GetGlobalAdvFlagL() - Entering" ); |
|
528 TBool value = ETrue; |
|
529 User::LeaveIfError( iRepository->Get(KIRGlobalAdvEnabled, value) ); |
|
530 IRLOG_DEBUG( "CIRSettings::GetGlobalAdvFlagL() - Exiting" ); |
|
531 return value; |
|
532 } |
|
533 |
|
534 // --------------------------------------------------------------------------- |
|
535 // description_if_needed |
|
536 // --------------------------------------------------------------------------- |
|
537 // |
|
538 EXPORT_C const TDesC& CIRSettings::GetManuallyInputtedStationUrlL() const |
|
539 { |
|
540 IRLOG_DEBUG( "CIRSettings::GetManuallyInputtedStationUrlL() - Entering" ); |
|
541 User::LeaveIfError( iRepository->Get(KIRManuallyInputStationUrl, (TDes&)iStationUrl) ); |
|
542 IRLOG_DEBUG( "CIRSettings::GetManuallyInputtedStationUrlL() - Exiting" ); |
|
543 return iStationUrl; |
|
544 } |
|
545 |
|
546 // --------------------------------------------------------------------------- |
|
547 // description_if_needed |
|
548 // --------------------------------------------------------------------------- |
|
549 // |
|
550 EXPORT_C void CIRSettings::SetManuallyInputtedStationUrlL(const TDesC& aUrl) |
|
551 { |
|
552 IRLOG_DEBUG( "CIRSettings::SetManuallyInputtedStationUrlL() - Entering" ); |
|
553 User::LeaveIfError ( iRepository->Set(KIRManuallyInputStationUrl, aUrl) ); |
|
554 IRLOG_DEBUG( "CIRSettings::SetManuallyInputtedStationUrlL() - Exiting" ); |
|
555 } |
|
556 |
|
557 // --------------------------------------------------------------------------- |
|
558 // description_if_needed |
|
559 // --------------------------------------------------------------------------- |
|
560 // |
|
561 EXPORT_C const TDesC& CIRSettings::GetManuallyInputtedStationNameL() const |
|
562 { |
|
563 IRLOG_DEBUG( "CIRSettings::GetManuallyInputtedStationNameL() - Entering" ); |
|
564 User::LeaveIfError( iRepository->Get(KIRManuallyInputStationName, (TDes&)iStationName) ); |
|
565 IRLOG_DEBUG( "CIRSettings::GetManuallyInputtedStationNameL() - Exiting" ); |
|
566 return iStationName; |
|
567 } |
|
568 |
|
569 // --------------------------------------------------------------------------- |
|
570 // description_if_needed |
|
571 // --------------------------------------------------------------------------- |
|
572 // |
|
573 EXPORT_C void CIRSettings::SetManuallyInputtedStationNameL(const TDesC& aName) |
|
574 { |
|
575 IRLOG_DEBUG( "CIRSettings::SetManuallyInputtedStationNameL() - Entering" ); |
|
576 User::LeaveIfError ( iRepository->Set(KIRManuallyInputStationName, aName) ); |
|
577 IRLOG_DEBUG( "CIRSettings::SetManuallyInputtedStationNameL() - Exiting" ); |
|
578 } |