|
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: Test installer that uses Usif::RSoftwareInstall API. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TESTINSTALLER_H |
|
19 #define TESTINSTALLER_H |
|
20 |
|
21 #include <hbapplication.h> |
|
22 #include <QStringList> |
|
23 #include <usif/usifcommon.h> |
|
24 |
|
25 class HbMainWindow; |
|
26 class HbView; |
|
27 class HbLabel; |
|
28 class HbComboBox; |
|
29 class ActiveRunner; |
|
30 |
|
31 |
|
32 class TestInstaller : public HbApplication |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: // constructor and destructor |
|
37 TestInstaller(int& argc, char* argv[]); |
|
38 ~TestInstaller(); |
|
39 |
|
40 private slots: |
|
41 void installViewActivated(); |
|
42 void removeViewActivated(); |
|
43 void silentInstallCheckChanged(int state); |
|
44 void silentRemoveCheckChanged(int state); |
|
45 void rfileCheckChanged(int state); |
|
46 void ocspCheckChanged(int state); |
|
47 void installableDirChanged(int index); |
|
48 void installableFileChanged(int index); |
|
49 void installUsingNewApi(); |
|
50 void installUsingOldApi(); |
|
51 void installByOpeningFile(); |
|
52 void cancelInstalling(); |
|
53 void removeUsingNewApi(); |
|
54 void removeUsingOldApi(); |
|
55 void handleComplete(); |
|
56 void handleError(int error); |
|
57 void closeApp(); |
|
58 void fileOpenOk(const QVariant &result); |
|
59 void fileOpenFailed(int errorCode, const QString &errorMsg); |
|
60 |
|
61 private: // functions |
|
62 void getInstallDirs(QStringList& dirList); |
|
63 void changeDir(const QString& dirPath); |
|
64 void getRemovableApps(); |
|
65 void doGetRemovableAppsL(); |
|
66 bool isFileSelected(); |
|
67 bool createRunner(bool useSif); |
|
68 void doInstall(const QString &fileName); |
|
69 void doOpenFile(const QString &fileName); |
|
70 void removeSelectedUsingNewApi(); |
|
71 void removeSelectedUsingOldApi(); |
|
72 |
|
73 private: // data |
|
74 HbMainWindow *mMainWindow; |
|
75 HbView *mInstallView; |
|
76 HbView *mRemoveView; |
|
77 bool mUseSilentInstall; |
|
78 bool mUseSilentUninstall; |
|
79 bool mUseRFileInstall; |
|
80 bool mOcsp; |
|
81 HbComboBox *mInstallDirectories; |
|
82 HbComboBox *mInstallableFiles; |
|
83 HbComboBox *mRemovableApps; |
|
84 QList<Usif::TComponentId> mRemovableComponentIds; |
|
85 QList<TUid> mRemovableUids; |
|
86 enum TSoftwareType { |
|
87 Unknown, |
|
88 Native, |
|
89 Java |
|
90 }; |
|
91 QList<TSoftwareType> mRemovableSoftwareTypes; |
|
92 QString mCurrentDirPath; |
|
93 QString mCurrentFile; |
|
94 ActiveRunner *mRunner; |
|
95 }; |
|
96 |
|
97 #endif // TESTINSTALLER_H |