Added macro SYMBIAN1_UI that toggles between single and double tap UI
authorteknolog
Sun, 28 Feb 2010 12:06:30 +0000
changeset 23 cf4b850bbffb
parent 22 3243c9461520
child 24 ca50ea154990
Added macro SYMBIAN1_UI that toggles between single and double tap UI
application/data/PodcastQueueView.ra
application/data/PodcastShowsView.ra
application/group/Podcast.mmp
application/src/PodcastFeedView.cpp
application/src/PodcastListView.cpp
application/src/PodcastQueueView.cpp
application/src/PodcastShowsView.cpp
--- a/application/data/PodcastQueueView.ra	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/data/PodcastQueueView.ra	Sun Feb 28 12:06:30 2010 +0000
@@ -95,6 +95,7 @@
 					};
 				};
 			},
+#ifdef SYMBIAN1_UI
 		TBAR_CTRL
 			{
 			type = EAknCtButton;
@@ -113,6 +114,7 @@
 					};
 				};
 			},
+#endif
 		TBAR_CTRL
 			{
 			type = EAknCtButton;
--- a/application/data/PodcastShowsView.ra	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/data/PodcastShowsView.ra	Sun Feb 28 12:06:30 2010 +0000
@@ -98,8 +98,9 @@
                            }  
                         };
                     };
-                },
-        TBAR_CTRL
+                }
+#ifdef SYMBIAN1_UI
+            ,TBAR_CTRL
 			{
 			type = EAknCtButton;
 			id = EPodcastDownloadShow;
@@ -171,6 +172,7 @@
 						};
 					};
 				}
+#endif
         };
     }
 
--- a/application/group/Podcast.mmp	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/group/Podcast.mmp	Sun Feb 28 12:06:30 2010 +0000
@@ -15,7 +15,9 @@
  * Description:
  *
  */
- 
+
+MACRO SYMBIAN1_UI
+
 TARGET			Podcast.exe
 TARGETTYPE  	exe
 UID				0x100039CE 0xA0009D00  
--- a/application/src/PodcastFeedView.cpp	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/src/PodcastFeedView.cpp	Sun Feb 28 12:06:30 2010 +0000
@@ -197,6 +197,9 @@
 
 	switch(aEventType)
 		{
+#ifndef SYMBIAN1_UI
+	case EEventItemClicked:
+#endif
 	case EEventEnterKeyPressed:
 	case EEventItemDoubleClicked:
 	case EEventItemActioned:
--- a/application/src/PodcastListView.cpp	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/src/PodcastListView.cpp	Sun Feb 28 12:06:30 2010 +0000
@@ -73,6 +73,14 @@
 	iListbox->SetSize(aRect.Size());
 	iListbox->MakeVisible(ETrue);
     MakeVisible(EFalse);
+    
+
+//#ifndef SYMBIAN1_UI
+//	TInt flags = iListbox->View()->ItemDrawer()->Flags();
+//	flags |= CListItemDrawer::EDisableHighlight;
+//	iListbox->ItemDrawer()->SetFlags(flags);
+//#endif
+//	
 
 	// Activate the window, which makes it ready to be drawn
     ActivateL();   
@@ -189,6 +197,7 @@
 	iLongTapDetector = CAknLongTapDetector::NewL(this);
 	iListContainer->SetPointerListener(this);
 	iListContainer->SetKeyEventListener(this);
+        
 	DP("CPodcastListView::ConstructL END");
 }
 
--- a/application/src/PodcastQueueView.cpp	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/src/PodcastQueueView.cpp	Sun Feb 28 12:06:30 2010 +0000
@@ -285,6 +285,9 @@
 	{
 	switch (aEventType)
 		{
+#ifndef SYMBIAN1_UI
+		case EEventItemClicked:
+#endif
 		case EEventEnterKeyPressed:		
 		case EEventItemActioned:
 		case EEventItemDoubleClicked:
@@ -570,12 +573,14 @@
 		if (iListContainer->IsVisible()) {
 			toolbar->SetToolbarVisibility(aVisible);
 		}
-		toolbar->HideItem(EPodcastRemoveDownload, EFalse, ETrue);
 		toolbar->HideItem(EPodcastRemoveAllDownloads, EFalse, ETrue);
-		toolbar->SetItemDimmed(EPodcastRemoveDownload, itemCnt == 0, ETrue);
 		toolbar->SetItemDimmed(EPodcastRemoveAllDownloads, itemCnt == 0, ETrue);
 		toolbar->HideItem(EPodcastSuspendDownloads,iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue);
 		toolbar->HideItem(EPodcastResumeDownloads,!iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue);	
+#ifdef SYMBIAN1_UI
+		toolbar->HideItem(EPodcastRemoveDownload, EFalse, ETrue);
+		toolbar->SetItemDimmed(EPodcastRemoveDownload, itemCnt == 0, ETrue);		
+#endif
 	}
 }
 
--- a/application/src/PodcastShowsView.cpp	Sun Feb 28 11:25:17 2010 +0000
+++ b/application/src/PodcastShowsView.cpp	Sun Feb 28 12:06:30 2010 +0000
@@ -335,6 +335,9 @@
 	{
 	switch (aEventType)
 		{
+#ifndef SYMBIAN1_UI
+		case EEventItemClicked:
+#endif
 		case EEventEnterKeyPressed:		
 		case EEventItemActioned:
 		case EEventItemDoubleClicked:
@@ -728,73 +731,74 @@
 {
 	CAknToolbar* toolbar = Toolbar();
 
-	if (!toolbar) {
-		return;
-	}
+	if (toolbar) {
+		if (iListContainer->IsVisible()) {
+			toolbar->SetToolbarVisibility(aVisible);
+		}
 	
-	if (iListContainer->IsVisible()) {
-		toolbar->SetToolbarVisibility(aVisible);
-	}
+		TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && 
+				iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid();
 	
-	RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
-	TInt itemCnt = fItems.Count();
+		toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); 
+		toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue );
 
-	TBool hideDownloadShowCmd = EFalse;
-	TBool dimDownloadShowCmd = EFalse;
-	TBool hideSetPlayed = EFalse;
-	TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && 
-			iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid();
+#ifdef SYMBIAN1_UI
+		RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
+		TInt itemCnt = fItems.Count();
+	
+		TBool hideDownloadShowCmd = EFalse;
+		TBool dimDownloadShowCmd = EFalse;
+		TBool hideSetPlayed = EFalse;
 	
-	if(iListContainer->Listbox() != NULL)
-	{
-		TInt index = iListContainer->Listbox()->CurrentItemIndex();
-		
-		if(index>= 0 && index < itemCnt)
+		if(iListContainer->Listbox() != NULL)
 		{
-			switch(fItems[index]->DownloadState())
-				{
-				case ENotDownloaded:
-				case EFailedDownload:
-					hideDownloadShowCmd = EFalse;
-					dimDownloadShowCmd = EFalse;
-					break;
-				case EQueued:
-				case EDownloading:
-					hideDownloadShowCmd = EFalse;
-					dimDownloadShowCmd = ETrue;
-					break;
-				case EDownloaded:
-					hideDownloadShowCmd = ETrue;
-					break;
+			TInt index = iListContainer->Listbox()->CurrentItemIndex();
+			
+			if(index>= 0 && index < itemCnt)
+			{
+				switch(fItems[index]->DownloadState())
+					{
+					case ENotDownloaded:
+					case EFailedDownload:
+						hideDownloadShowCmd = EFalse;
+						dimDownloadShowCmd = EFalse;
+						break;
+					case EQueued:
+					case EDownloading:
+						hideDownloadShowCmd = EFalse;
+						dimDownloadShowCmd = ETrue;
+						break;
+					case EDownloaded:
+						hideDownloadShowCmd = ETrue;
+						break;
+					}
+					
+				if(fItems[index]->PlayState() == EPlayed) {
+					hideSetPlayed = ETrue;
 				}
-				
-			if(fItems[index]->PlayState() == EPlayed) {
-				hideSetPlayed = ETrue;
 			}
 		}
-	}
-	
-	toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); 
-	toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue );
-	
-	if (hideDownloadShowCmd) {
-		toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue );
-		toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue);
-		toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState, ETrue);
-	} else {
-		toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue );
-		toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue);
-		toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd, ETrue);	
-	}
-	
-	if (hideSetPlayed) {
-		toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue );
-		toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue );
-		toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue);
-	} else {
-		toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue );
-		toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue );
-		toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState, ETrue);
+		
+		if (hideDownloadShowCmd) {
+			toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue );
+			toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue);
+			toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState, ETrue);
+		} else {
+			toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue );
+			toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue);
+			toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd, ETrue);	
+		}
+		
+		if (hideSetPlayed) {
+			toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue );
+			toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue );
+			toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue);
+		} else {
+			toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue );
+			toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue );
+			toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState, ETrue);
+		}
+#endif
 	}
 }