1 /* |
|
2 * Copyright (c) 2005-2006 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: writeablejavaregistry definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WRITEABLEJAVAREGISTRY_H |
|
20 #define WRITEABLEJAVAREGISTRY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "javaregistryentrytype.h" |
|
25 |
|
26 namespace Java |
|
27 { |
|
28 namespace Manager |
|
29 { |
|
30 namespace Registry |
|
31 { |
|
32 |
|
33 // FORWARD DECLARATION |
|
34 class CWriteableJavaRegistryEntry; |
|
35 class CJavaProperty; |
|
36 class CJavaPropertyArray; |
|
37 class RJavaRegSession; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * This class provides the Internal API for JavaRegistry. |
|
42 * It allows for trusted clients to retrieve and set properties of |
|
43 * Java install packages, applications, services etc. |
|
44 * |
|
45 * @lib javaregistryclient.lib |
|
46 * @since S60 v3.2 |
|
47 */ |
|
48 class CWriteableJavaRegistry : |
|
49 public CBase |
|
50 { |
|
51 public: |
|
52 |
|
53 // constructors |
|
54 /** |
|
55 * CWriteableJavaRegistry::NewL method creates a |
|
56 * CWriteableJavaRegistry object. |
|
57 * The function may leave with one of the system-wide error codes. |
|
58 * |
|
59 * @since S60 v3.2 |
|
60 * @param aUseIntegrity ETrue if Integrity Server must be used during |
|
61 * the lifetime of this object, EFalse if it's |
|
62 * not required. |
|
63 * @return A pointer to a CWriteableJavaRegistry object. Caller takes |
|
64 * over the ownership of the object being transferred. |
|
65 */ |
|
66 IMPORT_C static CWriteableJavaRegistry* NewL(TBool aUseIntegrity); |
|
67 |
|
68 /** |
|
69 * CWriteableJavaRegistry::NewLC method creates a |
|
70 * CWriteableJavaRegistry object. |
|
71 * The function may leave with one of the system-wide error codes. |
|
72 * |
|
73 * @since S60 v3.2 |
|
74 * @param aUseIntegrity ETrue if Integrity Server must be used during |
|
75 * the lifetime of this object, EFalse if it's |
|
76 * not required. |
|
77 * @return A pointer to a CWriteableJavaRegistry object. Caller takes |
|
78 * over the ownership of the object being transferred. |
|
79 */ |
|
80 IMPORT_C static CWriteableJavaRegistry* NewLC(TBool aUseIntegrity); |
|
81 |
|
82 /** |
|
83 * CWriteableJavaRegistry::NewL method creates a |
|
84 * CWriteableJavaRegistry object. |
|
85 * The function may leave with one of the system-wide error codes. |
|
86 * |
|
87 * @since S60 v3.2 |
|
88 * @param aIntegritySessionId A transaction Id, identifying an |
|
89 * integrity session, the registry |
|
90 * has to connect to. |
|
91 * @return A pointer to a CWriteableJavaRegistry object. Caller takes |
|
92 * over the ownership of the object being transferred. |
|
93 */ |
|
94 IMPORT_C static CWriteableJavaRegistry* |
|
95 NewL(TInt64 aIntegritySessionId); |
|
96 |
|
97 /** |
|
98 * CWriteableJavaRegistry::NewLC method creates a |
|
99 * CWriteableJavaRegistry object. |
|
100 * The function may leave with one of the system-wide error codes. |
|
101 * |
|
102 * @since S60 v3.2 |
|
103 * @param aIntegritySessionId A transaction Id, identifying an |
|
104 * integrity session, the registry |
|
105 * has to connect to. |
|
106 * @return A pointer to a CWriteableJavaRegistry object. Caller takes |
|
107 * over the ownership of the object being transferred. |
|
108 */ |
|
109 IMPORT_C static CWriteableJavaRegistry* |
|
110 NewLC(TInt64 aIntegritySessionId); |
|
111 |
|
112 // destructor |
|
113 /** |
|
114 * CWriteableJavaRegistry::~CWriteableJavaRegistry destructor |
|
115 * |
|
116 * @since S60 v3.2 |
|
117 */ |
|
118 IMPORT_C ~CWriteableJavaRegistry(); |
|
119 |
|
120 // general methods |
|
121 /** |
|
122 * CWriteableJavaRegistry::GenerateUidL method allocates some uids for |
|
123 * registry entries, specified the count in aNumber param, and returns |
|
124 * the uids in the aUids param. |
|
125 * The function may leave with one of the system-wide error codes. |
|
126 * |
|
127 * @since S60 v3.2 |
|
128 * @param aUids [out] Return the generated Uids. |
|
129 * @param aNumber The number of the Uids to be created. |
|
130 */ |
|
131 IMPORT_C void GenerateUidsL(RArray<TUid>& aUids, TInt aNumber) const; |
|
132 |
|
133 |
|
134 /** |
|
135 * CWriteableJavaRegistry::RegistryEntryExistsL method returns whether |
|
136 * registry entry with the specified Uid exists. |
|
137 * The function may leave with one of the system-wide error codes. |
|
138 * |
|
139 * @since S60 v3.2 |
|
140 * @param aUid The Uid to be checked. |
|
141 * @return ETrue if the registry entry exists, EFalse otherwise. |
|
142 */ |
|
143 IMPORT_C TBool RegistryEntryExistsL(const TUid& aUid) const; |
|
144 |
|
145 |
|
146 /** |
|
147 * CWriteableJavaRegistry::GetRegistryEntryUidsL method returns |
|
148 * an array of Uids of the registry entries, that are installed to |
|
149 * the phone, or to the mmc drive currently plugged in. |
|
150 * The function may leave with one of the system-wide error codes. |
|
151 * |
|
152 * @since S60 v3.2 |
|
153 * @param aUids [out] Uids of the registry entries. |
|
154 */ |
|
155 IMPORT_C void GetRegistryEntryUidsL(RArray<TUid>& aUids) const; |
|
156 |
|
157 |
|
158 /** |
|
159 * CWriteableJavaRegistry::GetRegistryEntryUidsL method returns |
|
160 * an array of Uids of the registry entries, that are installed to |
|
161 * the phone, or to the mmc drive currently plugged in. |
|
162 * Entries are searched by the specified type. |
|
163 * The function may leave with one of the system-wide error codes. |
|
164 * |
|
165 * @since S60 v3.2 |
|
166 * @param aType Type of registry entries whose Uids are to be returned. |
|
167 * @param aUids [out] Uids of the matching registry entries. |
|
168 * @param aAllEntries means, that method give all entries including |
|
169 * entries, which regards with midlets stored in not presented |
|
170 * media. EFalse means entries with regarding not presented |
|
171 * media will not return. |
|
172 */ |
|
173 IMPORT_C void GetRegistryEntryUidsL(TJavaRegistryEntryType aType, |
|
174 RArray<TUid>& aUids, |
|
175 TBool aAllEntries = EFalse) const; |
|
176 |
|
177 |
|
178 /** |
|
179 * CWriteableJavaRegistry::GetRegistryEntryUidsL method returns |
|
180 * an array of Uids of the registry entries, that are installed to |
|
181 * the phone, or to the mmc drive currently plugged in. |
|
182 * Entries are searched to match the specified properties. |
|
183 * The function may leave with one of the system-wide error codes. |
|
184 * |
|
185 * @since S60 v3.2 |
|
186 * @param aProperties The properties, to the returned entries have to |
|
187 * match. |
|
188 * @param aUids [out] Uids of the matching registry entries, . |
|
189 * @param aAllEntries means, that method give all entries including |
|
190 * entries, which regards with midlets stored in not presented |
|
191 * media. EFalse means entries with regarding not presented |
|
192 * media will not return. |
|
193 */ |
|
194 IMPORT_C void GetRegistryEntryUidsL( |
|
195 const RPointerArray<CJavaProperty>& aProperties, |
|
196 RArray<TUid>& aUids, |
|
197 TBool aAllEntries = EFalse) const; |
|
198 |
|
199 |
|
200 /** |
|
201 * CWriteableJavaRegistry::RegistryEntryL method returns the |
|
202 * corresponding registry entry for a given Uid. |
|
203 * The returned entry can be casted to the appropriate subclass |
|
204 * according to the type property. If type is in the package range |
|
205 * ( EGeneralPackage <= entryType < EGeneralApplication ), it can |
|
206 * be casted to CWriteableJavaRegistryPackageEntry, and if type is |
|
207 * in the application range ( EGeneralApplication <= entryType ), |
|
208 * it can be casted to CWriteableJavaRegistryApplicationEntry. |
|
209 * The function may leave with one of the system-wide error codes. |
|
210 * |
|
211 * @since S60 v3.2 |
|
212 * @param aUid The Uid of the entry to be retrieved. |
|
213 * @return The returned registry entry or null if registry entry not |
|
214 * found. Caller takes over the ownership of the object being |
|
215 * transferred. |
|
216 */ |
|
217 IMPORT_C CWriteableJavaRegistryEntry* RegistryEntryL( |
|
218 const TUid& aUid, |
|
219 TBool aAllEntries = EFalse) const; |
|
220 |
|
221 |
|
222 /** |
|
223 * CWriteableJavaRegistry::SetRegistryEntryL method creates, or updates |
|
224 * the given registry entry in the registry. |
|
225 * The function may leave with one of the system-wide error codes. |
|
226 * |
|
227 * @since S60 v3.2 |
|
228 * @param aEntry The registry entry to be stored in the registry. |
|
229 */ |
|
230 IMPORT_C void SetRegistryEntryL(CWriteableJavaRegistryEntry& aEntry) const; |
|
231 |
|
232 |
|
233 /** |
|
234 * CWriteableJavaRegistry::RemoveRegistryEntryL method removes the |
|
235 * specified registry entry, and its embedded entries if requested. |
|
236 * The function may leave with one of the system-wide error codes. |
|
237 * |
|
238 * @since S60 v3.2 |
|
239 * @param aUid The Uid of the entry to be removed. |
|
240 * @param aEmbeddedEntries If aUid identifies a packageentry, this |
|
241 * parameter indicates to remove its |
|
242 * embedded entries as well. |
|
243 * @param aAllEntries means, that method give all entries including |
|
244 * entries, which regards with midlets stored in not presented |
|
245 * media. EFalse means entries with regarding not presented |
|
246 * media will not return. |
|
247 */ |
|
248 IMPORT_C void RemoveRegistryEntryL( |
|
249 const TUid& aUid, |
|
250 TBool aEmbeddedEntries = EFalse, |
|
251 TBool aAllEntries = EFalse) const; |
|
252 |
|
253 protected: |
|
254 |
|
255 // constructor |
|
256 /** |
|
257 * CWriteableJavaRegistry::CWriteableJavaRegistry constructor |
|
258 * |
|
259 * @since S60 v3.2 |
|
260 */ |
|
261 IMPORT_C CWriteableJavaRegistry(); |
|
262 |
|
263 // 2nd phase constructors |
|
264 /** |
|
265 * CWriteableJavaRegistry::ConstructL method |
|
266 * The function may leave with one of the system-wide error codes. |
|
267 * |
|
268 * @since S60 v3.2 |
|
269 * @param aUseIntegrity ETrue if Integrity Server must be used during |
|
270 * the lifetime of this object, EFalse if it's |
|
271 * not required. |
|
272 * @param aLegacy Indicates, that the registry is used in legacy |
|
273 * mode. |
|
274 */ |
|
275 IMPORT_C void ConstructL(TBool aUseIntegrity, TBool aLegacy = EFalse); |
|
276 |
|
277 |
|
278 /** |
|
279 * CWriteableJavaRegistry::ConstructL method |
|
280 * The function may leave with one of the system-wide error codes. |
|
281 * |
|
282 * @since S60 v3.2 |
|
283 * @param aIntegritySessionId A transaction Id, identifying an |
|
284 * integrity session, the registry |
|
285 * has to connect to. |
|
286 */ |
|
287 IMPORT_C void ConstructL(TInt64 aIntegritySessionId); |
|
288 |
|
289 // general methods |
|
290 /** |
|
291 * CWriteableJavaRegistry::DecideEntryTypeAndCreateL method decides |
|
292 * wich subclass of CWriteableJavaRegistryEntry represent the given |
|
293 * array of properties, and creates it. |
|
294 * The function may leave with one of the system-wide error codes. |
|
295 * |
|
296 * @since S60 v3.2 |
|
297 * @param aUid The Uid of the entry to be created with. |
|
298 * @param aPropArray The method chooses wich subclass to create |
|
299 * according to these properties. |
|
300 * @return A pointer to a subclass of CWriteableJavaRegistryEntry, |
|
301 * or NULL if can't decide type. Caller takes over the |
|
302 * ownership of the object being transferred. |
|
303 */ |
|
304 IMPORT_C virtual CWriteableJavaRegistryEntry* DecideEntryTypeAndCreateL |
|
305 (const TUid& aUid, |
|
306 CJavaPropertyArray* aPropArray) const; |
|
307 |
|
308 protected: // Data |
|
309 |
|
310 /** |
|
311 * CWriteableJavaRegistry::iJavaRegSession member, the client class |
|
312 * to the javaregistry server. |
|
313 * |
|
314 * @since S60 v3.2 |
|
315 */ |
|
316 Java::Manager::Registry::RJavaRegSession* iJavaRegSession; |
|
317 |
|
318 }; |
|
319 |
|
320 }// namespace Registry |
|
321 }// namespace Manager |
|
322 }// namespace Java |
|
323 |
|
324 #endif // WRITEABLEJAVAREGISTRY_H |
|
325 |
|
326 // End of File |
|