1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
8 * |
14 * Description: Implementation of applicationmanagement components |
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
15 * |
11 * |
16 */ |
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of applicationmanagement components |
|
15 * |
|
16 */ |
17 |
17 |
|
18 #include <QObject> |
|
19 #include <QTimeLine> |
|
20 #include <hbprogressdialog.h> |
|
21 #include <hbindicator.h> |
|
22 #include <download.h> |
18 |
23 |
19 #include <eikprogi.h> |
24 using namespace WRT; |
20 #include <AknWaitDialog.h> |
25 class AppMgmtProgDialog : public QObject |
21 #include <AknProgressDialog.h> |
|
22 |
|
23 #include <coemain.h> |
|
24 |
|
25 class MDLProgressDlgObserver |
|
26 { |
26 { |
27 public: |
27 Q_OBJECT |
28 |
|
29 /** |
|
30 * Called when the dialog is going to be closed. |
|
31 * |
|
32 * @since S60 v3.1 |
|
33 * @param aButtonId Id of the button, which was used to cancel |
|
34 * the dialog. |
|
35 */ |
|
36 virtual void HandleDLProgressDialogExitL(TInt aButtonId) = 0; |
|
37 }; |
|
38 |
|
39 class CAppMgmtProgDialog : public CBase, public MProgressDialogCallback |
|
40 { |
|
41 public: |
|
42 |
|
43 CAppMgmtProgDialog(MDLProgressDlgObserver *iCallback); |
|
44 ~CAppMgmtProgDialog(); |
|
45 |
|
46 void StartProgressNoteL(); |
|
47 void UpdateProcessL(TInt aProgress); |
|
48 |
|
49 void SetFinalValueL(TInt32 aFinalvalue); |
|
50 |
|
51 /** |
|
52 * Offers key event for progress dialog. |
|
53 * |
|
54 * @since S60 v3.1 |
|
55 * @param aKeyEvent Key event |
|
56 * @param aType Event type |
|
57 * @return None |
|
58 */ |
|
59 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
60 |
28 |
61 public: |
29 public: |
62 // from base classes |
30 AppMgmtProgDialog(QString aAppData, Download &mdl,int &aUserCancelled); |
63 |
31 ~AppMgmtProgDialog(); |
64 |
32 void startDialog(int aContentSize,int aDownloaded); |
65 /** |
33 void closeAMProgDialog(); |
66 * From CEikDialog, respond to softkey inputs. |
34 void updateProgress(int aProgress); |
67 * |
35 public slots: |
68 * @since S60 v3.1 |
36 void hideAMProgDialog(); |
69 * @para aButtonId, type of pressed Button or Softkey |
37 void cancelDialog(); |
70 * @return TBool, ETrue if exit the dialog, otherwise EFalse. |
|
71 */ |
|
72 TBool OkToExitL(TInt aButtonId); |
|
73 |
|
74 void ProgressCompletedL(); |
|
75 |
|
76 public: |
|
77 |
|
78 protected: |
|
79 // other system interface functions |
|
80 void DialogDismissedL(TInt aButtonId); |
|
81 |
|
82 private: |
38 private: |
83 |
39 void sendServerToBackground(); |
84 CAknProgressDialog* iProgressDialog; |
40 private: |
85 CEikProgressInfo* iProgressInfo; |
41 int iContentSize; |
86 |
42 int mUsrCancel; |
87 MDLProgressDlgObserver* iDlgObserver; |
43 Download* iDl; |
88 |
44 QString m_Data; |
|
45 HbProgressDialog* m_Dlg; |
|
46 QString m_Name; |
|
47 QString m_SizeStr; |
|
48 HbIndicator* m_Indi; |
89 }; |
49 }; |