application/src/PodcastSearchView.cpp
branchsymbian1
changeset 138 6c8c5122867a
parent 67 9c24c921ec35
child 175 cd124c4eb6b9
child 336 3d6c1417e8bd
equal deleted inserted replaced
136:cee38af14bcf 138:6c8c5122867a
    37 #include <pathinfo.h> 
    37 #include <pathinfo.h> 
    38 #include <f32file.h>
    38 #include <f32file.h>
    39 #include <akntoolbarextension.h>
    39 #include <akntoolbarextension.h>
    40 
    40 
    41 const TInt KMaxFeedNameLength = 100;
    41 const TInt KMaxFeedNameLength = 100;
    42 const TInt KDefaultGran = 5;
       
    43 const TInt KNumberOfFilesMaxLength = 4;
       
    44 #define KMaxMessageLength 200
    42 #define KMaxMessageLength 200
    45 #define KMaxTitleLength 100
    43 #define KMaxTitleLength 100
    46 const TInt KMimeBufLength = 100;
       
    47 
       
    48 _LIT(KUnknownUpdateDateString, "?/?");
       
    49 _LIT(KSearchResultFormat, "%d\t%S\t%S");
    44 _LIT(KSearchResultFormat, "%d\t%S\t%S");
    50 
    45 
    51 CPodcastSearchView* CPodcastSearchView::NewL(CPodcastModel& aPodcastModel)
    46 CPodcastSearchView* CPodcastSearchView::NewL(CPodcastModel& aPodcastModel)
    52     {
    47     {
    53     CPodcastSearchView* self = CPodcastSearchView::NewLC(aPodcastModel);
    48     CPodcastSearchView* self = CPodcastSearchView::NewLC(aPodcastModel);
    73 	CPodcastListView::ConstructL();
    68 	CPodcastListView::ConstructL();
    74 	iPodcastModel.FeedEngine().AddObserver(this);
    69 	iPodcastModel.FeedEngine().AddObserver(this);
    75 	CArrayPtr< CGulIcon >* icons = new(ELeave) CArrayPtrFlat< CGulIcon >(1);
    70 	CArrayPtr< CGulIcon >* icons = new(ELeave) CArrayPtrFlat< CGulIcon >(1);
    76 	CleanupStack::PushL( icons );
    71 	CleanupStack::PushL( icons );
    77 	
    72 	
    78 	// Load the bitmap for empty icon	
       
    79 	CFbsBitmap* bitmap = NULL;
    73 	CFbsBitmap* bitmap = NULL;
    80 	CFbsBitmap* mask = NULL;//	
    74 	CFbsBitmap* mask = NULL;//	
    81 	
    75 	
    82 	// Load the bitmap for feed icon	
    76 	AknIconUtils::CreateIconL(bitmap,
    83 
    77 							  mask,
    84 	// Load svg.-image and mask with a single call
    78 							  iEikonEnv->EikAppUi()->Application()->BitmapStoreName(),
    85 		AknIconUtils::CreateIconL(bitmap,
    79 							  EMbmPodcastFeed,
    86 		                          mask,
    80 							  EMbmPodcastFeed_mask);
    87 		                          iEikonEnv->EikAppUi()->Application()->BitmapStoreName(),
       
    88 		                          EMbmPodcastFeed,
       
    89 		                          EMbmPodcastFeed_mask);
       
    90 		/*
       
    91 	bitmap = iEikonEnv->CreateBitmapL( _L("*"),EMbmPodcastFeed_40x40);*/
       
    92 	CleanupStack::PushL( bitmap );		
    81 	CleanupStack::PushL( bitmap );		
    93 	// Load the mask for feed icon	
       
    94 	/*mask = iEikonEnv->CreateBitmapL( _L("*"),EMbmPodcastFeed_40x40m );	
       
    95 	*/
       
    96 	CleanupStack::PushL( mask );		
    82 	CleanupStack::PushL( mask );		
    97 	// Append the feed icon to icon array
       
    98 	icons->AppendL( CGulIcon::NewL( bitmap, mask ) );
    83 	icons->AppendL( CGulIcon::NewL( bitmap, mask ) );
    99 	CleanupStack::Pop(2); // bitmap, mask
    84 	CleanupStack::Pop(2); // bitmap, mask
   100 	
    85 	
   101 	iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons );
    86 	iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons );
   102 	CleanupStack::Pop(icons); // icons
    87 	CleanupStack::Pop(icons); // icons
   131 	iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID);
   116 	iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID);
   132 	
   117 	
   133     ((CPodcastAppUi*)AppUi())->NaviSetTextL(R_SEARCH_RESULTS);
   118     ((CPodcastAppUi*)AppUi())->NaviSetTextL(R_SEARCH_RESULTS);
   134     
   119     
   135 	UpdateListboxItemsL();
   120 	UpdateListboxItemsL();
   136 	UpdateToolbar();
       
   137 }
   121 }
   138 
   122 
   139 void CPodcastSearchView::DoDeactivate()
   123 void CPodcastSearchView::DoDeactivate()
   140 {
   124 {
   141 	CPodcastListView::DoDeactivate();
   125 	CPodcastListView::DoDeactivate();
   271 	{
   255 	{
   272 	DP("CPodcastSearchView::OpmlParsingComplete BEGIN");
   256 	DP("CPodcastSearchView::OpmlParsingComplete BEGIN");
   273 
   257 
   274 	DP("CPodcastSearchView::OpmlParsingComplete END");
   258 	DP("CPodcastSearchView::OpmlParsingComplete END");
   275 	}
   259 	}
   276 
       
   277 void CPodcastSearchView::UpdateToolbar(TBool aVisible)
       
   278 {
       
   279 	TBool disableAdd = iItemArray->MdcaCount() == 0 || iSearchRunning;
       
   280 	
       
   281 	CAknToolbar* toolbar = Toolbar();
       
   282 	
       
   283 	if (toolbar)
       
   284 		{
       
   285 		if (iListContainer->IsVisible()) {
       
   286 			toolbar->SetToolbarVisibility(aVisible);
       
   287 		}
       
   288 		toolbar->SetItemDimmed(EPodcastAddSearchResult, disableAdd, ETrue );
       
   289 		toolbar->HideItem(EPodcastSearch, iSearchRunning, ETrue );
       
   290 		toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !iSearchRunning, ETrue);
       
   291 		}
       
   292 }