|
1 /* |
|
2 * Copyright (c) 2009-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: |
|
15 * Declares the CInstallManager class for ADM application. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __ADMINSTALLMANAGER_H__ |
|
22 #define __ADMINSTALLMANAGER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <swinstdefs.h> |
|
26 #include <swinstapi.h> |
|
27 |
|
28 //TODO: KNoDriveSelected is currently redefined in statemachine.cpp. |
|
29 //#include <sisregistrysession.h> //for KNoDriveSelected |
|
30 |
|
31 class TSisInfo; |
|
32 |
|
33 class CInstallManager: public CActive |
|
34 { |
|
35 public: |
|
36 class MInstallClient |
|
37 { |
|
38 public: |
|
39 virtual void HandleInstallCompletedL(TInt aStatus) = 0; |
|
40 }; |
|
41 #ifdef USE_LOGFILE |
|
42 public: |
|
43 static CInstallManager* NewL(MInstallClient* aInstallClient, RFileLogger& aLogger); |
|
44 static CInstallManager* NewLC(MInstallClient* aInstallClient, RFileLogger& aLogger); |
|
45 private: |
|
46 CInstallManager(MInstallClient* aInstallClient, RFileLogger& aLogger); |
|
47 |
|
48 private: |
|
49 RFileLogger& iLog; |
|
50 #else |
|
51 public: |
|
52 static CInstallManager* NewL(MInstallClient* aInstallClient); |
|
53 static CInstallManager* NewLC(MInstallClient* aInstallClient); |
|
54 private: |
|
55 CInstallManager(MInstallClient* aInstallClient); |
|
56 #endif |
|
57 |
|
58 public: |
|
59 ~CInstallManager(); |
|
60 |
|
61 public: |
|
62 TBool IsPackagePresentL( const TUid& aUid ); |
|
63 TBool GetPackageVersionInfoL(const TUid& aUid, TVersion& aVersion); |
|
64 TBool GetPackageInstalledDriveL(const TUid& aUid, TChar& aWrapperDrive); |
|
65 TBool GetPackageSidsL(const TUid& aUid, RArray<TUid>& aSids); |
|
66 void SilentInstallPackageL(const TDesC& aInstallFilename, const TChar aInstallDrive = 'C'); |
|
67 TInt SilentUnInstallPackage(const TUid& aPkgUid); |
|
68 void SilentUninstallPackageAsync(const TUid& aPkgUid); |
|
69 TInt InstallPackage(const TDesC& aInstallFilename); |
|
70 TUid GetPackageUidL(const TUid& aSid); |
|
71 void CancelAll(); |
|
72 TInt CancelInstallation(); |
|
73 TInt CancelUninstallation(); |
|
74 |
|
75 protected: |
|
76 TSisInfo GetPackageInfoL(const TUid& aUid, TBool& aIsInstalled); |
|
77 void RunL(); |
|
78 void DoCancel(); |
|
79 |
|
80 private: |
|
81 void ConstructL(); |
|
82 |
|
83 private: |
|
84 MInstallClient* iInstallClient; |
|
85 HBufC* iInstallFilename; |
|
86 TInt iInstallAttempt; |
|
87 |
|
88 SwiUI::TInstallOptionsPckg iOptionsPckg; |
|
89 SwiUI::TUninstallOptionsPckg iUninstallOptionsPckg; |
|
90 SwiUI::RSWInstSilentLauncher iLauncher; |
|
91 }; |
|
92 |
|
93 #endif //__ADMINSTALLMANAGER_H__ |