equal
deleted
inserted
replaced
245 // --------------------------------------------------------------------------- |
245 // --------------------------------------------------------------------------- |
246 // |
246 // |
247 // --------------------------------------------------------------------------- |
247 // --------------------------------------------------------------------------- |
248 // |
248 // |
249 EXPORT_C TBool CHnMdModel::IsForegroundQueued() const |
249 EXPORT_C TBool CHnMdModel::IsForegroundQueued() const |
250 { |
250 { |
251 return iForegroundQueued; |
251 return iForegroundQueued; |
252 } |
252 } |
253 |
253 |
254 // --------------------------------------------------------------------------- |
254 // --------------------------------------------------------------------------- |
255 // |
255 // |
256 // --------------------------------------------------------------------------- |
256 // --------------------------------------------------------------------------- |
257 // |
257 // |
262 User::Leave( KErrArgument ); |
262 User::Leave( KErrArgument ); |
263 } |
263 } |
264 |
264 |
265 if ( IsForegroundQueued() && ( !iForegroundTriggeringSuite || |
265 if ( IsForegroundQueued() && ( !iForegroundTriggeringSuite || |
266 iForegroundTriggeringSuite == aJustEvaluatedSuite ) ) |
266 iForegroundTriggeringSuite == aJustEvaluatedSuite ) ) |
267 { |
267 { |
268 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
268 CLiwGenericParamList* pl = CLiwGenericParamList::NewL(); |
269 CleanupStack::PushL( pl ); |
269 CleanupStack::PushL( pl ); |
270 iCmnPtrs.iModelEventObserver->HandleModelEventL( KAppGainForeground, *pl ); |
270 iCmnPtrs.iModelEventObserver->HandleModelEventL( KAppGainForeground, *pl ); |
271 CleanupStack::PopAndDestroy( pl ); |
271 CleanupStack::PopAndDestroy( pl ); |
272 QueueForeground( ENever ); |
272 QueueForeground( ENever ); |
273 } |
273 } |
274 } |
274 } |
275 |
275 |
276 // --------------------------------------------------------------------------- |
276 // --------------------------------------------------------------------------- |
277 // |
277 // |
278 // --------------------------------------------------------------------------- |
278 // --------------------------------------------------------------------------- |
314 EXPORT_C TInt CHnMdModel::LoadSuiteL( const TDesC& aGenre, |
314 EXPORT_C TInt CHnMdModel::LoadSuiteL( const TDesC& aGenre, |
315 CLiwGenericParamList* aSuiteParams ) |
315 CLiwGenericParamList* aSuiteParams ) |
316 { |
316 { |
317 TInt err( KErrNone ); |
317 TInt err( KErrNone ); |
318 |
318 |
319 RXmlEngDocument xmlDoc; |
319 RXmlEngDocument xmlDoc; |
320 // Xml model provider takes ownership of xmlDoc. |
320 // Xml model provider takes ownership of xmlDoc. |
321 TRAP( err, iXmlModelProvider->GetModelL( aGenre, xmlDoc ) ); |
321 TRAP( err, iXmlModelProvider->GetModelL( aGenre, xmlDoc ) ); |
322 |
322 |
323 TXmlEngElement element; |
323 TXmlEngElement element; |
324 if ( !err ) |
324 if ( !err ) |
325 { |
325 { |
326 element = xmlDoc.DocumentElement().AsElement(); |
326 element = xmlDoc.DocumentElement().AsElement(); |
327 if ( element.Name() != KContentElementName8 ) |
327 if ( element.Name() != KContentElementName8 ) |
328 { |
328 { |
340 } |
340 } |
341 |
341 |
342 TInt pos( 0 ); |
342 TInt pos( 0 ); |
343 newSuite->GetSuiteParameters().FindFirst( pos, KSuiteName8); |
343 newSuite->GetSuiteParameters().FindFirst( pos, KSuiteName8); |
344 if ( pos == KErrNotFound ) |
344 if ( pos == KErrNotFound ) |
345 { |
345 { |
346 newSuite->GetSuiteParameters().AppendL( |
346 newSuite->GetSuiteParameters().AppendL( |
347 TLiwGenericParam(KSuiteName8, TLiwVariant( aGenre ) ) ); |
347 TLiwGenericParam(KSuiteName8, TLiwVariant( aGenre ) ) ); |
348 } |
348 } |
349 |
349 |
350 iCmnPtrs.iContainer->PushNewSuiteModelL( newSuite->SuiteName() ); |
350 iCmnPtrs.iContainer->PushNewSuiteModelL( newSuite->SuiteName() ); |
351 iCmnPtrs.iContainer->GetLastSuiteModel()->GetItemsOrder()-> |
351 iCmnPtrs.iContainer->GetLastSuiteModel()->GetItemsOrder()-> |
352 SetSuiteId( iCmnPtrs.iIdGenerator->GetNextId() ); |
352 SetSuiteId( iCmnPtrs.iIdGenerator->GetNextId() ); |
353 |
353 |
354 CleanupStack::Pop( newSuite ); |
354 CleanupStack::Pop( newSuite ); |
355 iLoadedSuites.AppendL( newSuite ); |
355 iLoadedSuites.AppendL( newSuite ); |
356 } |
356 } |
357 else |
357 else |
358 { |
358 { |
359 MMPERF(("CHnMdModel::LoadSuiteL - Error TRAPPED!")); |
359 MMPERF(("CHnMdModel::LoadSuiteL - Error TRAPPED!")); |
360 } |
360 } |
361 |
361 |
362 return err; |
362 return err; |
363 } |
363 } |
364 |
364 |
365 // --------------------------------------------------------------------------- |
365 // --------------------------------------------------------------------------- |
393 // --------------------------------------------------------------------------- |
393 // --------------------------------------------------------------------------- |
394 // |
394 // |
395 // --------------------------------------------------------------------------- |
395 // --------------------------------------------------------------------------- |
396 // |
396 // |
397 TInt CHnMdModel::LoadedSuitesCount() |
397 TInt CHnMdModel::LoadedSuitesCount() |
398 { |
398 { |
399 return iLoadedSuites.Count(); |
399 return iLoadedSuites.Count(); |
400 } |
400 } |
401 |
401 |
402 |
402 |