1 /* |
|
2 * Copyright (c) 2008-2009 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 the License "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 * This file defines the client side of the SIF Transport. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedAll |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef SIFTRANSPORTCLIENT_H |
|
27 #define SIFTRANSPORTCLIENT_H |
|
28 |
|
29 #include <usif/sif/sifcommon.h> |
|
30 #include <scs/scsclient.h> |
|
31 #include <e32base.h> |
|
32 #include <f32file.h> |
|
33 |
|
34 namespace Usif |
|
35 { |
|
36 |
|
37 /** |
|
38 A client part of the SIF Transport. This class sends software management requests |
|
39 across the process boundary to a specified Transport Server. |
|
40 */ |
|
41 class RSifTransportClient : public RScsClientBase |
|
42 { |
|
43 public: |
|
44 IMPORT_C RSifTransportClient(); |
|
45 |
|
46 /** |
|
47 Connects a client to the SIF server. |
|
48 |
|
49 @return Symbian OS error code where KErrNone indicates |
|
50 success and any other value indicates failure. |
|
51 */ |
|
52 IMPORT_C TInt Connect(const TDesC& aServerName, const TVersion& aRequiredVersion, const TDesC& aServerImageName, TUid aServerUid); |
|
53 |
|
54 /** |
|
55 Disconnects a client from the SIF server. |
|
56 */ |
|
57 IMPORT_C void Close(); |
|
58 |
|
59 /** |
|
60 Returns the details of a component to be installed by file name |
|
61 |
|
62 @param aFileName The file name of a component to be queried |
|
63 @param aComponentInfo On return, contains the details of a component |
|
64 @param aStatus The request status. KErrNone, if successful, otherwise |
|
65 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
66 */ |
|
67 IMPORT_C void GetComponentInfo(const TDesC& aFileName, CComponentInfo& aComponentInfo, |
|
68 TRequestStatus& aStatus); |
|
69 |
|
70 /** |
|
71 * Returns the details of a component to be installed by file handle |
|
72 |
|
73 @param aFileHandle The file handle of a component to be queried |
|
74 @param aComponentInfo On return, contains the details of a component |
|
75 @param aStatus The request status. KErrNone, if successful, otherwise |
|
76 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
77 */ |
|
78 IMPORT_C void GetComponentInfo(RFile& aFileHandle, CComponentInfo& aComponentInfo, |
|
79 TRequestStatus& aStatus); |
|
80 |
|
81 /** |
|
82 Installs a component by file name |
|
83 |
|
84 @param aFileName The file name of a component to be installed |
|
85 @param aStatus The request status. KErrNone, if successful, otherwise |
|
86 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
87 @param aExclusiveOperation If this flag is set to ETrue, the Install |
|
88 operation is executed in the Exclusive mode. In this mode the SIF Transport |
|
89 Server executes only one operation at a time. If there is another |
|
90 operation in progress the SIF Server returns KErrServerBusy. |
|
91 If this flag is set to EFalse, the SIF Server executes the operation |
|
92 even if there is a concurrent operation in progress. |
|
93 */ |
|
94 IMPORT_C void Install(const TDesC& aFileName, TRequestStatus& aStatus, |
|
95 TBool aExclusiveOperation); |
|
96 |
|
97 /** |
|
98 Installs a component by file name using opaque arguments/results |
|
99 |
|
100 @param aFileName The file name of a component to be installed |
|
101 @param aArguments The array of opaque params for the plug-in. An empty |
|
102 array may be passed. The following param is defined for the "SCOMO Install |
|
103 Inactive" operation: |
|
104 Name: InstallInactive, Type: Int, Value: ETrue |
|
105 @param aResults The array of opaque params returned from the plug-in. |
|
106 The following return param is defined for the id of an installed component: |
|
107 Name: ComponentId, Type: Int |
|
108 For packages containing embedded components, the returned param contains |
|
109 the id of the last/most embedded component. |
|
110 @param aStatus The request status. KErrNone, if successful, otherwise |
|
111 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
112 @param aExclusiveOperation Enables the ExclusiveOperation mode. Please |
|
113 see @see RSifTransportClient::Install by file name for details. |
|
114 */ |
|
115 IMPORT_C void Install(const TDesC& aFileName, const COpaqueNamedParams& aArguments, |
|
116 COpaqueNamedParams& aResults, TRequestStatus& aStatus, |
|
117 TBool aExclusiveOperation); |
|
118 |
|
119 /** |
|
120 Installs a component by file handle |
|
121 |
|
122 @param aFileHandle The file handle of a component to be installed |
|
123 @param aStatus The request status. KErrNone, if successful, otherwise |
|
124 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
125 @param aExclusiveOperation Enables the ExclusiveOperation mode. Please |
|
126 see @see RSifTransportClient::Install by file name for details. |
|
127 */ |
|
128 IMPORT_C void Install(RFile& aFileHandle, TRequestStatus& aStatus, |
|
129 TBool aExclusiveOperation); |
|
130 |
|
131 /** |
|
132 Installs a component by file handle using opaque arguments/results |
|
133 |
|
134 @param aFileHandle The file handle of a component to be installed |
|
135 @param aArguments The array of opaque params for the plug-in. An empty |
|
136 array may be passed. The following param is defined for the "SCOMO Install |
|
137 Inactive" operation: |
|
138 Name: InstallInactive, Type: Int, Value: ETrue |
|
139 @param aResults The array of opaque params returned from the plug-in. |
|
140 The following return param is defined for the id of an installed component: |
|
141 Name: ComponentId, Type: Int |
|
142 For packages containing embedded components, the returned param contains |
|
143 the id of the last/most embedded component. |
|
144 @param aStatus The request status. KErrNone, if successful, otherwise |
|
145 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
146 @param aExclusiveOperation Enables the ExclusiveOperation mode. Please |
|
147 see @see RSifTransportClient::Install by file name for details. |
|
148 */ |
|
149 IMPORT_C void Install(RFile& aFileHandle, const COpaqueNamedParams& aArguments, |
|
150 COpaqueNamedParams& aResults, TRequestStatus& aStatus, |
|
151 TBool aExclusiveOperation); |
|
152 |
|
153 /** |
|
154 Uninstalls a component |
|
155 |
|
156 @param aComponentId The id of a component to be uninstalled |
|
157 @param aStatus The request status. KErrNone, if successful, otherwise |
|
158 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
159 @param aExclusiveOperation Enables the ExclusiveOperation mode. Please |
|
160 see @see RSifTransportClient::Install by file name for details. |
|
161 */ |
|
162 IMPORT_C void Uninstall(TComponentId aComponentId, TRequestStatus& aStatus, |
|
163 TBool aExclusiveOperation); |
|
164 |
|
165 /** |
|
166 Uninstalls a component |
|
167 |
|
168 @param aComponentId The id of a component to be uninstalled |
|
169 @param aArguments The array of opaque params for the plug-in. An empty |
|
170 array may be passed. |
|
171 @param aResults The array of opaque results returned from the plug-in. |
|
172 @param aStatus The request status. KErrNone, if successful, otherwise |
|
173 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
174 @param aExclusiveOperation Enables the ExclusiveOperation mode. Please |
|
175 see @see RSifTransportClient::Install by file name for details. |
|
176 */ |
|
177 IMPORT_C void Uninstall(TComponentId aComponentId, const COpaqueNamedParams& aArguments, |
|
178 COpaqueNamedParams& aResults, TRequestStatus& aStatus, |
|
179 TBool aExclusiveOperation); |
|
180 |
|
181 /** |
|
182 Activates a component |
|
183 |
|
184 @param aComponentId The id of a component to be activated |
|
185 @param aStatus The request status. KErrNone, if successful, otherwise |
|
186 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
187 */ |
|
188 IMPORT_C void Activate(TComponentId aComponentId, TRequestStatus& aStatus); |
|
189 |
|
190 /** |
|
191 Deactivates a component |
|
192 |
|
193 @param aComponentId The id of a component to be deactivated |
|
194 @param aStatus The request status. KErrNone, if successful, otherwise |
|
195 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
196 */ |
|
197 IMPORT_C void Deactivate(TComponentId aComponentId, TRequestStatus& aStatus); |
|
198 |
|
199 /** |
|
200 Cancels an ongoing asynchronous request |
|
201 |
|
202 This is a synchronous call. When it returns the original asynchronous call is completed. |
|
203 */ |
|
204 IMPORT_C void CancelOperation(); |
|
205 |
|
206 private: |
|
207 void CallSifFunction(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus); |
|
208 void PrepareOpaqueParamsL(TIpcArgs& aIpcArgs, const COpaqueNamedParams& aArguments, |
|
209 COpaqueNamedParams& aResults); |
|
210 |
|
211 HBufC8* iArgBuf; |
|
212 HBufC8* iResBuf; |
|
213 TInt iOngoingFunction; |
|
214 }; |
|
215 |
|
216 } // namespace Usif |
|
217 |
|
218 #endif // SIFTRANSPORTCLIENT_H |
|