application/src/PodcastListView.cpp
changeset 50 e7b10d6d7ba3
parent 49 43e204e6ae2e
parent 36 e010fc411ddc
child 55 31e34b8e2878
equal deleted inserted replaced
49:43e204e6ae2e 50:e7b10d6d7ba3
    99         default:
    99         default:
   100             return NULL;
   100             return NULL;
   101         }
   101         }
   102     }
   102     }
   103 
   103 
   104 void CPodcastListContainer::SetLongTapDetected(TBool aLongTapDetected)
   104 void CPodcastListContainer::SetLongTapDetectedL(TBool aLongTapDetected)
   105 	{
   105 	{
   106 	iLongTapDetected = aLongTapDetected;
   106 	iLongTapDetected = aLongTapDetected;
   107 	
   107 	
   108 	if (aLongTapDetected == EFalse)
   108 	if (aLongTapDetected == EFalse)
   109 		{
   109 		{
   332 	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
   332 	HBufC* emptyText =  iEikonEnv->AllocReadResourceLC(aResourceId);
   333 	iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText);
   333 	iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText);
   334 	CleanupStack::PopAndDestroy(emptyText);	
   334 	CleanupStack::PopAndDestroy(emptyText);	
   335 	}
   335 	}
   336 
   336 
   337 void CPodcastListView::ShowOkMessage(TDesC &aText)
   337 void CPodcastListView::ShowOkMessageL(TDesC &aText)
   338 	{
   338 	{
   339 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   339 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   340 	CleanupStack::PushL(dlg);
   340 	CleanupStack::PushL(dlg);
   341 	dlg->SetTextL(aText);
   341 	dlg->SetTextL(aText);
   342 	CleanupStack::Pop(dlg);
   342 	CleanupStack::Pop(dlg);
   343 	dlg->ExecuteLD(R_MESSAGEDLG_OK);
   343 	dlg->ExecuteLD(R_MESSAGEDLG_OK);
   344 	}
   344 	}
   345 
   345 
   346 void CPodcastListView::ShowErrorMessage(TDesC &aText)
   346 void CPodcastListView::ShowErrorMessageL(TDesC &aText)
   347 	{
   347 	{
   348 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   348 	CAknNoteDialog* dlg= new(ELeave) CAknNoteDialog();
   349 	CleanupStack::PushL(dlg);
   349 	CleanupStack::PushL(dlg);
   350 	dlg->SetTextL(aText);
   350 	dlg->SetTextL(aText);
   351 	CleanupStack::Pop(dlg);
   351 	CleanupStack::Pop(dlg);
   352 	dlg->ExecuteLD(R_ERRORDLG_OK);
   352 	dlg->ExecuteLD(R_ERRORDLG_OK);
   353 	}
   353 	}
   354 
   354 
   355 TInt CPodcastListView::ShowQueryMessage(TDesC &aText)
   355 TInt CPodcastListView::ShowQueryMessageL(TDesC &aText)
   356 	{
   356 	{
   357 	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
   357 	CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog();
   358 	
   358 	
   359 	CleanupStack::PushL(dlg);
   359 	CleanupStack::PushL(dlg);
   360 	dlg->SetPromptL(aText);
   360 	dlg->SetPromptL(aText);
   382 
   382 
   383 
   383 
   384 void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
   384 void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
   385 {
   385 {
   386 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
   386 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
   387 	iListContainer->SetLongTapDetected(ETrue);
   387 	iListContainer->SetLongTapDetectedL(ETrue);
   388 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
   388 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
   389 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
   389 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
   390 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
   390 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
   391 
   391 
   392     if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
   392     if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
   428 	if (aType==EEventKey)
   428 	if (aType==EEventKey)
   429 		{
   429 		{
   430 		switch (aKeyEvent.iCode)
   430 		switch (aKeyEvent.iCode)
   431 			{
   431 			{
   432 			case EKeyRightArrow:
   432 			case EKeyRightArrow:
   433 				((CPodcastAppUi*)AppUi())->TabRight();
   433 				((CPodcastAppUi*)AppUi())->TabRightL();
   434 				return EKeyWasConsumed;
   434 				return EKeyWasConsumed;
   435 			case EKeyLeftArrow:
   435 			case EKeyLeftArrow:
   436 				((CPodcastAppUi*)AppUi())->TabLeft();
   436 				((CPodcastAppUi*)AppUi())->TabLeftL();
   437 				return EKeyWasConsumed;
   437 				return EKeyWasConsumed;
   438 			}
   438 			}
   439 		}
   439 		}
   440 	return EKeyWasNotConsumed;
   440 	return EKeyWasNotConsumed;
   441 	}
   441 	}