1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
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 * |
|
14 * Description: Software install progress indicator |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef SIFUIINSTALLINDICATOR_H |
|
19 #define SIFUIINSTALLINDICATOR_H |
|
20 |
|
21 #include <hbindicatorinterface.h> |
|
22 #include <qmobilityglobal.h> // QTM namespace macros |
|
23 |
|
24 QTM_BEGIN_NAMESPACE |
|
25 class QValueSpacePublisher; |
|
26 QTM_END_NAMESPACE |
|
27 |
|
28 // Variant map keys for parameters |
|
29 const QString KSifUiInstallIndicatorAppName = "name"; // QString |
|
30 const QString KSifUiInstallIndicatorPhase = "phase"; // int (enum Phase) |
|
31 const QString KSifUiInstallIndicatorProgress = "prog"; // int (0..100) |
|
32 const QString KSifUiInstallIndicatorComplete = "done"; // int (KErrNone or error code) |
|
33 const QString KSifUiInstallIndicatorIcon = "icon"; // TODO: TBD |
|
34 |
|
35 |
|
36 /** |
|
37 * Software install progress indicator for the status indicator area |
|
38 * and/or in universal indicator popup. |
|
39 */ |
|
40 class SifUiInstallIndicator : public HbIndicatorInterface |
|
41 { |
|
42 Q_OBJECT |
|
43 |
|
44 public: // constructor and destructor |
|
45 SifUiInstallIndicator(const QString &indicatorType); |
|
46 virtual ~SifUiInstallIndicator(); |
|
47 |
|
48 public: // from HbIndicatorInterface |
|
49 virtual bool handleInteraction(InteractionType type); |
|
50 virtual QVariant indicatorData(int role) const; |
|
51 |
|
52 protected: // from HbIndicatorInterface |
|
53 bool handleClientRequest(RequestType type, const QVariant ¶meter); |
|
54 |
|
55 private: // new Symbian functions, TODO: move to symbian-specific code |
|
56 void CreateNotifierL(); |
|
57 void StartListeningOperationsL(); |
|
58 void StopListeningOperationsL(); |
|
59 |
|
60 private: // new functions |
|
61 void processParameters(const QVariant ¶meter); |
|
62 void publishActivityStatus(bool status); |
|
63 |
|
64 private: // data |
|
65 QString mAppName; |
|
66 int mProgress; |
|
67 QTM_PREPEND_NAMESPACE(QValueSpacePublisher) *mPublisher; |
|
68 bool mIsActive; |
|
69 enum Phase { |
|
70 Installing, |
|
71 Downloading, |
|
72 CheckingCerts |
|
73 } mPhase; |
|
74 bool mIsComplete; |
|
75 int mErrorCode; |
|
76 }; |
|
77 |
|
78 #endif // SIFUIINSTALLINDICATOR_H |
|
79 |
|