application/src/PodcastShowsView.cpp
branch3rded
changeset 343 9c56bf585696
parent 177 269e3f3e544a
child 390 d7abecc9d189
equal deleted inserted replaced
281:1cae65a87b5e 343:9c56bf585696
   103 	{
   103 	{
   104 	}
   104 	}
   105 
   105 
   106 void CPodcastShowsView::ConstructL()
   106 void CPodcastShowsView::ConstructL()
   107 	{
   107 	{
   108 	DP("CPodcastShowsView::ConstructL BEGIN");
       
   109 	BaseConstructL(R_PODCAST_SHOWSVIEW);
   108 	BaseConstructL(R_PODCAST_SHOWSVIEW);
   110 	CPodcastListView::ConstructL();
   109 	CPodcastListView::ConstructL();
   111 	
   110 	
   112 	CreateIconsL();
   111 	CreateIconsL();
   113 	
   112 		
   114 	iListContainer->Listbox()->SetListBoxObserver(this);
       
   115 	
       
   116 	iPodcastModel.FeedEngine().AddObserver(this);
   113 	iPodcastModel.FeedEngine().AddObserver(this);
   117 	iPodcastModel.ShowEngine().AddObserver(this);
   114 	iPodcastModel.ShowEngine().AddObserver(this);
   118 	
   115 	
   119 	DP("CPodcastShowsView::ConstructL END");
   116 	DP("CPodcastShowsView::ConstructL END");
   120 	}
   117 	}
   141 		icons->AppendL(CGulIcon::NewL(bitmap, mask) );
   138 		icons->AppendL(CGulIcon::NewL(bitmap, mask) );
   142 		CleanupStack::Pop(2); // bitmap, mask
   139 		CleanupStack::Pop(2); // bitmap, mask
   143 		pos+=2;
   140 		pos+=2;
   144 		}
   141 		}
   145 		
   142 		
   146 	iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
   143 	//iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
       
   144 	iListContainer->SetListboxIcons(icons);
   147 	CleanupStack::Pop(icons); // icons
   145 	CleanupStack::Pop(icons); // icons
   148 	}
   146 	}
   149 
   147 
   150 TKeyResponse CPodcastShowsView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
   148 TKeyResponse CPodcastShowsView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
   151 	{
   149 	{
   171 					HandleCommandL(EPodcastMarkAsPlayed);
   169 					HandleCommandL(EPodcastMarkAsPlayed);
   172 				}
   170 				}
   173 				break;
   171 				break;
   174 			case 106:
   172 			case 106:
   175 			case '#':
   173 			case '#':
   176 				HandleCommandL(EPodcastShowInfo);
   174 				if (activeShow->DownloadState() == ENotDownloaded) {
       
   175 					HandleCommandL(EPodcastDownloadShow);
       
   176 				}
   177 				break;
   177 				break;
   178 			case EKeyBackspace:
   178 			case EKeyBackspace:
   179 			case EKeyDelete:
   179 			case EKeyDelete:
   180 					HandleCommandL(EPodcastDeleteShow);
   180 					HandleCommandL(EPodcastDeleteShow);
   181 				break;
   181 				break;
   484 	}
   484 	}
   485 }
   485 }
   486 
   486 
   487 void CPodcastShowsView::UpdateListboxItemsL()
   487 void CPodcastShowsView::UpdateListboxItemsL()
   488 	{
   488 	{
       
   489 	DP("CPodcastShowsView::UpdateListboxItemsL BEGIN");
   489 	if (iListContainer->IsVisible())
   490 	if (iListContainer->IsVisible())
   490 		{
   491 		{
   491 		TListItemProperties itemProps;
   492 		TListItemProperties itemProps;
   492 		TInt len = 0;
   493 		TInt len = 0;
   493 
   494 
   550 					}
   551 					}
   551 				iListContainer->Listbox()->HandleItemAdditionL();
   552 				iListContainer->Listbox()->HandleItemAdditionL();
   552 				}				
   553 				}				
   553 			}
   554 			}
   554 		}
   555 		}
       
   556 	DP("CPodcastShowsView::UpdateListboxItemsL END");
   555 	}
   557 	}
   556 
   558 
   557 /** 
   559 /** 
   558  * Command handling function intended for overriding by sub classes. 
   560  * Command handling function intended for overriding by sub classes. 
   559  * Default implementation is empty.  
   561  * Default implementation is empty.