application/src/PodcastSearchView.cpp
branchtwolistboxes
changeset 316 841ccfa933ac
parent 314 e7776f6a2198
child 317 5afc95a6ad83
equal deleted inserted replaced
315:091fa3bf3295 316:841ccfa933ac
    41 
    41 
    42 const TInt KMaxFeedNameLength = 100;
    42 const TInt KMaxFeedNameLength = 100;
    43 #define KMaxMessageLength 200
    43 #define KMaxMessageLength 200
    44 #define KMaxTitleLength 100
    44 #define KMaxTitleLength 100
    45 _LIT(KSearchResultFormat, "%d\t%S\t%S");
    45 _LIT(KSearchResultFormat, "%d\t%S\t%S");
       
    46 _LIT(KSearchResultFormatLandscape, "%d\t%S");
    46 
    47 
    47 CPodcastSearchView* CPodcastSearchView::NewL(CPodcastModel& aPodcastModel)
    48 CPodcastSearchView* CPodcastSearchView::NewL(CPodcastModel& aPodcastModel)
    48     {
    49     {
    49     CPodcastSearchView* self = CPodcastSearchView::NewLC(aPodcastModel);
    50     CPodcastSearchView* self = CPodcastSearchView::NewLC(aPodcastModel);
    50     CleanupStack::Pop( self );
    51     CleanupStack::Pop( self );
   183 			TBuf<512> descr;
   184 			TBuf<512> descr;
   184 			descr.Copy(fi->Description().Left(512));
   185 			descr.Copy(fi->Description().Left(512));
   185 			PodcastUtils::RemoveAllFormatting(descr);
   186 			PodcastUtils::RemoveAllFormatting(descr);
   186 			iListboxFormatbuffer.Format(KSearchResultFormat(), iconIndex, &fi->Title(), &descr);
   187 			iListboxFormatbuffer.Format(KSearchResultFormat(), iconIndex, &fi->Title(), &descr);
   187 			iItemArray->AppendL(iListboxFormatbuffer);
   188 			iItemArray->AppendL(iListboxFormatbuffer);
       
   189 			iListboxFormatbufferShort.Format(KSearchResultFormatLandscape(), iconIndex, &fi->Title(), &descr);
       
   190 			iItemArrayShort->AppendL(iListboxFormatbufferShort);
   188 			iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(i, itemProps);
   191 			iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(i, itemProps);
   189 			}
   192 			}
   190 		} 
   193 		} 
   191 	else 
   194 	else 
   192 		{					
   195 		{					
   193 		TBuf<KMaxFeedNameLength> itemName;
   196 		TBuf<KMaxFeedNameLength> itemName;
   194 		iEikonEnv->ReadResourceL(itemName, R_PODCAST_NO_SEARCH_RESULTS);
   197 		iEikonEnv->ReadResourceL(itemName, R_PODCAST_NO_SEARCH_RESULTS);
   195 		iItemArray->Reset();
   198 		iItemArray->Reset();
       
   199 		iItemArrayShort->Reset();
   196 		iItemIdArray.Reset();
   200 		iItemIdArray.Reset();
   197 
   201 
   198 		TListItemProperties itemProps;
   202 		TListItemProperties itemProps;
   199 		itemProps.SetDimmed(ETrue);
   203 		itemProps.SetDimmed(ETrue);
   200 		itemProps.SetHiddenSelection(ETrue);								
   204 		itemProps.SetHiddenSelection(ETrue);								
   201 		iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps);
   205 		iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps);
   202 		}
   206 		}
   203 	iListContainer->SetTextArray(iItemArray);
       
   204 	iListContainer->Listbox()->HandleItemAdditionL();
   207 	iListContainer->Listbox()->HandleItemAdditionL();
   205 	DP("CPodcastSearchView::UpdateListboxItemsL END");
   208 	DP("CPodcastSearchView::UpdateListboxItemsL END");
   206 	}
   209 	}
   207 
   210 
   208 /** 
   211 /**