33 #include <DRMHelper.h> |
33 #include <DRMHelper.h> |
34 #include <caf/caf.h> |
34 #include <caf/caf.h> |
35 |
35 |
36 #include <ProfileEngineDomainConstants.h> |
36 #include <ProfileEngineDomainConstants.h> |
37 #include <StringLoader.h> |
37 #include <StringLoader.h> |
|
38 #include <featdiscovery.h> // CFeatureDiscovery |
|
39 #include <ProfileEngineDomainCRKeys.h> // KCRUidProfileEngine / KProEngRingingToneMaxSize |
38 |
40 |
39 // PathInfo for concatenating resource |
41 // PathInfo for concatenating resource |
40 #include <pathinfo.h> |
42 #include <pathinfo.h> |
41 // KDC_RESOURCE_DIR definition |
43 // KDC_RESOURCE_DIR definition |
42 #include <data_caging_path_literals.hrh> |
44 #include <data_caging_path_literals.hrh> |
43 |
|
44 #include <mediafilelist.h> |
45 #include <mediafilelist.h> |
45 |
46 |
46 |
47 |
47 // ============================ MEMBER FUNCTIONS =============================== |
48 // ============================ MEMBER FUNCTIONS =============================== |
48 |
49 |
228 // Do not show videos, use new FileList API |
229 // Do not show videos, use new FileList API |
229 filelist->AddExclusiveMediaTypeL( ECLFMediaTypeVideo ); |
230 filelist->AddExclusiveMediaTypeL( ECLFMediaTypeVideo ); |
230 // Make sure that iOffToneFile is passed, in case iToneFile happens to be KNullDesC |
231 // Make sure that iOffToneFile is passed, in case iToneFile happens to be KNullDesC |
231 ASSERT(!IsEmpty(iToneFile)); |
232 ASSERT(!IsEmpty(iToneFile)); |
232 |
233 |
|
234 // Do not show items over the file size limit, if configured. |
|
235 if ( CFeatureDiscovery::IsFeatureSupportedL( |
|
236 KFeatureIdFfLimitedMessageAndAlarmToneSize ) ) |
|
237 { |
|
238 // Max file size allowed (in KB). 0 == no limit. |
|
239 TInt fileSizeLimit = 0; |
|
240 CRepository* profilesCenRep = CRepository::NewLC( KCRUidProfileEngine ); |
|
241 |
|
242 // Reading the repository should not fail, but if it does, the default |
|
243 // value we have for the file size limit is acceptable. |
|
244 profilesCenRep->Get( KProEngRingingToneMaxSize, fileSizeLimit ); // codescanner::crepository |
|
245 CleanupStack::PopAndDestroy( profilesCenRep ); |
|
246 |
|
247 if ( fileSizeLimit > 0 ) |
|
248 { |
|
249 filelist->SetMaxFileSize( fileSizeLimit * KKilo ); |
|
250 } |
|
251 } |
233 TBool ok( filelist->LaunchL( iToneFile, *iPopupHeader ) ); |
252 TBool ok( filelist->LaunchL( iToneFile, *iPopupHeader ) ); |
234 |
|
235 |
253 |
236 CleanupStack::PopAndDestroy( filelist ); // filelist |
254 CleanupStack::PopAndDestroy( filelist ); // filelist |
237 #else |
255 #else |
238 CMediaFileList* list = CMediaFileList::NewL(); |
256 CMediaFileList* list = CMediaFileList::NewL(); |
239 CleanupStack::PushL(list); |
257 CleanupStack::PushL(list); |
249 // default tone |
267 // default tone |
250 list->SetNullItemL(*iToneDefaultText, iDefaultToneFile, |
268 list->SetNullItemL(*iToneDefaultText, iDefaultToneFile, |
251 CMediaFileList::EMediaFileTypeAudio, |
269 CMediaFileList::EMediaFileTypeAudio, |
252 CMediaFileList::ENullItemIconOff); |
270 CMediaFileList::ENullItemIconOff); |
253 |
271 |
254 list->SetAttrL(CMediaFileList::EAttrExcludeMimeType, CMediaFileList::EMediaFileTypeVideo); |
272 list->SetAttrL(CMediaFileList::EAttrExcludeFolder, CMediaFileList::EMediaFileTypeVideo); |
255 list->SetAttrL(CMediaFileList::EAttrAutomatedType, CDRMHelper::EAutomatedTypeCalendarAlarm); |
273 list->SetAttrL(CMediaFileList::EAttrAutomatedType, CDRMHelper::EAutomatedTypeCalendarAlarm); |
256 |
274 |
|
275 // Do not show items over the file size limit, if configured. |
|
276 if ( CFeatureDiscovery::IsFeatureSupportedL( |
|
277 KFeatureIdFfLimitedMessageAndAlarmToneSize ) ) |
|
278 { |
|
279 // Max file size allowed (in KB). 0 == no limit. |
|
280 TInt fileSizeLimit = 0; |
|
281 CRepository* profilesCenRep = CRepository::NewLC( KCRUidProfileEngine ); |
|
282 |
|
283 // Reading the repository should not fail, but if it does, the default |
|
284 // value we have for the file size limit is acceptable. |
|
285 profilesCenRep->Get( KProEngRingingToneMaxSize, fileSizeLimit ); // codescanner::crepository |
|
286 CleanupStack::PopAndDestroy( profilesCenRep ); |
|
287 |
|
288 if ( fileSizeLimit > 0 ) |
|
289 { |
|
290 list->SetAttrL( CMediaFileList::EAttrFileSize, fileSizeLimit ); |
|
291 } |
|
292 } |
257 // Make sure that iOffToneFile is passed, in case iToneFile happens to be KNullDesC |
293 // Make sure that iOffToneFile is passed, in case iToneFile happens to be KNullDesC |
258 ASSERT(!IsEmpty(iToneFile)); |
294 ASSERT(!IsEmpty(iToneFile)); |
259 |
295 |
260 TBool ok = !list->ShowMediaFileListL(&iToneFile, &nullItem, |
296 TBool ok = !list->ShowMediaFileListL(&iToneFile, &nullItem, |
261 NULL, NULL ); |
297 NULL, NULL ); |
262 |
298 |
263 |
299 |
264 CleanupStack::PopAndDestroy(list); |
300 CleanupStack::PopAndDestroy(list); |
265 #endif |
301 #endif |
266 |
302 if( ok ) |
267 if (ok) |
|
268 { |
303 { |
269 iAlarmSoundChanged = ETrue; |
304 iAlarmSoundChanged = ETrue; |
270 StoreL(); |
305 StoreL(); |
271 UpdateListBoxTextL(); |
306 UpdateListBoxTextL(); |
272 } |
307 } |
|
308 |
273 |
309 |
274 TRACE_EXIT_POINT; |
310 TRACE_EXIT_POINT; |
275 } |
311 } |
276 |
312 |
277 // ----------------------------------------------------------------------------- |
313 // ----------------------------------------------------------------------------- |