104 CleanupStack::Pop(2); // bitmap, mask |
104 CleanupStack::Pop(2); // bitmap, mask |
105 iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons ); |
105 iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons ); |
106 CleanupStack::Pop(icons); // icons |
106 CleanupStack::Pop(icons); // icons |
107 |
107 |
108 iListContainer->Listbox()->SetListBoxObserver(this); |
108 iListContainer->Listbox()->SetListBoxObserver(this); |
109 |
109 |
110 iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); |
|
111 TResourceReader reader; |
|
112 iCoeEnv->CreateResourceReaderLC(reader,R_FEEDVIEW_POPUP_MENU); |
|
113 iStylusPopupMenu->ConstructFromResourceL(reader); |
|
114 CleanupStack::PopAndDestroy(); |
|
115 |
|
116 iUpdater = CPodcastFeedViewUpdater::NewL(*this); |
110 iUpdater = CPodcastFeedViewUpdater::NewL(*this); |
117 DP("CPodcastFeedView::ConstructL END"); |
111 DP("CPodcastFeedView::ConstructL END"); |
118 } |
112 } |
119 |
113 |
120 CPodcastFeedView::~CPodcastFeedView() |
114 CPodcastFeedView::~CPodcastFeedView() |
121 { |
115 { |
122 iPodcastModel.FeedEngine().RemoveObserver(this); |
116 iPodcastModel.FeedEngine().RemoveObserver(this); |
123 delete iFeedsFormat; |
117 delete iFeedsFormat; |
124 delete iNeverUpdated; |
118 delete iNeverUpdated; |
125 delete iStylusPopupMenu; |
|
126 delete iUpdater; |
119 delete iUpdater; |
127 iFeedIdForIconArray.Close(); |
120 iFeedIdForIconArray.Close(); |
128 } |
121 } |
129 |
122 |
130 void CPodcastFeedView::UpdateItemL(TInt aIndex) |
123 void CPodcastFeedView::UpdateItemL(TInt aIndex) |
223 } |
215 } |
224 |
216 |
225 void CPodcastFeedView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
217 void CPodcastFeedView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
226 { |
218 { |
227 iUpdatingRunning = EFalse; |
219 iUpdatingRunning = EFalse; |
228 UpdateToolbar(); |
|
229 } |
220 } |
230 |
221 |
231 void CPodcastFeedView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
222 void CPodcastFeedView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
232 { |
223 { |
233 // Update status text |
224 // Update status text |
234 iUpdatingRunning = ETrue; |
225 iUpdatingRunning = ETrue; |
235 UpdateFeedInfoStatusL(aFeedUid, ETrue); |
226 UpdateFeedInfoStatusL(aFeedUid, ETrue); |
236 |
|
237 UpdateToolbar(); |
|
238 } |
227 } |
239 |
228 |
240 void CPodcastFeedView::FeedDownloadFinishedL(TFeedState aState,TUint aFeedUid, TInt aError) |
229 void CPodcastFeedView::FeedDownloadFinishedL(TFeedState aState,TUint aFeedUid, TInt aError) |
241 { |
230 { |
242 switch(aError) |
231 switch(aError) |
542 default: |
530 default: |
543 CPodcastListView::HandleCommandL(aCommand); |
531 CPodcastListView::HandleCommandL(aCommand); |
544 break; |
532 break; |
545 } |
533 } |
546 |
534 |
547 iListContainer->SetLongTapDetectedL(EFalse); // in case we got here by long tapping |
|
548 UpdateToolbar(); |
|
549 DP("CPodcastFeedView::HandleCommandL END"); |
535 DP("CPodcastFeedView::HandleCommandL END"); |
550 } |
536 } |
551 |
|
552 void CPodcastFeedView::UpdateToolbar(TBool aVisible) |
|
553 { |
|
554 DP("CPodcastFeedView::UpdateToolbar BEGIN"); |
|
555 CAknToolbar* toolbar = Toolbar(); |
|
556 |
|
557 if (toolbar) |
|
558 { |
|
559 if (iListContainer->IsVisible()) { |
|
560 toolbar->SetToolbarVisibility(aVisible); |
|
561 } |
|
562 toolbar->HideItem(EPodcastUpdateAllFeeds, iUpdatingRunning, ETrue); |
|
563 toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !iUpdatingRunning, ETrue ); |
|
564 toolbar->SetItemDimmed(EPodcastAddFeed, iUpdatingRunning, ETrue ); |
|
565 toolbar->SetItemDimmed(EPodcastSettings, iUpdatingRunning, ETrue ); |
|
566 } |
|
567 DP("CPodcastFeedView::UpdateToolbar END"); |
|
568 } |
|
569 |
537 |
570 void CPodcastFeedView::HandleAddFeedL() |
538 void CPodcastFeedView::HandleAddFeedL() |
571 { |
539 { |
572 TBuf<KFeedUrlLength> url; |
540 TBuf<KFeedUrlLength> url; |
573 url.Copy(_L("http://")); |
541 url.Copy(_L("http://")); |
913 void CPodcastFeedView::GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode) |
881 void CPodcastFeedView::GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode) |
914 { |
882 { |
915 TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode)); |
883 TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode)); |
916 } |
884 } |
917 |
885 |
918 void CPodcastFeedView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) |
|
919 { |
|
920 DP("CPodcastListView::HandleLongTapEventL BEGIN"); |
|
921 |
|
922 iListContainer->SetLongTapDetectedL(ETrue); |
|
923 |
|
924 const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 |
|
925 TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( |
|
926 iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; |
|
927 |
|
928 if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) |
|
929 { |
|
930 iStylusPopupMenu->ShowMenu(); |
|
931 iStylusPopupMenu->SetPosition(aPenEventLocation); |
|
932 } |
|
933 DP("CPodcastListView::HandleLongTapEventL END"); |
|
934 } |
|
935 |
|
936 TBool CPodcastFeedView::ViewingShows() |
886 TBool CPodcastFeedView::ViewingShows() |
937 { |
887 { |
938 return iViewingShows; |
888 return iViewingShows; |
939 } |
889 } |