browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadsListDlg.cpp
changeset 28 d39add9822e2
parent 26 cb62a4f66ebe
child 38 4917f9bf7995
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadsListDlg.cpp	Mon Jan 18 21:20:18 2010 +0200
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CDownloadsListDlg.cpp	Tue Feb 02 00:56:45 2010 +0200
@@ -33,7 +33,10 @@
 #include    <StringLoader.h>
 #include    <eikenv.h>
 #include    <DocumentHandler.h>
-
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF
+#include  "CDownloadsStylusPopupMenu.h"
+#define   pixelOffset   36
+#endif
 #include "eikon.hrh"
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -107,6 +110,9 @@
 
     iDownloadUtils = CDownloadUtils::NewL();
 
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF      
+    iStylusMenu = CDlStylusPopupMenu::NewL();
+#endif    
     CLOG_LEAVEFN("CDownloadsListDlg::ConstructL");
     }
 
@@ -155,7 +161,13 @@
     iListBox = NULL;
     delete iDownloadUtils;
     iDownloadUtils = NULL;
-
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF    
+	 if (iStylusMenu)
+	 	{
+	 		delete iStylusMenu;
+	 		iStylusMenu = NULL;
+	 	}
+#endif    
     CLOG_LEAVEFN("CDownloadsListDlg::~CDownloadsListDlg");
     }
 
@@ -195,6 +207,23 @@
         CLOG_WRITE(" aModel.Count() == 0");
         }
 
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF    
+    TInt Inprogress = iDownloadsListArray->DownloadsCount
+                      ( MASKED_DL_STATE(EHttpDlCreated) |
+                        MASKED_DL_STATE(EHttpDlPaused) |
+                        MASKED_DL_STATE(EHttpDlInprogress) |
+                        MASKED_DL_STATE(EHttpDlMultipleMOFailed));
+    
+    if (  Inprogress > 1   )
+        {
+        ButtonGroupContainer()->MakeCommandVisible( EAknSoftkeyOptions, ETrue );
+        } 
+    else
+        {
+        ButtonGroupContainer()->MakeCommandVisible( EAknSoftkeyOptions, EFalse );
+        }
+#endif       
+   
     CLOG_LEAVEFN("CDownloadsListDlg::SetModelL");
     }
 
@@ -614,6 +643,9 @@
                 break;
                 }
             case MEikListBoxObserver::EEventItemDoubleClicked:
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF
+            case MEikListBoxObserver::EEventItemSingleClicked:
+#endif			
                 {
                 // If EAknSoftkeyOpen is visible, then we can activate the selected download
                 if (ButtonGroupContainer()->IsCommandVisible(EAknSoftkeyOpen))
@@ -680,6 +712,36 @@
 //
 void CDownloadsListDlg::HandlePointerEventL(const TPointerEvent& aPointerEvent)
     {
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF    	
+    if ( aPointerEvent.iType == TPointerEvent::EButton1Down)
+        {
+        iPointerEvent =  aPointerEvent;
+        iStylusMenu->HandlePointerEventL(aPointerEvent, this);
+        }
+    else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
+        {
+        iStylusMenu->cancelLongTapL();
+            if(iStylusMenu->islongtapRunning())
+                {
+                iStylusMenu->reSetLongTapFlag();
+                return;
+                }
+        }
+    else if ( aPointerEvent.iType == TPointerEvent::EDrag )
+        {
+        if((Abs(iPointerEvent.iPosition.iX - aPointerEvent.iPosition.iX) > pixelOffset ) ||
+        (Abs(iPointerEvent.iPosition.iY - aPointerEvent.iPosition.iY) > pixelOffset ))
+            {
+            iStylusMenu->cancelLongTapL();
+            if(iStylusMenu->islongtapRunning())
+                {
+                iStylusMenu->reSetLongTapFlag();
+                return;
+                }
+            }
+        }
+#endif    
+    
     CAknPopupList::HandlePointerEventL(aPointerEvent);
     }
 
@@ -915,4 +977,21 @@
     return KErrNone;
     }
 
+#ifdef BRDO_SINGLE_CLICK_ENABLED_FF
+void CDownloadsListDlg::AddAiwItemsL()
+    {
+    iMenuBar->MenuPane()->AddMenuItemsL(R_DMUL_AIW_POPUP);
+    iDlgObserver.AIWPlugInMenusL(R_DMUL_AIW_POPUP,iMenuBar->MenuPane());
+    TInt pos(0);
+    if (iMenuBar->MenuPane()->MenuItemExists(EAiwCmdContact,pos))
+        {
+        iMenuBar->MenuPane()->DeleteMenuItem(EAiwCmdContact);
+        }
+    if (iMenuBar->MenuPane()->MenuItemExists(EAiwCmdRingtone,pos))
+        {
+        iMenuBar->MenuPane()->DeleteMenuItem(EAiwCmdRingtone);
+        }
+        
+    }
+#endif
 /* End of file. */