224 } |
225 } |
225 |
226 |
226 GlxSetAppState::SetState(EGlxInListView); |
227 GlxSetAppState::SetState(EGlxInListView); |
227 |
228 |
228 // Separate contexts so that some attributes are loaded before others |
229 // Separate contexts so that some attributes are loaded before others |
229 iThumbnailIterator.SetRangeOffsets(KListDataWindowSize, |
230 // No need to fetch the rear pages as we do not support looping |
230 KListDataWindowSize); |
231 iThumbnailIterator.SetRangeOffsets(0, KListDataWindowSize); |
231 iTitleAttributeContext = new (ELeave) CGlxAttributeContext( |
232 |
232 &iThumbnailIterator); |
233 iTitleAttributeContext = CGlxDefaultAttributeContext::NewL(); |
|
234 iTitleAttributeContext->SetRangeOffsets(0, KMaxTInt); |
233 iTitleAttributeContext->AddAttributeL(KMPXMediaGeneralTitle); |
235 iTitleAttributeContext->AddAttributeL(KMPXMediaGeneralTitle); |
234 |
236 |
235 iSubtitleAttributeContext = new (ELeave) CGlxAttributeContext( |
237 iSubtitleAttributeContext = new (ELeave) CGlxAttributeContext( |
236 &iThumbnailIterator); |
238 &iThumbnailIterator); |
237 iSubtitleAttributeContext->AddAttributeL( |
239 iSubtitleAttributeContext->AddAttributeL( |
238 KGlxMediaCollectionPluginSpecificSubTitle); |
240 KGlxMediaCollectionPluginSpecificSubTitle); |
239 |
241 |
240 iMediaList->AddContextL(iTitleAttributeContext, KMaxTInt); |
242 iMediaList->AddContextL(iTitleAttributeContext, KMaxTInt); |
241 iMediaList->AddContextL(iSubtitleAttributeContext, KMaxTInt); |
243 iMediaList->AddContextL(iSubtitleAttributeContext, KGlxFetchContextPriorityNormal); |
242 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
244 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
243 { |
245 { |
|
246 iOtherAttribsContext = new (ELeave) CGlxAttributeContext( |
|
247 &iThumbnailIterator); |
|
248 iOtherAttribsContext->AddAttributeL(KMPXMediaGeneralCount); |
|
249 |
|
250 iNonVisibleThumbnailIterator.SetRangeOffsets(0, KListNonVisibleDataWindowSize); |
|
251 iNonVisibleSubtitleAttributeContext |
|
252 = new (ELeave) CGlxAttributeContext( |
|
253 &iNonVisibleThumbnailIterator); |
|
254 iNonVisibleSubtitleAttributeContext->AddAttributeL( |
|
255 KGlxMediaCollectionPluginSpecificSubTitle); |
|
256 iMediaList->AddContextL(iNonVisibleSubtitleAttributeContext, |
|
257 KGlxFetchContextPriorityLow); |
|
258 iNonVisibleOtherAttribsContext = new (ELeave) CGlxAttributeContext( |
|
259 &iNonVisibleThumbnailIterator); |
|
260 iNonVisibleOtherAttribsContext->AddAttributeL(KMPXMediaGeneralCount); |
|
261 |
|
262 CMPXCollectionPath* path = iMediaList->PathLC( |
|
263 NGlxListDefs::EPathParent); |
|
264 if (path->Id(0) == KGlxCollectionPluginAlbumsImplementationUid) |
|
265 { |
|
266 iOtherAttribsContext->AddAttributeL(KGlxMediaGeneralSystemItem); |
|
267 iOtherAttribsContext->AddAttributeL( |
|
268 KGlxMediaGeneralSlideshowableContent); |
|
269 |
|
270 iNonVisibleOtherAttribsContext->AddAttributeL( |
|
271 KGlxMediaGeneralSystemItem); |
|
272 iNonVisibleOtherAttribsContext->AddAttributeL( |
|
273 KGlxMediaGeneralSlideshowableContent); |
|
274 } |
|
275 CleanupStack::PopAndDestroy(path); |
|
276 |
|
277 iMediaList->AddContextL(iOtherAttribsContext, |
|
278 KGlxFetchContextPriorityNormal); |
244 iThumbnailContext = new (ELeave) CGlxAttributeContext( |
279 iThumbnailContext = new (ELeave) CGlxAttributeContext( |
245 &iThumbnailIterator); |
280 &iThumbnailIterator); |
246 TMPXAttribute tnAttr(KGlxMediaIdThumbnail, |
281 TMPXAttribute tnAttr(KGlxMediaIdThumbnail, |
247 GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
282 GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
248 iGridIconSize.iHeight)); |
283 iGridIconSize.iHeight)); |
249 iThumbnailContext->SetDefaultSpec(iGridIconSize.iWidth, |
284 iThumbnailContext->SetDefaultSpec(iGridIconSize.iWidth, |
250 iGridIconSize.iHeight); |
285 iGridIconSize.iHeight); |
251 iThumbnailContext->AddAttributeL(tnAttr); |
286 iThumbnailContext->AddAttributeL(tnAttr); |
252 iMediaList->AddContextL(iThumbnailContext, |
287 iMediaList->AddContextL(iThumbnailContext, |
253 KGlxFetchContextPriorityNormal); |
288 KGlxFetchContextPriorityNormal); |
|
289 |
|
290 iMediaList->AddContextL(iNonVisibleOtherAttribsContext, |
|
291 KGlxFetchContextPriorityLow); |
|
292 iNonVisibleThumbnailContext = new (ELeave) CGlxAttributeContext( |
|
293 &iNonVisibleThumbnailIterator); |
|
294 iNonVisibleThumbnailContext->SetDefaultSpec(iGridIconSize.iWidth, |
|
295 iGridIconSize.iHeight); |
|
296 iNonVisibleThumbnailContext->AddAttributeL(tnAttr); |
|
297 iMediaList->AddContextL(iNonVisibleThumbnailContext, |
|
298 KGlxFetchContextPriorityLow); |
254 } |
299 } |
255 |
300 |
256 iMediaList->AddMediaListObserverL(this); |
301 iMediaList->AddMediaListObserverL(this); |
257 TRect apRect = iEikonEnv->EikAppUi()->ApplicationRect(); |
302 TRect apRect = iEikonEnv->EikAppUi()->ApplicationRect(); |
258 iBgContext = CAknsBasicBackgroundControlContext::NewL( |
303 iBgContext = CAknsBasicBackgroundControlContext::NewL( |
259 KAknsIIDQsnBgScreen,apRect,ETrue); |
304 KAknsIIDQsnBgScreen,apRect,ETrue); |
260 |
305 |
261 if(iUiUtility->ViewNavigationDirection() == EGlxNavigationBackwards ) |
306 iBackwardNavigation = (iUiUtility->ViewNavigationDirection() |
262 { |
307 == EGlxNavigationBackwards); |
263 iBackwardNavigation = ETrue; |
308 GLX_LOG_INFO1("CGlxListViewImp::DoMLViewActivateL() - " |
264 } |
309 "iBackwardNavigation(%d)", iBackwardNavigation); |
265 |
310 |
266 iPreviewTNBinding = CGlxPreviewThumbnailBinding::NewL(*this); |
311 iPreviewTNBinding = CGlxPreviewThumbnailBinding::NewL(*this); |
267 CreateListL(); |
312 CreateListL(); |
268 if (iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot && iPreviewTNBinding |
313 if (iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot && iPreviewTNBinding |
269 && iBackwardNavigation && iMediaList->FocusIndex() == 0) |
314 && iBackwardNavigation && iMediaList->FocusIndex() == 0) |
300 TRAP_IGNORE(CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL( |
345 TRAP_IGNORE(CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL( |
301 TUid::Uid( EEikStatusPaneUidTitle )); |
346 TUid::Uid( EEikStatusPaneUidTitle )); |
302 iTitletext = titlePane->Text()->AllocL()); |
347 iTitletext = titlePane->Text()->AllocL()); |
303 } |
348 } |
304 |
349 |
305 iMediaList->RemoveContext( iTitleAttributeContext ); |
350 RemoveContext(); |
306 delete iTitleAttributeContext; |
|
307 iTitleAttributeContext = NULL; |
|
308 |
|
309 iMediaList->RemoveContext( iSubtitleAttributeContext ); |
|
310 delete iSubtitleAttributeContext; |
|
311 iSubtitleAttributeContext = NULL; |
|
312 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
|
313 { |
|
314 iMediaList->RemoveContext(iThumbnailContext); |
|
315 delete iThumbnailContext; |
|
316 iThumbnailContext = NULL; |
|
317 } |
|
318 iMediaList->RemoveMediaListObserver( this ); |
351 iMediaList->RemoveMediaListObserver( this ); |
319 delete iPreviewTNBinding; |
352 delete iPreviewTNBinding; |
320 iPreviewTNBinding = NULL; |
353 iPreviewTNBinding = NULL; |
321 DestroyListViewWidget(); |
354 DestroyListViewWidget(); |
322 if(iProgressIndicator) |
355 if(iProgressIndicator) |
328 delete iMMCNotifier; |
361 delete iMMCNotifier; |
329 iMMCNotifier = NULL; |
362 iMMCNotifier = NULL; |
330 } |
363 } |
331 |
364 |
332 // --------------------------------------------------------------------------- |
365 // --------------------------------------------------------------------------- |
|
366 // RemoveContext |
|
367 // --------------------------------------------------------------------------- |
|
368 // |
|
369 void CGlxListViewImp::RemoveContext() |
|
370 { |
|
371 TRACER("CGlxListViewImp::DoMLViewDeactivate"); |
|
372 |
|
373 if (iTitleAttributeContext) |
|
374 { |
|
375 iMediaList->RemoveContext(iTitleAttributeContext); |
|
376 delete iTitleAttributeContext; |
|
377 iTitleAttributeContext = NULL; |
|
378 } |
|
379 |
|
380 if (iSubtitleAttributeContext) |
|
381 { |
|
382 iMediaList->RemoveContext(iSubtitleAttributeContext); |
|
383 delete iSubtitleAttributeContext; |
|
384 iSubtitleAttributeContext = NULL; |
|
385 } |
|
386 |
|
387 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
|
388 { |
|
389 if (iOtherAttribsContext) |
|
390 { |
|
391 iMediaList->RemoveContext(iOtherAttribsContext); |
|
392 delete iOtherAttribsContext; |
|
393 iOtherAttribsContext = NULL; |
|
394 } |
|
395 |
|
396 if (iThumbnailContext) |
|
397 { |
|
398 iMediaList->RemoveContext(iThumbnailContext); |
|
399 delete iThumbnailContext; |
|
400 iThumbnailContext = NULL; |
|
401 } |
|
402 |
|
403 if (iNonVisibleSubtitleAttributeContext) |
|
404 { |
|
405 iMediaList->RemoveContext(iNonVisibleSubtitleAttributeContext); |
|
406 delete iNonVisibleSubtitleAttributeContext; |
|
407 iNonVisibleSubtitleAttributeContext = NULL; |
|
408 } |
|
409 |
|
410 if (iNonVisibleOtherAttribsContext) |
|
411 { |
|
412 iMediaList->RemoveContext(iNonVisibleOtherAttribsContext); |
|
413 delete iNonVisibleOtherAttribsContext; |
|
414 iNonVisibleOtherAttribsContext = NULL; |
|
415 } |
|
416 |
|
417 if (iNonVisibleThumbnailContext) |
|
418 { |
|
419 iMediaList->RemoveContext(iNonVisibleThumbnailContext); |
|
420 delete iNonVisibleThumbnailContext; |
|
421 iNonVisibleThumbnailContext = NULL; |
|
422 } |
|
423 } |
|
424 } |
|
425 |
|
426 // --------------------------------------------------------------------------- |
333 // Destroys the Widget |
427 // Destroys the Widget |
334 // --------------------------------------------------------------------------- |
428 // --------------------------------------------------------------------------- |
335 // |
429 // |
336 void CGlxListViewImp::DestroyListViewWidget() |
430 void CGlxListViewImp::DestroyListViewWidget() |
337 { |
431 { |
528 iNextViewActivationEnabled = EFalse; |
622 iNextViewActivationEnabled = EFalse; |
529 |
623 |
530 //Navigate to the next view |
624 //Navigate to the next view |
531 iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards); |
625 iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards); |
532 GLX_LOG_INFO("CGlxListViewImp::HandleOpenL()- EGlxNavigationForwards!"); |
626 GLX_LOG_INFO("CGlxListViewImp::HandleOpenL()- EGlxNavigationForwards!"); |
533 |
|
534 CMPXCollectionPath* path = iMediaList->PathLC( |
627 CMPXCollectionPath* path = iMediaList->PathLC( |
535 NGlxListDefs::EPathFocusOrSelection); |
628 NGlxListDefs::EPathFocusOrSelection); |
536 |
629 |
537 // When a collection is opened for browsing, |
630 // When a collection is opened for browsing, |
538 // there are two queries executed with similar filter. |
631 // there are two queries executed with similar filter. |
539 // First query to open the collection from list / cloud view. |
632 // First query to open the collection from list / cloud view. |
540 // Second one from grid view construction. To improve the grid opening |
633 // Second one from grid/list view construction. To improve the grid/list |
541 // performance, the first query will be completed with empty Id list. |
634 // opening performance, the first query will be completed with empty Id list. |
542 CMPXCollectionPath* pathParent = iMediaList->PathLC( |
635 RArray<TMPXAttribute> attributeArray; |
543 NGlxListDefs::EPathParent); |
636 CleanupClosePushL(attributeArray); |
544 |
637 attributeArray.AppendL(KGlxFilterGeneralNavigationalStateOnly); |
545 if ((iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot && path->Id(0) |
638 iCollectionUtility->Collection().OpenL(*path, attributeArray.Array()); |
546 == KGlxCollectionPluginAllImplementationUid) |
639 CleanupStack::PopAndDestroy(&attributeArray); |
547 || (pathParent->Id() |
|
548 == KGlxCollectionPluginMonthsImplementationUid) |
|
549 || (pathParent->Id() |
|
550 == KGlxCollectionPluginAlbumsImplementationUid)) |
|
551 { |
|
552 RArray<TMPXAttribute> attributeArray; |
|
553 CleanupClosePushL(attributeArray); |
|
554 attributeArray.AppendL(KGlxFilterGeneralNavigationalStateOnly); |
|
555 iCollectionUtility->Collection().OpenL(*path, |
|
556 attributeArray.Array()); |
|
557 CleanupStack::PopAndDestroy(&attributeArray); |
|
558 } |
|
559 else |
|
560 { |
|
561 iCollectionUtility->Collection().OpenL(*path); |
|
562 } |
|
563 |
|
564 CleanupStack::PopAndDestroy(pathParent); |
|
565 CleanupStack::PopAndDestroy(path); |
640 CleanupStack::PopAndDestroy(path); |
566 } |
641 } |
567 } |
642 } |
568 |
643 |
569 void CGlxListViewImp::PreviewTNReadyL(CFbsBitmap* aBitmap, CFbsBitmap* |
644 void CGlxListViewImp::PreviewTNReadyL(CFbsBitmap* aBitmap, CFbsBitmap* |
754 GLX_DEBUG1("CGlxListViewImp::CreateListL() - SetEmptyTextL()"); |
821 GLX_DEBUG1("CGlxListViewImp::CreateListL() - SetEmptyTextL()"); |
755 //set the text to be shown if the list is empty. |
822 //set the text to be shown if the list is empty. |
756 HBufC* emptyText = StringLoader::LoadLC(R_LIST_EMPTY_VIEW_TEXT); |
823 HBufC* emptyText = StringLoader::LoadLC(R_LIST_EMPTY_VIEW_TEXT); |
757 iList->SetEmptyTextL(*emptyText); |
824 iList->SetEmptyTextL(*emptyText); |
758 CleanupStack::PopAndDestroy(emptyText); |
825 CleanupStack::PopAndDestroy(emptyText); |
|
826 |
|
827 //While coming back to main listview |
|
828 TGlxIdSpaceId id = iMediaList->IdSpaceId(0); |
|
829 if((id == KGlxIdSpaceIdRoot) && (mediaCount > 0)) |
|
830 { |
|
831 for (TInt i = 0; i < mediaCount; i++) |
|
832 { |
|
833 SetDefaultThumbnailL(i); |
|
834 } |
|
835 } |
759 } |
836 } |
760 |
837 |
761 //Fix for ESLM-7SAHPT::Clear Flag to Disable QWERTY search input in list view |
838 //Fix for ESLM-7SAHPT::Clear Flag to Disable QWERTY search input in list view |
762 iList->ClearFlags(CHgScroller::EHgScrollerSearchWithQWERTY ); |
839 iList->ClearFlags(CHgScroller::EHgScrollerSearchWithQWERTY ); |
763 |
840 |
764 //While coming back to main listview |
|
765 TGlxIdSpaceId id = iMediaList->IdSpaceId(0); |
|
766 if((id == KGlxIdSpaceIdRoot) && (mediaCount > 0)) |
|
767 { |
|
768 for (TInt i = 0; i < mediaCount; i++) |
|
769 { |
|
770 SetDefaultThumbnailL(i); |
|
771 } |
|
772 } |
|
773 // Set the scrollbar type for albums list |
841 // Set the scrollbar type for albums list |
774 if (path->Id() == KGlxCollectionPluginAlbumsImplementationUid) |
842 if (path->Id() == KGlxCollectionPluginAlbumsImplementationUid) |
775 { |
843 { |
776 iList->SetScrollBarTypeL(CHgScroller::EHgScrollerLetterStripLite ); |
844 iList->SetScrollBarTypeL(CHgScroller::EHgScrollerLetterStripLite ); |
777 } |
845 } |
815 for (TInt i = aStartIndex; i<= aEndIndex; i++) |
882 for (TInt i = aStartIndex; i<= aEndIndex; i++) |
816 { |
883 { |
817 const TGlxMedia& item = iMediaList->Item(i); |
884 const TGlxMedia& item = iMediaList->Item(i); |
818 iList->ItemL(i).SetTitleL(item.Title()); |
885 iList->ItemL(i).SetTitleL(item.Title()); |
819 iList->ItemL(i).SetTextL(item.SubTitle()); |
886 iList->ItemL(i).SetTextL(item.SubTitle()); |
820 SetDefaultThumbnailL(i); |
887 if (iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot) |
|
888 { |
|
889 SetDefaultThumbnailL(i); |
|
890 } |
821 } |
891 } |
822 |
892 |
823 if(aStartIndex == aEndIndex ) |
893 if(aStartIndex == aEndIndex ) |
824 { |
894 { |
825 iLastFocusedIndex = aStartIndex; |
895 iLastFocusedIndex = aStartIndex; |
826 iPopulateListTNs = EFalse; |
896 iPopulateListTNs = EFalse; |
827 iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex); |
897 iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex); |
828 } |
898 iList->SetSelectedIndex(iLastFocusedIndex); |
829 |
899 iList->RefreshScreen(iLastFocusedIndex); |
830 iList->SetSelectedIndex(iLastFocusedIndex); |
900 } |
831 iList->RefreshScreen(iLastFocusedIndex); |
|
832 } |
901 } |
833 } |
902 } |
834 |
903 |
835 // ---------------------------------------------------------------------------- |
904 // ---------------------------------------------------------------------------- |
836 // HandleItemRemoved |
905 // HandleItemRemoved |
872 const TGlxMedia& item = iMediaList->Item(aItemIndex); |
941 const TGlxMedia& item = iMediaList->Item(aItemIndex); |
873 |
942 |
874 if (KErrNotFound != aAttributes.Find(titleAttrib, match)) |
943 if (KErrNotFound != aAttributes.Find(titleAttrib, match)) |
875 { |
944 { |
876 iList->ItemL(aItemIndex).SetTitleL(item.Title()); |
945 iList->ItemL(aItemIndex).SetTitleL(item.Title()); |
877 iList->RefreshScreen(aItemIndex); |
946 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
|
947 { |
|
948 iList->RefreshScreen(aItemIndex); |
|
949 } |
878 } |
950 } |
879 |
951 |
880 if (KErrNotFound != aAttributes.Find(subTitleAttrib, match)) |
952 if (KErrNotFound != aAttributes.Find(subTitleAttrib, match)) |
881 { |
953 { |
882 iList->ItemL(aItemIndex).SetTextL(item.SubTitle()); |
954 iList->ItemL(aItemIndex).SetTextL(item.SubTitle()); |
883 iList->RefreshScreen(aItemIndex); |
955 |
884 |
956 if (iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot) |
|
957 { |
|
958 RefreshList(aItemIndex); |
|
959 } |
|
960 else |
|
961 { |
|
962 iList->RefreshScreen(aItemIndex); |
|
963 } |
|
964 |
885 // If there is some modified in grid/fullscreen view, |
965 // If there is some modified in grid/fullscreen view, |
886 // HandleAttributesAvailableL will get called. Here we are setting |
966 // HandleAttributesAvailableL will get called. Here we are setting |
887 // iIsRefreshNeeded flag to ETrue |
967 // iIsRefreshNeeded flag to ETrue |
888 if (!iIsRefreshNeeded && iBackwardNavigation) |
968 if (!iIsRefreshNeeded && iBackwardNavigation) |
889 { |
969 { |
910 iPreviewTNBinding->HandleItemChangedL(*path, iPopulateListTNs, |
986 iPreviewTNBinding->HandleItemChangedL(*path, iPopulateListTNs, |
911 iIsRefreshNeeded, iBackwardNavigation); |
987 iIsRefreshNeeded, iBackwardNavigation); |
912 CleanupStack::PopAndDestroy(path); |
988 CleanupStack::PopAndDestroy(path); |
913 } |
989 } |
914 } |
990 } |
915 TMPXAttribute thumbnailAttribute(KGlxMediaIdThumbnail, |
991 |
916 GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
992 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
917 iGridIconSize.iHeight)); |
993 { |
918 if (KErrNotFound != aAttributes.Find(thumbnailAttribute, match)) |
994 TMPXAttribute countAttrib(KMPXMediaGeneralCount); |
919 { |
995 TMPXAttribute thumbnailAttribute(KGlxMediaIdThumbnail, |
920 if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot) |
996 GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
921 { |
997 iGridIconSize.iHeight)); |
922 UpdatePreviewL(aItemIndex); |
998 if ((KErrNotFound != aAttributes.Find(thumbnailAttribute, match)) |
923 iIsRefreshNeeded = EFalse; |
999 || (KErrNotFound != aAttributes.Find(countAttrib, match))) |
924 } |
1000 { |
925 } |
1001 iIsRefreshNeeded = EFalse; |
|
1002 UpdatePreviewL(aItemIndex); |
|
1003 } |
|
1004 } |
926 } |
1005 } |
927 |
1006 |
928 // ---------------------------------------------------------------------------- |
1007 // ---------------------------------------------------------------------------- |
929 // HandleFocusChangedL |
1008 // HandleFocusChangedL |
930 // ---------------------------------------------------------------------------- |
1009 // ---------------------------------------------------------------------------- |
1242 TMPXAttribute thumbnailAttribute(KGlxMediaIdThumbnail, |
1321 TMPXAttribute thumbnailAttribute(KGlxMediaIdThumbnail, |
1243 GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
1322 GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth, |
1244 iGridIconSize.iHeight)); |
1323 iGridIconSize.iHeight)); |
1245 GLX_LOG_INFO1("CGlxListViewImp::UpdatePreviewL(aIndex = %d)", aIndex); |
1324 GLX_LOG_INFO1("CGlxListViewImp::UpdatePreviewL(aIndex = %d)", aIndex); |
1246 const TGlxMedia& item = iMediaList->Item(aIndex); |
1325 const TGlxMedia& item = iMediaList->Item(aIndex); |
|
1326 |
|
1327 TMPXAttribute attrCount(KMPXMediaGeneralCount); |
|
1328 TInt usageCount = 0; |
|
1329 const CGlxMedia* media = item.Properties(); |
|
1330 if (media) |
|
1331 { |
|
1332 if (media->IsSupported(attrCount)) |
|
1333 { |
|
1334 usageCount = media->ValueTObject<TInt> (attrCount); |
|
1335 GLX_LOG_INFO1("CGlxListViewImp::UpdatePreviewL() - UsageCount(%d)", usageCount); |
|
1336 } |
|
1337 } |
|
1338 |
1247 const CGlxThumbnailAttribute* value = item.ThumbnailAttribute( |
1339 const CGlxThumbnailAttribute* value = item.ThumbnailAttribute( |
1248 thumbnailAttribute); |
1340 thumbnailAttribute); |
1249 if (value) |
1341 if (usageCount && value) |
1250 { |
1342 { |
1251 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
1343 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
1252 CleanupStack::PushL(bitmap); |
1344 CleanupStack::PushL(bitmap); |
1253 iPreviewTNBinding->ScaleBitmapToListSizeL(value->iBitmap, bitmap); |
1345 iPreviewTNBinding->ScaleBitmapToListSizeL(value->iBitmap, bitmap); |
1254 iList->ItemL(aIndex).SetIcon(CGulIcon::NewL(bitmap)); |
1346 iList->ItemL(aIndex).SetIcon(CGulIcon::NewL(bitmap)); |
|
1347 CleanupStack::Pop(bitmap); |
1255 iList->RefreshScreen(aIndex); |
1348 iList->RefreshScreen(aIndex); |
1256 CleanupStack::Pop(bitmap); |
1349 } |
1257 } |
1350 } |
1258 } |
1351 } |
1259 } |
1352 |
1260 |
1353 // ---------------------------------------------------------------------------- |
|
1354 // RefreshList |
|
1355 // ---------------------------------------------------------------------------- |
|
1356 // |
|
1357 void CGlxListViewImp::RefreshList(TInt aIndex) |
|
1358 { |
|
1359 TRACER("CGlxListViewImp::RefreshList()"); |
|
1360 GLX_DEBUG2("CGlxListViewImp::RefreshList(%d)", aIndex); |
|
1361 __ASSERT_ALWAYS(iList, Panic(EGlxPanicNullPointer)); |
|
1362 TInt firstIndex = iList->FirstIndexOnScreen(); |
|
1363 TInt itemsOnScreen = iList->ItemsOnScreen(); |
|
1364 TInt lastOnScreen = firstIndex + itemsOnScreen - 1; |
|
1365 TInt mediaCount = iMediaList->Count(); |
|
1366 if (lastOnScreen > (mediaCount - 1)) |
|
1367 { |
|
1368 lastOnScreen = mediaCount - 1; |
|
1369 } |
|
1370 |
|
1371 if (aIndex == lastOnScreen) |
|
1372 { |
|
1373 GLX_DEBUG2("CGlxListViewImp::RefreshList() RefreshScreen(%d)", aIndex); |
|
1374 iList->RefreshScreen(aIndex); |
|
1375 } |
|
1376 } |
1261 // End of File |
1377 // End of File |