|
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 a SIF plug-in interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedAll |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef SIFPLUGIN_H |
|
27 #define SIFPLUGIN_H |
|
28 |
|
29 #include <e32cmn.h> |
|
30 #include <f32file.h> |
|
31 #include <usif/sif/sifcommon.h> |
|
32 |
|
33 #include <ecom/ecom.h> |
|
34 #include <ecom/implementationproxy.h> |
|
35 |
|
36 namespace Usif |
|
37 { |
|
38 /** ECOM SIF plug-in Uid */ |
|
39 const TUid PluginEcomUid = {0x10285BC2}; |
|
40 |
|
41 /** |
|
42 An abstract SIF plug-in interface. It implements the SIF software management |
|
43 services interfaces for a particular software type. |
|
44 |
|
45 The SIF Server uses a SIF plug-in when a package of a type it supports |
|
46 is to be processed. |
|
47 |
|
48 Each method in this interface provides a security context. An installer may |
|
49 use it in order to verify client's identity and capabilities. For example, a Java |
|
50 installer may require the ECapabilityWriteUserData capability to activate or |
|
51 deactivate a MIDlet. |
|
52 |
|
53 Complex installers that need to be implemented as stand-alone servers may use |
|
54 the SIF Transport library in order to simplify sending/receiving SIF requests |
|
55 across a process boundary. |
|
56 */ |
|
57 class CSifPlugin : public CBase |
|
58 { |
|
59 public: |
|
60 |
|
61 /** |
|
62 A derived class must provide an implementation that returns details of a component |
|
63 to be installed by file name. |
|
64 |
|
65 @param aFileName Component's file name |
|
66 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
67 @param aComponentInfo On return, contains component's details |
|
68 @param aStatus Asynchronous completion status |
|
69 */ |
|
70 virtual void GetComponentInfo(const TDesC& aFileName, const TSecurityContext& aSecurityContext, |
|
71 CComponentInfo& aComponentInfo, TRequestStatus& aStatus) = 0; |
|
72 |
|
73 /** |
|
74 A derived class must provide an implementation that returns details of a component |
|
75 to be installed by file handle. |
|
76 |
|
77 @param aFileHandle Component's file name |
|
78 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
79 @param aComponentInfo On return, contains component's details |
|
80 @param aStatus Asynchronous completion status |
|
81 */ |
|
82 virtual void GetComponentInfo(RFile& aFileHandle, const TSecurityContext& aSecurityContext, |
|
83 CComponentInfo& aComponentInfo, TRequestStatus& aStatus) = 0; |
|
84 |
|
85 /** |
|
86 A derived class must provide an implementation that installs a component by file name. |
|
87 |
|
88 @param aFileName Component's file name |
|
89 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
90 @param aArguments The array of opaque params for the plug-in. An empty |
|
91 array may be passed. The following param is defined for the "SCOMO Install |
|
92 Inactive" operation: |
|
93 Name: InstallInactive, Type: Int, Value: ETrue |
|
94 If a plug-in receives this param, it must install a component normally but the SCOMO |
|
95 State should remain EDeactivated. |
|
96 @param aResults The array of opaque params returned from the plug-in. |
|
97 The following return param is defined for the id of an installed component: |
|
98 Name: ComponentId, Type: Int |
|
99 Each plug-in must add this param to aResults after a successful installation. |
|
100 For packages containing embedded components, the returned param contains |
|
101 the id of the last/most embedded component. |
|
102 @param aStatus Asynchronous completion status |
|
103 */ |
|
104 virtual void Install(const TDesC& aFileName, const TSecurityContext& aSecurityContext, |
|
105 const COpaqueNamedParams& aArguments, COpaqueNamedParams& aResults, |
|
106 TRequestStatus& aStatus) = 0; |
|
107 |
|
108 /** |
|
109 A derived class must provide an implementation that installs a component by file handle. |
|
110 |
|
111 @param aFileHandle Component's file handle |
|
112 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
113 @param aArguments The array of opaque params for the plug-in. An empty |
|
114 array may be passed. The following param is defined for the "SCOMO Install |
|
115 Inactive" operation: |
|
116 Name: InstallInactive, Type: Int, Value: ETrue |
|
117 If a plug-in receives this param, it must install a component normally but the SCOMO |
|
118 State should remain EDeactivated. |
|
119 @param aResults The array of opaque params returned from the plug-in. |
|
120 The following return param is defined for the id of an installed component: |
|
121 Name: ComponentId, Type: Int |
|
122 Each plug-in must add this param to aResults after a successful installation. |
|
123 For packages containing embedded components, the returned param contains |
|
124 the id of the last/most embedded component. |
|
125 @param aStatus Asynchronous completion status |
|
126 */ |
|
127 virtual void Install(RFile& aFileHandle, const TSecurityContext& aSecurityContext, |
|
128 const COpaqueNamedParams& aArguments, COpaqueNamedParams& aResults, |
|
129 TRequestStatus& aStatus) = 0; |
|
130 |
|
131 /** |
|
132 A derived class must provide an implementation that uninstalls a component. |
|
133 |
|
134 @param aComponentId The id of a component to be uninstalled |
|
135 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
136 @param aArguments The array of opaque params for the plug-in. An empty |
|
137 array may be passed. |
|
138 @param aResults The array of opaque results returned from the plug-in. |
|
139 @param aStatus The request status. KErrNone, if successful, otherwise |
|
140 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
141 */ |
|
142 virtual void Uninstall(TComponentId aComponentId, const TSecurityContext& aSecurityContext, |
|
143 const COpaqueNamedParams& aArguments, COpaqueNamedParams& aResults, |
|
144 TRequestStatus& aStatus) = 0; |
|
145 |
|
146 /** |
|
147 A derived class must provide an implementation that activates a component. |
|
148 |
|
149 @param aComponentId The id of a component to be activated |
|
150 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
151 @param aStatus The request status. KErrNone, if successful, otherwise |
|
152 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
153 */ |
|
154 virtual void Activate(TComponentId aComponentId, const TSecurityContext& aSecurityContext, |
|
155 TRequestStatus& aStatus) = 0; |
|
156 |
|
157 /** |
|
158 A derived class must provide an implementation that deactivates a component. |
|
159 |
|
160 @param aComponentId The id of a component to be deactivated |
|
161 @param aSecurityContext this param allows the plug-in to verify client's identity |
|
162 @param aStatus The request status. KErrNone, if successful, otherwise |
|
163 one of the other system-wide or SIF error codes defined in usiferror.h. |
|
164 */ |
|
165 virtual void Deactivate(TComponentId aComponentId, const TSecurityContext& aSecurityContext, |
|
166 TRequestStatus& aStatus) = 0; |
|
167 |
|
168 /** |
|
169 A derived class must provide an implementation that cancels an ongoing asynchronous request. |
|
170 |
|
171 This is a synchronous call. When it returns the original asynchronous call is completed. |
|
172 */ |
|
173 virtual void CancelOperation() = 0; |
|
174 |
|
175 virtual ~CSifPlugin() {} |
|
176 }; |
|
177 } // namespace Usif |
|
178 |
|
179 #endif // SIFPLUGIN_H |