|
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: writeablejavaregistryentry definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WRITEABLEJAVAREGISTRYENTRY_H |
|
20 #define WRITEABLEJAVAREGISTRYENTRY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <f32file.h> |
|
25 #include "javaregistryentrytype.h" |
|
26 #include "javaattributes.h" |
|
27 |
|
28 using namespace Java; |
|
29 |
|
30 namespace Java |
|
31 { |
|
32 namespace Manager |
|
33 { |
|
34 namespace Registry |
|
35 { |
|
36 // FORWARD DECLARATION |
|
37 class CJavaProperty; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * This class provides the Internal API for entries in JavaRegistry. |
|
42 * It supports common attributes only. |
|
43 * |
|
44 * @lib javaregistryclient.lib |
|
45 * @since S60 v3.2 |
|
46 */ |
|
47 class CWriteableJavaRegistryEntry : |
|
48 public CBase |
|
49 { |
|
50 public: |
|
51 |
|
52 // destructor |
|
53 /** |
|
54 * CWriteableJavaRegistryEntry::~CWriteableJavaRegistryEntry destructor |
|
55 * |
|
56 * @since S60 v3.2 |
|
57 */ |
|
58 IMPORT_C virtual ~CWriteableJavaRegistryEntry(); |
|
59 |
|
60 // general methods |
|
61 /** |
|
62 * CWriteableJavaRegistryEntry::Properties method returns all the |
|
63 * properties the entry has. |
|
64 * |
|
65 * @since S60 v3.2 |
|
66 * @return The properties stored in RPointerArray<CJavaProperty>. |
|
67 * The ownership of objects is NOT subject to change. |
|
68 */ |
|
69 const RPointerArray<CJavaProperty>& Properties() const; |
|
70 |
|
71 |
|
72 /** |
|
73 * CWriteableJavaRegistryEntry::Uid method gets the Uid of |
|
74 * this registry entry. |
|
75 * |
|
76 * @since S60 v3.2 |
|
77 * @return A TUid object. |
|
78 */ |
|
79 IMPORT_C TUid Uid() const; |
|
80 |
|
81 |
|
82 /** |
|
83 * Gets the name of the entity (midlet, suite, etc.) this entry |
|
84 * represents. |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 * @return Name of the entity this entry represents. |
|
88 * Default value if not set: KNullDesC. |
|
89 */ |
|
90 IMPORT_C const TDesC& Name() const; |
|
91 |
|
92 |
|
93 /** |
|
94 * CWriteableJavaRegistryEntry::Type method gets the type of this |
|
95 * registry entry. Enumeration TJavaRegistryEntryType defines |
|
96 * the currently possible options. Mandatory property. |
|
97 * |
|
98 * @since S60 v3.2 |
|
99 * @return Type of this registry entry. |
|
100 */ |
|
101 IMPORT_C TJavaRegistryEntryType Type() const; |
|
102 |
|
103 |
|
104 /** |
|
105 * CWriteableJavaRegistryEntry::Drive method gets the letter |
|
106 * of drive where the install package has been installed. |
|
107 * |
|
108 * @since S60 v3.2 |
|
109 * @return Letter of drive where the install package has been |
|
110 * installed. |
|
111 * Default value if not set: EDriveC. |
|
112 */ |
|
113 IMPORT_C TDriveNumber Drive() const; |
|
114 |
|
115 |
|
116 /** |
|
117 * CWriteableJavaRegistryEntry::NumberOfCertificateChains method |
|
118 * returns the number of certificate chains of this Java application. |
|
119 * |
|
120 * @since S60 v3.2 |
|
121 * @return Number of certificate chains. |
|
122 */ |
|
123 IMPORT_C TInt NumberOfCertificateChains() const; |
|
124 |
|
125 |
|
126 /** |
|
127 * CWriteableJavaRegistryEntry::CertificateChain method returns the |
|
128 * n-th certificate chain of this Java application. |
|
129 * |
|
130 * @since S60 v3.2 |
|
131 * @param aIndex Index of the certificate chain to be retrieved. |
|
132 * @return N-th certificate chain |
|
133 * Default value if not set: KNullDesC. |
|
134 */ |
|
135 IMPORT_C const TDesC8& CertificateChain(TInt aIndex) const; |
|
136 |
|
137 |
|
138 /** |
|
139 * Returns the content id of the entity this entry represents. |
|
140 * The content id can be used to check if a DRM protected entity |
|
141 * has enough right to be launched or not. |
|
142 * The method can also be used to check if the entity is DRM |
|
143 * protected or not. |
|
144 * |
|
145 * @since S60 v3.2 |
|
146 * @return Content id of the entity this entry represent or |
|
147 * KNullDesC if the entity is not DRM protected. |
|
148 */ |
|
149 IMPORT_C const TDesC& DrmContentId() const; |
|
150 |
|
151 |
|
152 /** |
|
153 * CWriteableJavaRegistryEntry::SetNameL method sets the name of |
|
154 * this registry entry. |
|
155 * The function may leave with one of the system-wide error codes. |
|
156 * |
|
157 * @since S60 v3.2 |
|
158 * @param aName The name to be setted. |
|
159 */ |
|
160 IMPORT_C void SetNameL(const TDesC& aName); |
|
161 |
|
162 /** |
|
163 * CWriteableJavaRegistryEntry::SetTypeL method sets the type of this |
|
164 * registry entry. Enumeration TJavaRegistryEntryType defines |
|
165 * the currently possible options. |
|
166 * The function may leave with one of the system-wide error codes. |
|
167 * |
|
168 * |
|
169 * @since S60 v3.2 |
|
170 * @param aType The type to be setted. |
|
171 */ |
|
172 IMPORT_C void SetTypeL(TJavaRegistryEntryType aType); |
|
173 |
|
174 /** |
|
175 * CWriteableJavaRegistryEntry::SetDriveL method sets the letter |
|
176 * of drive where the install package has been installed. |
|
177 * The function may leave with one of the system-wide error codes. |
|
178 * |
|
179 * @since S60 v3.2 |
|
180 * @param aDrive Letter of drive where the install package has been |
|
181 * installed. |
|
182 */ |
|
183 IMPORT_C void SetDriveL(const TDriveNumber& aDrive); |
|
184 |
|
185 |
|
186 /** |
|
187 * CWriteableJavaRegistryEntry::AddCertificateChainL method adds |
|
188 * a certificate chain to this Java application. |
|
189 * The function may leave with one of the system-wide error codes. |
|
190 * |
|
191 * @since S60 v3.2 |
|
192 * @param aChain The new certificate chain. |
|
193 */ |
|
194 IMPORT_C void AddCertificateChainL(const TDesC8& aChain); |
|
195 |
|
196 |
|
197 /** |
|
198 * CWriteableJavaRegistryEntry::SetDrmContentIdL sets DRM content |
|
199 * id of this entry. If the entity represented by this entry is |
|
200 * not DRM protected this content id should not be set |
|
201 * |
|
202 * @since S60 v3.2 |
|
203 * @param aDrmContentId DRM content id to be set |
|
204 */ |
|
205 IMPORT_C void SetDrmContentIdL(const TDesC& aDrmContentId); |
|
206 |
|
207 |
|
208 /** |
|
209 * CWriteableJavaRegistryEntry::PropertyL method gets a property, |
|
210 * specified by the Id parameter. |
|
211 * |
|
212 * @since S60 v3.2 |
|
213 * @param aId The Id of the property to be returned. |
|
214 * @return The pointer of the property specified by the Id parameter, |
|
215 * or NULL if it is not set. |
|
216 * The ownership of the object being transferred is NOT |
|
217 * subject to change. |
|
218 */ |
|
219 IMPORT_C const CJavaProperty* Property(TInt32 aId) const; |
|
220 |
|
221 |
|
222 /** |
|
223 * CWriteableJavaRegistryEntry::SetPropertyL method sets a new, or |
|
224 * updtates a stored property if already exists. |
|
225 * The function may leave with one of the system-wide error codes. |
|
226 * |
|
227 * @since S60 v3.2 |
|
228 * @param aProperty Property to be setted. Pointer ownership taken. |
|
229 */ |
|
230 IMPORT_C virtual void SetPropertyL(CJavaProperty* aProperty); |
|
231 |
|
232 |
|
233 /** |
|
234 * CWriteableJavaRegistryEntry::SetPropertyL method sets a new, or |
|
235 * updtates a stored property if already exists. |
|
236 * The function may leave with one of the system-wide error codes. |
|
237 * |
|
238 * @since S60 v3.2 |
|
239 * @param aId The Id of the Property. |
|
240 * @param aValue Value for the Property. |
|
241 */ |
|
242 IMPORT_C void SetPropertyL(TInt32 aId, const TDesC& aValue); |
|
243 |
|
244 /** |
|
245 * CWriteableJavaRegistryEntry::Attribute method gets the |
|
246 * additional attribute. |
|
247 * |
|
248 * @since S60 v5.0 |
|
249 * @param aName The name the searched attribute. |
|
250 * @return MJavaAttribute poiter to instance, which contain attribute. |
|
251 * If attribute doesn't exist return NULL. |
|
252 */ |
|
253 IMPORT_C virtual const MJavaAttribute* AttributeL(const TDesC& aName) const; |
|
254 |
|
255 /** |
|
256 * CWriteableJavaRegistryEntry::Attributes method gets the |
|
257 * additional attributes array. |
|
258 * |
|
259 * @since S60 v5.0 |
|
260 * @return RPointerArray& with all additional attributes. |
|
261 */ |
|
262 IMPORT_C virtual const RPointerArray< MJavaAttribute >& AttributesL() const; |
|
263 |
|
264 /** |
|
265 * CWriteableJavaRegistryEntry::SerializeAttributes method gets the |
|
266 * streamed attributes and store stream to CJavaProperty as |
|
267 * special ESerializedAttribute |
|
268 * If don't exists any attribute method do nothing |
|
269 * |
|
270 * @since S60 v5.0 |
|
271 * |
|
272 */ |
|
273 IMPORT_C virtual void SerializeAttributesL(); |
|
274 |
|
275 |
|
276 |
|
277 protected: |
|
278 |
|
279 // constructors |
|
280 |
|
281 /** |
|
282 * CWriteableJavaRegistryEntry::CWriteableJavaRegistryEntry constructor |
|
283 * |
|
284 * @since S60 v3.2 |
|
285 * @param aUid The Uid of this entry. |
|
286 */ |
|
287 IMPORT_C CWriteableJavaRegistryEntry(const TUid& aUid); |
|
288 |
|
289 /** |
|
290 * 2nd phase constructor. Used by the subclasses. |
|
291 * The function may leave with one of the system-wide error codes. |
|
292 * |
|
293 * @since S60 v3.2 |
|
294 * @param aType The type to be setted. |
|
295 */ |
|
296 IMPORT_C void ConstructL(TJavaRegistryEntryType aType); |
|
297 |
|
298 // general methods |
|
299 |
|
300 /** |
|
301 * CWriteableJavaRegistryEntry::IntegerProperty method gets an |
|
302 * integer propertyvalue, specified by the Id parameter. |
|
303 * |
|
304 * @since S60 v3.2 |
|
305 * @param aId The Id of the property to be returned. |
|
306 * @param aDefault The value to be returned if aValue does'nt |
|
307 * contain valid data. |
|
308 * @return The integer value of the property. |
|
309 */ |
|
310 IMPORT_C TInt32 IntegerProperty(TInt32 aId, TInt32 aDefault) const; |
|
311 |
|
312 /** |
|
313 * CWriteableJavaRegistryEntry::BooleanProperty method gets a |
|
314 * boolean propertyvalue, specified by the Id parameter. |
|
315 * |
|
316 * @since S60 v3.2 |
|
317 * @param aId The Id of the property to be returned. |
|
318 * @param aDefault The value to be returned if aValue does'nt |
|
319 * contain valid data. |
|
320 * @return The boolean value of the property. |
|
321 */ |
|
322 IMPORT_C TBool BooleanProperty(TInt32 aId, TBool aDefault) const; |
|
323 |
|
324 |
|
325 /** |
|
326 * CWriteableJavaRegistryEntry::SetBooleanPropertyL method sets a new, |
|
327 * or updtates a stored boolean property if already exists. |
|
328 * Used by some specialized boolean property setter methods. |
|
329 * The function may leave with one of the system-wide error codes. |
|
330 * |
|
331 * @since S60 v3.2 |
|
332 * @param aId The Id of the Property. |
|
333 * @param aBoolValue Boolean value for the Property. |
|
334 */ |
|
335 IMPORT_C void SetBooleanPropertyL(TInt32 aId, TBool aBoolValue); |
|
336 |
|
337 /** |
|
338 * CWriteableJavaRegistryEntry::SetDescriptorPropertyL method sets |
|
339 * a new, or updtates a stored descriptor property if already exists. |
|
340 * Used by some specialized descriptor property setter methods. |
|
341 * The function may leave with one of the system-wide error codes. |
|
342 * |
|
343 * @since S60 v3.2 |
|
344 * @param aId The Id of the Property. |
|
345 * @param aDescValue Descriptor value for the Property. |
|
346 */ |
|
347 IMPORT_C void SetDescriptorPropertyL(TInt32 aId, |
|
348 const TDesC& aDescValue); |
|
349 |
|
350 /** |
|
351 * CWriteableJavaRegistryEntry::SetIntegerPropertyL method sets a new, |
|
352 * or updtates a stored integer property if already exists. |
|
353 * Used by some specialized integer/Uid property setter methods. |
|
354 * The function may leave with one of the system-wide error codes. |
|
355 * |
|
356 * @since S60 v3.2 |
|
357 * @param aId The Id of the Property. |
|
358 * @param aIntValue Value for the Property. |
|
359 */ |
|
360 IMPORT_C void SetIntegerPropertyL(TInt32 aId, TInt32 aIntValue); |
|
361 |
|
362 /** |
|
363 * CWriteableJavaRegistryEntry::DeleteProperty method deletes |
|
364 * a property, specified by the index parameter. |
|
365 * |
|
366 * @since S60 v3.2 |
|
367 * @param aIndex The index of the property to be deleted. |
|
368 * @return |
|
369 */ |
|
370 IMPORT_C void DeleteProperty(TInt aIndex); |
|
371 |
|
372 /** |
|
373 * CWriteableJavaRegistryEntry::GetPropertyIndex method gets the |
|
374 * index of the property specified by the Id. |
|
375 * |
|
376 * @since S60 v3.2 |
|
377 * @param aId The id of the searched property. |
|
378 * @return The index of the searched property. If not found, -1 is |
|
379 * returned. |
|
380 */ |
|
381 IMPORT_C TInt GetPropertyIndex(TInt32 aId) const; |
|
382 |
|
383 |
|
384 |
|
385 protected: // Data |
|
386 |
|
387 |
|
388 /** |
|
389 * CWriteableJavaRegistryEntry::iProperties member stores all the |
|
390 * properties, whether processed here or in subclasses. |
|
391 */ |
|
392 RPointerArray<CJavaProperty> iProperties; |
|
393 |
|
394 /** |
|
395 * CWriteableJavaRegistryEntry::iCertificates member stores the |
|
396 * certificate chains. The certificate chains are also stored in the |
|
397 * iProperties, and are synchronised at every modification. |
|
398 */ |
|
399 RPointerArray<HBufC8> iCertificates; |
|
400 |
|
401 |
|
402 |
|
403 private: // Data |
|
404 /** |
|
405 * CWriteableJavaRegistryEntry::iUid member, representing the Uid |
|
406 * of this entry. |
|
407 */ |
|
408 TUid iUid; |
|
409 |
|
410 RPointerArray<MJavaAttribute> iAttributes; |
|
411 |
|
412 }; |
|
413 |
|
414 }// namespace Registry |
|
415 }// namespace Manager |
|
416 }// namespace Java |
|
417 |
|
418 |
|
419 #endif // WRITEABLEJAVAREGISTRYENTRY_H |
|
420 |
|
421 // End of File |