|
1 /* |
|
2 * Copyright (c) 2002-2004 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: This file contains the header file of the RSWInstLauncher |
|
15 * class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef SWINSTAPI_H |
|
21 #define SWINSTAPI_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <AknServerApp.h> |
|
25 #include <SWInstDefs.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class RFile; |
|
29 |
|
30 namespace SwiUI |
|
31 { |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CErrDetails; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Client side handle to access SW Installer UI services. |
|
40 * |
|
41 * @lib swinst.lib |
|
42 * @since 3.0 |
|
43 */ |
|
44 class RSWInstLauncher : public RAknAppServiceBase |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Constructor. |
|
50 */ |
|
51 IMPORT_C RSWInstLauncher(); |
|
52 |
|
53 /** |
|
54 * Creates connection to the server. This will launch the installer |
|
55 * as server application. |
|
56 * @since 3.0 |
|
57 * @return Error code |
|
58 */ |
|
59 IMPORT_C TInt Connect(); |
|
60 |
|
61 /** |
|
62 * Closes the connection to the server and close the installer server |
|
63 * application. |
|
64 * @since 3.0 |
|
65 */ |
|
66 IMPORT_C void Close(); |
|
67 |
|
68 /** |
|
69 * Start Installation of the package. The call will return when the installation |
|
70 * if over. |
|
71 * @since 3.0 |
|
72 * @param aFileName - Path to the installation package |
|
73 * @return Error code. |
|
74 */ |
|
75 IMPORT_C TInt Install( const TDesC& aFileName ); |
|
76 |
|
77 /** |
|
78 * Asynchronous version. The aReqStatus will be completed when installation is finished. |
|
79 * To cancel the request, use CancelAsyncRequest with ERequestInstall. |
|
80 */ |
|
81 IMPORT_C void Install( TRequestStatus& aReqStatus, const TDesC& aFileName ); |
|
82 |
|
83 /** |
|
84 * Start Installation of the package |
|
85 * @since 3.0 |
|
86 * @param aFile - Handle to the installation package. |
|
87 * @return Error code |
|
88 */ |
|
89 IMPORT_C TInt Install( RFile& aFile ); |
|
90 |
|
91 /** |
|
92 * Asynchronous version. |
|
93 * To cancel the request, use CancelAsyncRequest with ERequestInstall. |
|
94 */ |
|
95 IMPORT_C void Install( TRequestStatus& aReqStatus, RFile& aFile ); |
|
96 |
|
97 /** |
|
98 * Start Installation of the package |
|
99 * @since 3.0 |
|
100 * @param aFileName - Path to the installation package |
|
101 * @param aParams - Installer parameters. Use TInstallReqPckg to package. |
|
102 * @return Error code |
|
103 */ |
|
104 IMPORT_C TInt Install( const TDesC& aFileName, const TDesC8& aParams ); |
|
105 |
|
106 /** |
|
107 * Asynchronous version |
|
108 * To cancel the request, use CancelAsyncRequest with ERequestInstallParams. |
|
109 */ |
|
110 IMPORT_C void Install( TRequestStatus& aReqStatus, |
|
111 const TDesC& aFileName, |
|
112 const TDesC8& aParams ); |
|
113 |
|
114 /** |
|
115 * Start Installation of the package |
|
116 * @since 3.0 |
|
117 * @param aFile - Handle to the installation package. |
|
118 * @param aParams - Installer parameters. Use TInstallReqPckg to package. |
|
119 * @return Error code |
|
120 */ |
|
121 IMPORT_C TInt Install( RFile& aFile, const TDesC8& aParams ); |
|
122 |
|
123 /** |
|
124 * Asynchronous version |
|
125 * To cancel the request, use CancelAsyncRequest with ERequestInstallParams. |
|
126 */ |
|
127 IMPORT_C void Install( TRequestStatus& aReqStatus, |
|
128 RFile& aFile, |
|
129 const TDesC8& aParams ); |
|
130 |
|
131 /** |
|
132 * Start silent installation of the package (client must have TrustedUI capabilities) |
|
133 * @since future |
|
134 * @param aFileName - Path to the installation package |
|
135 * @param aOptions - Default options for installation. Use TInstallOptionsPckg to package. |
|
136 * @return Error code |
|
137 */ |
|
138 IMPORT_C TInt SilentInstall( const TDesC& aFileName, const TDesC8& aOptions ); |
|
139 |
|
140 /** |
|
141 * Asynchronous version |
|
142 * To cancel the request, use CancelAsyncRequest with ERequestSilentInstall. |
|
143 */ |
|
144 IMPORT_C void SilentInstall( TRequestStatus& aReqStatus, |
|
145 const TDesC& aFileName, |
|
146 const TDesC8& aOptions ); |
|
147 |
|
148 /** |
|
149 * Start silent installation of the package (client must have TrustedUI capabilities) |
|
150 * @since future |
|
151 * @param aFile - Handle to the installation package. |
|
152 * @param aOptions - Default options for installation. Use TInstallOptionsPckg to package. |
|
153 * @return Error code |
|
154 */ |
|
155 IMPORT_C TInt SilentInstall( RFile& aFile, const TDesC8& aOptions ); |
|
156 |
|
157 /** |
|
158 * Asynchronous version |
|
159 * To cancel the request, use CancelAsyncRequest with ERequestSilentInstall. |
|
160 */ |
|
161 IMPORT_C void SilentInstall( TRequestStatus& aReqStatus, |
|
162 RFile& aFile, |
|
163 const TDesC8& aOptions ); |
|
164 |
|
165 /** |
|
166 * Start silent installation of the package (client must have TrustedUI capabilities) |
|
167 * @since future |
|
168 * @param aFileName - Path to the installation package |
|
169 * @param aParams - Installer parameters. Use TInstallReqPckg to package. |
|
170 * @param aOptions - Default options for installation. Use TInstallOptionsPckg to package. |
|
171 * @return Error code |
|
172 */ |
|
173 IMPORT_C TInt SilentInstall( const TDesC& aFileName, |
|
174 const TDesC8& aParams, |
|
175 const TDesC8& aOptions ); |
|
176 |
|
177 /** |
|
178 * Asynchronous version |
|
179 * To cancel the request, use CancelAsyncRequest with ERequestSilentInstallParams. |
|
180 */ |
|
181 IMPORT_C void SilentInstall( TRequestStatus& aReqStatus, |
|
182 const TDesC& aFileName, |
|
183 const TDesC8& aParams, |
|
184 const TDesC8& aOptions ); |
|
185 |
|
186 /** |
|
187 * Start silent installation of the package (client must have TrustedUI capabilities) |
|
188 * @since future |
|
189 * @param aFile - Handle to the installation package. |
|
190 * @param aParams - Installer parameters. Use TInstallReqPckg to package. |
|
191 * @param aOptions - Default options for installation. Use TInstallOptionsPckg to package. |
|
192 * @return Error code |
|
193 */ |
|
194 IMPORT_C TInt SilentInstall( RFile& aFile, |
|
195 const TDesC8& aParams, |
|
196 const TDesC8& aOptions ); |
|
197 |
|
198 /** |
|
199 * Asynchronous version |
|
200 * To cancel the request, use CancelAsyncRequest with ERequestSilentInstallParams. |
|
201 */ |
|
202 IMPORT_C void SilentInstall( TRequestStatus& aReqStatus, |
|
203 RFile& aFile, |
|
204 const TDesC8& aParams, |
|
205 const TDesC8& aOptions ); |
|
206 |
|
207 /** |
|
208 * Start UnInstallation of the package |
|
209 * @since future |
|
210 * @param aUid - uid of the installed package |
|
211 * @param aMIME - Data type of the package to be uninstalled. |
|
212 * @return Error code |
|
213 */ |
|
214 IMPORT_C TInt Uninstall( const TUid& aUid, const TDesC8& aMIME ); |
|
215 |
|
216 /** |
|
217 * Asynchronous version |
|
218 * To cancel the request, use CancelAsyncRequest with ERequestUninstall. |
|
219 */ |
|
220 IMPORT_C void Uninstall( TRequestStatus& aReqStatus, |
|
221 const TUid& aUid, |
|
222 const TDesC8& aMIME ); |
|
223 |
|
224 /** |
|
225 * Start silent UnInstallation of the package, (client must have TrustedUI capabilities) |
|
226 * @since future |
|
227 * @param aUid - uid of the installed package |
|
228 * @param aOptions - Default options for uninstallation. Use TUninstallOptionsPckg to package. |
|
229 * @param aMIME - Data type of the package to be uninstalled. |
|
230 * @return Error code |
|
231 */ |
|
232 IMPORT_C TInt SilentUninstall( const TUid& aUid, |
|
233 const TDesC8& aOptions, |
|
234 const TDesC8& aMIME ); |
|
235 |
|
236 /** |
|
237 * Asynchronous version |
|
238 * To cancel the request, use CancelAsyncRequest with ERequestSilentUninstall. |
|
239 */ |
|
240 IMPORT_C void SilentUninstall( TRequestStatus& aReqStatus, |
|
241 const TUid& aUid, |
|
242 const TDesC8& aOptions, |
|
243 const TDesC8& aMIME ); |
|
244 |
|
245 /** |
|
246 * Cancel Asynchronous requests |
|
247 * @since 3.0 |
|
248 */ |
|
249 IMPORT_C TInt CancelAsyncRequest( TInt aReqToCancel ); |
|
250 |
|
251 IMPORT_C CErrDetails* GetLastErrorL(); |
|
252 |
|
253 /** |
|
254 * Performs a custom uninstallation. |
|
255 * @since 3.0 |
|
256 * @param aOperation - The operation to be performed. |
|
257 * @param aParams - Parameters for the operation |
|
258 */ |
|
259 IMPORT_C TInt CustomUninstall( TOperation aOperation, |
|
260 const TDesC8& aParams, |
|
261 const TDesC8& aMIME ); |
|
262 |
|
263 /** |
|
264 * Asynchronous version |
|
265 * To cancel the request, use CancelAsyncRequest with ERequestCustomUninstall. |
|
266 */ |
|
267 IMPORT_C void CustomUninstall( TRequestStatus& aReqStatus, |
|
268 TOperation aOperation, |
|
269 const TDesC8& aParams, |
|
270 const TDesC8& aMIME ); |
|
271 |
|
272 /** |
|
273 * Performs a silent custom uninstallation. |
|
274 * @since 3.0 |
|
275 * @param aOptions - Default options for uninstallation. |
|
276 * @param aOperation - The operation to be performed. |
|
277 * @param aParams - Parameters for the operation |
|
278 */ |
|
279 IMPORT_C TInt SilentCustomUninstall( TOperation aOperation, |
|
280 const TDesC8& aOptions, |
|
281 const TDesC8& aParams, |
|
282 const TDesC8& aMIME ); |
|
283 |
|
284 /** |
|
285 * Asynchronous version |
|
286 * To cancel the request, use CancelAsyncRequest with ERequestSilentCustomUninstall. |
|
287 */ |
|
288 IMPORT_C void SilentCustomUninstall( TRequestStatus& aReqStatus, |
|
289 TOperation aOperation, |
|
290 const TDesC8& aOptions, |
|
291 const TDesC8& aParams, |
|
292 const TDesC8& aMIME ); |
|
293 |
|
294 protected: |
|
295 |
|
296 /** |
|
297 * Panics the client. |
|
298 * @since 3.0 |
|
299 * @param aPanic - Panic ID. |
|
300 * @return System wide error code. |
|
301 */ |
|
302 void PanicClient( TInt aPanic ) const; |
|
303 |
|
304 private: // From base classes |
|
305 |
|
306 /** |
|
307 * From RApaAppServiceBase, Returns the UID of the service that this session |
|
308 * provides an interface for. |
|
309 * @since 3.0 |
|
310 */ |
|
311 TUid ServiceUid() const; |
|
312 |
|
313 protected:// Data |
|
314 |
|
315 TBool iConnected; // ETrue, if the session has been established |
|
316 |
|
317 private: // Data |
|
318 |
|
319 TAny* reserved1; |
|
320 TAny* reserved2; |
|
321 }; |
|
322 |
|
323 /** |
|
324 * Client side handle to access SW Installer UI services silenty ( no UI ). |
|
325 * |
|
326 * @lib swinst.lib |
|
327 * @since 3.0 |
|
328 */ |
|
329 class RSWInstSilentLauncher : public RSWInstLauncher |
|
330 { |
|
331 public: // Constructors and destructor |
|
332 |
|
333 /** |
|
334 * Constructor. |
|
335 */ |
|
336 IMPORT_C RSWInstSilentLauncher(); |
|
337 |
|
338 /** |
|
339 * Creates connection to the server. This will launch the installer |
|
340 * as a server application. However, the application is started in the background |
|
341 * so that status pane is not visible and the task cannot be seen in |
|
342 * the tasklist. |
|
343 * @since 3.0 |
|
344 * @return Error code |
|
345 */ |
|
346 IMPORT_C TInt Connect(); |
|
347 |
|
348 private: // From base classes |
|
349 |
|
350 /** |
|
351 * From RApaAppServiceBase, Returns the UID of the service that this session |
|
352 * provides an interface for. |
|
353 * @since 3.0 |
|
354 */ |
|
355 virtual TUid ServiceUid() const; |
|
356 |
|
357 private: // New functions |
|
358 |
|
359 /** |
|
360 * Constructs the name of the server application. |
|
361 * @since 3.0 |
|
362 */ |
|
363 void ConstructServerName( TName& aServerName, |
|
364 TUid aAppServerUid, |
|
365 TUint aServerDifferentiator ); |
|
366 |
|
367 /** |
|
368 * Starts the server application. |
|
369 * @since 3.0 |
|
370 */ |
|
371 TUint StartServerL( TUid aAppUid ); |
|
372 |
|
373 /** |
|
374 * Launches the server application. |
|
375 * @since 3.0 |
|
376 */ |
|
377 void LaunchAppL( TUid aAppUid, TUint aServerDifferentiator, TThreadId& aThreadId ); |
|
378 |
|
379 private: // Data |
|
380 |
|
381 TAny* reserved; |
|
382 }; |
|
383 |
|
384 } |
|
385 |
|
386 #endif // SWINSTAPI_H |
|
387 |
|
388 // End of File |
|
389 |
|
390 |