13 * |
13 * |
14 * Description: Dialog containing the Downloads List |
14 * Description: Dialog containing the Downloads List |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 |
|
19 |
18 // INCLUDE FILES |
20 // INCLUDE FILES |
19 #include "CDownloadsListDlg.h" |
21 #include "CDownloadsListDlg.h" |
20 #include "CDownloadUtils.h" |
22 #include "CDownloadUtils.h" |
21 #include <downloadslistdlgobserver.h> |
23 #include "DownloadsListDlgObserver.h" |
22 #include "CDownloadsListArray.h" |
24 #include "CDownloadsListArray.h" |
23 #include "DownloadMgrUiLib.hrh" |
25 #include "DownloadMgrUiLib.hrh" |
24 #include "DMgrUiLibPanic.h" |
26 #include "DMgrUiLibPanic.h" |
25 #include "UiLibLogger.h" |
27 #include "UiLibLogger.h" |
26 #include <DownloadMgrUiLib.rsg> |
28 #include <DownloadMgrUiLib.rsg> |
31 #include <eikfrlbd.h> |
33 #include <eikfrlbd.h> |
32 #include <aknlists.h> |
34 #include <aknlists.h> |
33 #include <StringLoader.h> |
35 #include <StringLoader.h> |
34 #include <eikenv.h> |
36 #include <eikenv.h> |
35 #include <DocumentHandler.h> |
37 #include <DocumentHandler.h> |
36 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
38 |
37 #include "CDownloadsStylusPopupMenu.h" |
|
38 #define pixelOffset 36 |
|
39 #endif |
|
40 #include "eikon.hrh" |
39 #include "eikon.hrh" |
|
40 |
41 |
41 |
42 // ============================ MEMBER FUNCTIONS =============================== |
42 // ============================ MEMBER FUNCTIONS =============================== |
43 |
43 |
44 // ----------------------------------------------------------------------------- |
44 // ----------------------------------------------------------------------------- |
45 // CDownloadsListDlg::CDownloadsListDlg |
45 // CDownloadsListDlg::CDownloadsListDlg |
108 iRefreshTimer = CPeriodic::NewL( KRefreshTimerPriority ); |
108 iRefreshTimer = CPeriodic::NewL( KRefreshTimerPriority ); |
109 CLOG_WRITE(" iRefreshTimer created"); |
109 CLOG_WRITE(" iRefreshTimer created"); |
110 |
110 |
111 iDownloadUtils = CDownloadUtils::NewL(); |
111 iDownloadUtils = CDownloadUtils::NewL(); |
112 |
112 |
113 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
|
114 iStylusMenu = CDlStylusPopupMenu::NewL(); |
|
115 #endif |
|
116 CLOG_LEAVEFN("CDownloadsListDlg::ConstructL"); |
113 CLOG_LEAVEFN("CDownloadsListDlg::ConstructL"); |
117 } |
114 } |
118 |
115 |
119 // ----------------------------------------------------------------------------- |
116 // ----------------------------------------------------------------------------- |
120 // CDownloadsListDlg::NewL |
117 // CDownloadsListDlg::NewL |
159 iRefreshTimer = 0; |
156 iRefreshTimer = 0; |
160 delete iListBox; |
157 delete iListBox; |
161 iListBox = NULL; |
158 iListBox = NULL; |
162 delete iDownloadUtils; |
159 delete iDownloadUtils; |
163 iDownloadUtils = NULL; |
160 iDownloadUtils = NULL; |
164 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
161 |
165 if (iStylusMenu) |
|
166 { |
|
167 delete iStylusMenu; |
|
168 iStylusMenu = NULL; |
|
169 } |
|
170 #endif |
|
171 CLOG_LEAVEFN("CDownloadsListDlg::~CDownloadsListDlg"); |
162 CLOG_LEAVEFN("CDownloadsListDlg::~CDownloadsListDlg"); |
172 } |
163 } |
173 |
164 |
174 // ----------------------------------------------------------------------------- |
165 // ----------------------------------------------------------------------------- |
175 // CDownloadsListDlg::SetModelL |
166 // CDownloadsListDlg::SetModelL |
205 // Disable Options softkey. |
196 // Disable Options softkey. |
206 ButtonGroupContainer()->MakeCommandVisible( EAknSoftkeyOptions, EFalse ); |
197 ButtonGroupContainer()->MakeCommandVisible( EAknSoftkeyOptions, EFalse ); |
207 CLOG_WRITE(" aModel.Count() == 0"); |
198 CLOG_WRITE(" aModel.Count() == 0"); |
208 } |
199 } |
209 |
200 |
210 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
|
211 TInt Inprogress = iDownloadsListArray->DownloadsCount |
|
212 ( MASKED_DL_STATE(EHttpDlCreated) | |
|
213 MASKED_DL_STATE(EHttpDlPaused) | |
|
214 MASKED_DL_STATE(EHttpDlInprogress) | |
|
215 MASKED_DL_STATE(EHttpDlMultipleMOFailed)); |
|
216 |
|
217 if ( Inprogress > 1 ) |
|
218 { |
|
219 ButtonGroupContainer()->MakeCommandVisible( EAknSoftkeyOptions, ETrue ); |
|
220 } |
|
221 else |
|
222 { |
|
223 ButtonGroupContainer()->MakeCommandVisible( EAknSoftkeyOptions, EFalse ); |
|
224 } |
|
225 #endif |
|
226 |
|
227 CLOG_LEAVEFN("CDownloadsListDlg::SetModelL"); |
201 CLOG_LEAVEFN("CDownloadsListDlg::SetModelL"); |
228 } |
202 } |
229 |
203 |
230 // ----------------------------------------------------------------------------- |
204 // ----------------------------------------------------------------------------- |
231 // CDownloadsListDlg::HandleModelChangeL |
205 // CDownloadsListDlg::HandleModelChangeL |
641 { |
615 { |
642 HandleMiddleSoftKeyChangeL(); |
616 HandleMiddleSoftKeyChangeL(); |
643 break; |
617 break; |
644 } |
618 } |
645 case MEikListBoxObserver::EEventItemDoubleClicked: |
619 case MEikListBoxObserver::EEventItemDoubleClicked: |
646 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
|
647 case MEikListBoxObserver::EEventItemSingleClicked: |
|
648 #endif |
|
649 { |
620 { |
650 // If EAknSoftkeyOpen is visible, then we can activate the selected download |
621 // If EAknSoftkeyOpen is visible, then we can activate the selected download |
651 if (ButtonGroupContainer()->IsCommandVisible(EAknSoftkeyOpen)) |
622 if (ButtonGroupContainer()->IsCommandVisible(EAknSoftkeyOpen)) |
652 { |
623 { |
653 ProcessCommandL(EAknSoftkeyOpen); |
624 ProcessCommandL(EAknSoftkeyOpen); |
710 // CDownloadsListDlg::HandlePointerEventL |
681 // CDownloadsListDlg::HandlePointerEventL |
711 // ----------------------------------------------------------------------------- |
682 // ----------------------------------------------------------------------------- |
712 // |
683 // |
713 void CDownloadsListDlg::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
684 void CDownloadsListDlg::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
714 { |
685 { |
715 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
|
716 if ( aPointerEvent.iType == TPointerEvent::EButton1Down) |
|
717 { |
|
718 iPointerEvent = aPointerEvent; |
|
719 iStylusMenu->HandlePointerEventL(aPointerEvent, this); |
|
720 } |
|
721 else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
722 { |
|
723 iStylusMenu->cancelLongTapL(); |
|
724 if(iStylusMenu->islongtapRunning()) |
|
725 { |
|
726 iStylusMenu->reSetLongTapFlag(); |
|
727 return; |
|
728 } |
|
729 } |
|
730 else if ( aPointerEvent.iType == TPointerEvent::EDrag ) |
|
731 { |
|
732 if((Abs(iPointerEvent.iPosition.iX - aPointerEvent.iPosition.iX) > pixelOffset ) || |
|
733 (Abs(iPointerEvent.iPosition.iY - aPointerEvent.iPosition.iY) > pixelOffset )) |
|
734 { |
|
735 iStylusMenu->cancelLongTapL(); |
|
736 if(iStylusMenu->islongtapRunning()) |
|
737 { |
|
738 iStylusMenu->reSetLongTapFlag(); |
|
739 return; |
|
740 } |
|
741 } |
|
742 } |
|
743 #endif |
|
744 |
|
745 CAknPopupList::HandlePointerEventL(aPointerEvent); |
686 CAknPopupList::HandlePointerEventL(aPointerEvent); |
746 } |
687 } |
747 |
688 |
748 // ----------------------------------------------------------------------------- |
689 // ----------------------------------------------------------------------------- |
749 // CDownloadsListDlg::OfferKeyEventL |
690 // CDownloadsListDlg::OfferKeyEventL |
975 } |
916 } |
976 |
917 |
977 return KErrNone; |
918 return KErrNone; |
978 } |
919 } |
979 |
920 |
980 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF |
|
981 void CDownloadsListDlg::AddAiwItemsL() |
|
982 { |
|
983 iMenuBar->MenuPane()->AddMenuItemsL(R_DMUL_AIW_POPUP); |
|
984 iDlgObserver.AIWPlugInMenusL(R_DMUL_AIW_POPUP,iMenuBar->MenuPane()); |
|
985 TInt pos(0); |
|
986 if (iMenuBar->MenuPane()->MenuItemExists(EAiwCmdContact,pos)) |
|
987 { |
|
988 iMenuBar->MenuPane()->DeleteMenuItem(EAiwCmdContact); |
|
989 } |
|
990 if (iMenuBar->MenuPane()->MenuItemExists(EAiwCmdRingtone,pos)) |
|
991 { |
|
992 iMenuBar->MenuPane()->DeleteMenuItem(EAiwCmdRingtone); |
|
993 } |
|
994 |
|
995 } |
|
996 #endif |
|
997 /* End of file. */ |
921 /* End of file. */ |