|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_CA_INSTALLER_H |
|
19 #define T_CA_INSTALLER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <f32file.h> |
|
23 #include <usif/sif/sif.h> |
|
24 #include <usif/scr/scr.h> |
|
25 |
|
26 /** |
|
27 * Installer |
|
28 * |
|
29 */ |
|
30 NONSHARABLE_CLASS(T_Installer): public CActive { |
|
31 |
|
32 public: |
|
33 /** |
|
34 * Destructor |
|
35 */ |
|
36 virtual ~T_Installer(); |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. Leaves on failure. |
|
40 * Allocates memory for and constructs an uninstaller object. After that |
|
41 * starts asynchronous uninnstallation of the requested entry |
|
42 * @param aFileName name of the file to be installed |
|
43 * @param aPriority priority of the active scheduler responsible for handling |
|
44 * asynchronous installation operation |
|
45 * @return The constructed object. |
|
46 */ |
|
47 static T_Installer *NewL( TInt aPriority = CActive::EPriorityStandard ); |
|
48 |
|
49 /** |
|
50 * Starts asynchronous installation operation |
|
51 * @param aFileName name of the file to be installed |
|
52 * @param aComponentId placeholder for component id of the package after |
|
53 * instalation is completed. |
|
54 */ |
|
55 void InstallL(const TDesC& aFileName); |
|
56 /** |
|
57 * Uninstall operation |
|
58 * @param aComponentId id of the component to be installed. |
|
59 */ |
|
60 void UninstallL( Usif::TComponentId aComponentId ); |
|
61 |
|
62 /** |
|
63 * Uninstall operation for package(s) based on filename |
|
64 * for native and HS widgets. |
|
65 * @param aFileName the file name installed with the package(s) |
|
66 */ |
|
67 void UninstallL( const TDesC& aFileName ); |
|
68 |
|
69 /** |
|
70 * Uninstall operation for java applications |
|
71 * @param aUid ui |
|
72 */ |
|
73 void UninstallL(TUint32 aUid); |
|
74 |
|
75 /** |
|
76 * Find component id for a file name |
|
77 * @param aFileName the file name installed with the package(s) |
|
78 * @return componentId for a requested file name |
|
79 */ |
|
80 Usif::TComponentId GetComponentIdL( const TDesC& aFileName ); |
|
81 |
|
82 /** |
|
83 * Find component id for a uid |
|
84 * @param aUid ui |
|
85 * @return componentId for a requested uid |
|
86 */ |
|
87 Usif::TComponentId GetComponentIdL( TInt32 aUid ); |
|
88 private: |
|
89 // construction |
|
90 /** |
|
91 * Constructor. |
|
92 * Starts active scheduler. |
|
93 * @param aPriority priority of the active scheduler responsible for handling |
|
94 * asynchronous installation operation |
|
95 */ |
|
96 T_Installer(TInt aPriority); |
|
97 |
|
98 /** |
|
99 * Initializes the object and starts asynchronous uninstallation process. |
|
100 */ |
|
101 void ConstructL(); |
|
102 |
|
103 |
|
104 |
|
105 private: |
|
106 // from CActive |
|
107 |
|
108 void RunL(); |
|
109 void DoCancel(); |
|
110 TInt RunError( TInt aError ); |
|
111 |
|
112 private: |
|
113 Usif::COpaqueNamedParams* iArguments; |
|
114 Usif::COpaqueNamedParams* iResults; |
|
115 // RFs iFs; |
|
116 Usif::RSoftwareInstall iInstaller; |
|
117 Usif::RSoftwareComponentRegistry iSoftwareRegistry; |
|
118 CActiveSchedulerWait iSchedulerWait; |
|
119 }; |
|
120 |
|
121 #endif // T_CA_INSTALLER_H |