application/src/PodcastListView.cpp
changeset 35 66c5303f3610
parent 27 f21a29fc4769
child 36 e010fc411ddc
equal deleted inserted replaced
30:7bca37ba5fa9 35:66c5303f3610
    98         default:
    98         default:
    99             return NULL;
    99             return NULL;
   100         }
   100         }
   101     }
   101     }
   102 
   102 
   103 void CPodcastListContainer::SetLongTapDetected(TBool aLongTapDetected)
   103 void CPodcastListContainer::SetLongTapDetectedL(TBool aLongTapDetected)
   104 	{
   104 	{
   105 	iLongTapDetected = aLongTapDetected;
   105 	iLongTapDetected = aLongTapDetected;
   106 	
   106 	
   107 	if (aLongTapDetected == EFalse)
   107 	if (aLongTapDetected == EFalse)
   108 		{
   108 		{
   325 	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
   325 	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
   326 	iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText);
   326 	iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText);
   327 	CleanupStack::PopAndDestroy(emptyText);	
   327 	CleanupStack::PopAndDestroy(emptyText);	
   328 	}
   328 	}
   329 
   329 
   330 void CPodcastListView::ShowOkMessage(TDesC &aText)
   330 void CPodcastListView::ShowOkMessageL(TDesC &aText)
   331 	{
   331 	{
   332 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   332 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   333 	CleanupStack::PushL(dlg);
   333 	CleanupStack::PushL(dlg);
   334 	dlg->SetTextL(aText);
   334 	dlg->SetTextL(aText);
   335 	CleanupStack::Pop(dlg);
   335 	CleanupStack::Pop(dlg);
   336 	dlg->ExecuteLD(R_MESSAGEDLG_OK);
   336 	dlg->ExecuteLD(R_MESSAGEDLG_OK);
   337 	}
   337 	}
   338 
   338 
   339 void CPodcastListView::ShowErrorMessage(TDesC &aText)
   339 void CPodcastListView::ShowErrorMessageL(TDesC &aText)
   340 	{
   340 	{
   341 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   341 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   342 	CleanupStack::PushL(dlg);
   342 	CleanupStack::PushL(dlg);
   343 	dlg->SetTextL(aText);
   343 	dlg->SetTextL(aText);
   344 	CleanupStack::Pop(dlg);
   344 	CleanupStack::Pop(dlg);
   345 	dlg->ExecuteLD(R_ERRORDLG_OK);
   345 	dlg->ExecuteLD(R_ERRORDLG_OK);
   346 	}
   346 	}
   347 
   347 
   348 TInt CPodcastListView::ShowQueryMessage(TDesC &aText)
   348 TInt CPodcastListView::ShowQueryMessageL(TDesC &aText)
   349 	{
   349 	{
   350 	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
   350 	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
   351 	
   351 	
   352 	CleanupStack::PushL(dlg);
   352 	CleanupStack::PushL(dlg);
   353 	dlg->SetPromptL(aText);
   353 	dlg->SetPromptL(aText);
   375 
   375 
   376 
   376 
   377 void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
   377 void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
   378 {
   378 {
   379 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
   379 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
   380 	iListContainer->SetLongTapDetected(ETrue);
   380 	iListContainer->SetLongTapDetectedL(ETrue);
   381 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
   381 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
   382 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
   382 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
   383 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
   383 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
   384 
   384 
   385     if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
   385     if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
   421 	if (aType==EEventKey)
   421 	if (aType==EEventKey)
   422 		{
   422 		{
   423 		switch (aKeyEvent.iCode)
   423 		switch (aKeyEvent.iCode)
   424 			{
   424 			{
   425 			case EKeyRightArrow:
   425 			case EKeyRightArrow:
   426 				((CPodcastAppUi*)AppUi())->TabRight();
   426 				((CPodcastAppUi*)AppUi())->TabRightL();
   427 				return EKeyWasConsumed;
   427 				return EKeyWasConsumed;
   428 			case EKeyLeftArrow:
   428 			case EKeyLeftArrow:
   429 				((CPodcastAppUi*)AppUi())->TabLeft();
   429 				((CPodcastAppUi*)AppUi())->TabLeftL();
   430 				return EKeyWasConsumed;
   430 				return EKeyWasConsumed;
   431 			}
   431 			}
   432 		}
   432 		}
   433 	return EKeyWasNotConsumed;
   433 	return EKeyWasNotConsumed;
   434 	}
   434 	}