application/src/PodcastFeedView.cpp
branchRCL_3
changeset 243 44d205147a83
parent 207 9fef0425017e
child 272 e6d095ba6756
equal deleted inserted replaced
236:f952f3a1a786 243:44d205147a83
   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)
   543 		default:
   536 		default:
   544 			CPodcastListView::HandleCommandL(aCommand);
   537 			CPodcastListView::HandleCommandL(aCommand);
   545 			break;
   538 			break;
   546 		}
   539 		}
   547 	
   540 	
   548 	iListContainer->SetLongTapDetectedL(EFalse); // in case we got here by long tapping
       
   549 	UpdateToolbar();
   541 	UpdateToolbar();
   550 	DP("CPodcastFeedView::HandleCommandL END");
   542 	DP("CPodcastFeedView::HandleCommandL END");
   551 	}
   543 	}
   552 
   544 
   553 void CPodcastFeedView::UpdateToolbar(TBool aVisible)
   545 void CPodcastFeedView::UpdateToolbar(TBool aVisible)
   954 void CPodcastFeedView::GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode)
   946 void CPodcastFeedView::GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode)
   955 	{
   947 	{
   956 	TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode));
   948 	TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode));
   957 	}
   949 	}
   958 
   950 
   959 void CPodcastFeedView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
       
   960 {
       
   961 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
       
   962 
       
   963 	iListContainer->SetLongTapDetectedL(ETrue);
       
   964 
       
   965 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
       
   966 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
       
   967 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
       
   968 
       
   969     if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
       
   970     {
       
   971 		iStylusPopupMenu->ShowMenu();
       
   972 		iStylusPopupMenu->SetPosition(aPenEventLocation);
       
   973     }
       
   974 	DP("CPodcastListView::HandleLongTapEventL END");
       
   975 }
       
   976 
       
   977 TBool CPodcastFeedView::ViewingShows()
   951 TBool CPodcastFeedView::ViewingShows()
   978 	{
   952 	{
   979 	return iViewingShows;
   953 	return iViewingShows;
   980 	}
   954 	}