|
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_CaInstaller): public CActive { |
|
31 |
|
32 public: |
|
33 /** |
|
34 * Destructor |
|
35 */ |
|
36 virtual ~T_CaInstaller(); |
|
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_CaInstaller *NewL( TInt aPriority = |
|
48 CActive::EPriorityStandard ); |
|
49 |
|
50 /** |
|
51 * Starts asynchronous installation operation |
|
52 * @param aFileName name of the file to be installed |
|
53 * @param aComponentId placeholder for component id of the package after |
|
54 * instalation is completed. |
|
55 */ |
|
56 void InstallL(const TDesC& aFileName); |
|
57 /** |
|
58 * Uninstall operation |
|
59 * @param aComponentId id of the component to be installed. |
|
60 */ |
|
61 void UninstallL( Usif::TComponentId aComponentId ); |
|
62 |
|
63 /** |
|
64 * Uninstall operation for package(s) based on filename |
|
65 * for native and HS widgets. |
|
66 * @param aFileName the file name installed with the package(s) |
|
67 */ |
|
68 void UninstallL( const TDesC& aFileName ); |
|
69 |
|
70 /** |
|
71 * Uninstall operation for java applications |
|
72 * @param aUid ui |
|
73 */ |
|
74 void UninstallL(TUint32 aUid); |
|
75 |
|
76 /** |
|
77 * Find component id for a file name |
|
78 * @param aFileName the file name installed with the package(s) |
|
79 * @return componentId for a requested file name |
|
80 */ |
|
81 Usif::TComponentId GetComponentIdL( const TDesC& aFileName ); |
|
82 |
|
83 /** |
|
84 * Find component id for a uid |
|
85 * @param aUid ui |
|
86 * @return componentId for a requested uid |
|
87 */ |
|
88 Usif::TComponentId GetComponentIdL( TInt32 aUid ); |
|
89 |
|
90 /** |
|
91 * Find component id for CWRT app id |
|
92 * @param aAppId CWRT widget app id |
|
93 * @return componentId for a requested uid |
|
94 */ |
|
95 Usif::TComponentId GetComponentIdForAppIdL( const TDesC& aAppId); |
|
96 private: |
|
97 // construction |
|
98 /** |
|
99 * Constructor. |
|
100 * Starts active scheduler. |
|
101 * @param aPriority priority of the active scheduler responsible for handling |
|
102 * asynchronous installation operation |
|
103 */ |
|
104 T_CaInstaller(TInt aPriority); |
|
105 |
|
106 /** |
|
107 * Initializes the object and starts asynchronous uninstallation process. |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 |
|
112 |
|
113 private: |
|
114 // from CActive |
|
115 |
|
116 void RunL(); |
|
117 void DoCancel(); |
|
118 TInt RunError( TInt aError ); |
|
119 |
|
120 private: |
|
121 Usif::COpaqueNamedParams* iArguments; |
|
122 Usif::COpaqueNamedParams* iResults; |
|
123 RFs iFs; |
|
124 Usif::RSoftwareInstall iInstaller; |
|
125 Usif::RSoftwareComponentRegistry iSoftwareRegistry; |
|
126 CActiveSchedulerWait iSchedulerWait; |
|
127 }; |
|
128 |
|
129 #endif // T_CA_INSTALLER_H |