|
1 /* |
|
2 * Copyright (c) 2005-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 "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: writeablejavaregistrypackageentry definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WRITEABLEJAVAREGISTRYPACKAGEENTRY_H |
|
20 #define WRITEABLEJAVAREGISTRYPACKAGEENTRY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "writeablejavaregistryentry.h" |
|
24 #include "javastorage.h" |
|
25 |
|
26 using namespace Java; |
|
27 |
|
28 // FORWARD DECLARATION |
|
29 class TAppVersion; |
|
30 |
|
31 namespace Java |
|
32 { |
|
33 namespace Manager |
|
34 { |
|
35 namespace Registry |
|
36 { |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * This subclass of CWriteableJavaRegistryEntry supports attributes |
|
41 * for packages, that can contain embedded entries. |
|
42 * |
|
43 * @lib javaregistryclient.lib |
|
44 * @since S60 v3.2 |
|
45 */ |
|
46 class CWriteableJavaRegistryPackageEntry : |
|
47 public CWriteableJavaRegistryEntry |
|
48 { |
|
49 public: |
|
50 |
|
51 // constructors |
|
52 |
|
53 /** |
|
54 * CWriteableJavaRegistryPackageEntry constructor. |
|
55 * |
|
56 * @since S60 v3.2 |
|
57 * @param aEntry application package attributes. |
|
58 * @param aType application package type. |
|
59 */ |
|
60 CWriteableJavaRegistryPackageEntry( |
|
61 java::storage::JavaStorageApplicationEntry_t& aEntry, |
|
62 TJavaRegistryEntryType aType); |
|
63 |
|
64 // destructor |
|
65 |
|
66 /** |
|
67 * CWriteableJavaRegistryPackageEntry:: |
|
68 * ~CWriteableJavaRegistryPackageEntry |
|
69 * Destructor |
|
70 * |
|
71 * @since S60 v3.2 |
|
72 */ |
|
73 IMPORT_C ~CWriteableJavaRegistryPackageEntry(); |
|
74 |
|
75 // general methods |
|
76 /** |
|
77 * CWriteableJavaRegistryPackageEntry::VersionL method gets the |
|
78 * version of this install package suite. |
|
79 * |
|
80 * @since S60 v3.2 |
|
81 * @return A TAppVersion object that represents the version |
|
82 * of this install package suite. |
|
83 * Default value if not set: TAppVersion(0, 0, 0). |
|
84 */ |
|
85 IMPORT_C TAppVersion Version() const; |
|
86 |
|
87 |
|
88 /** |
|
89 * CWriteableJavaRegistryPackageEntry::Vendor method gets the |
|
90 * vendor name of this install package suite. |
|
91 * |
|
92 * @since S60 v3.2 |
|
93 * @return Vendor name of the installation package. |
|
94 * Default value if not set: KNullDesC. |
|
95 */ |
|
96 IMPORT_C const TDesC& Vendor() const; |
|
97 |
|
98 |
|
99 /** |
|
100 * Tells if this package is uninstallable. |
|
101 * |
|
102 * @since S60 v3.2 |
|
103 * @return ETrue if the package is uninstallable, EFalse otherwise. |
|
104 * Default value if not set: ETrue. |
|
105 */ |
|
106 IMPORT_C TBool IsUninstallable() const; |
|
107 |
|
108 |
|
109 /** |
|
110 * CWriteableJavaRegistryPackageEntry::GetEmbeddedEntries method |
|
111 * returns an array of Uids associated with this install package. |
|
112 * E.g. if this entry represents a MIDlet suite this method returns |
|
113 * an array of MIDlet Uids. |
|
114 * |
|
115 * @since S60 v3.2 |
|
116 * @param aUids [out] Returns Uids of the embedded entries in this |
|
117 * install package. |
|
118 */ |
|
119 IMPORT_C void GetEmbeddedEntries(RArray<TUid>& aUids) const; |
|
120 |
|
121 |
|
122 /** |
|
123 * CWriteableJavaRegistryPackageEntry::NumberOfEmbeddedEntries method |
|
124 * Gets the number of embedded entries in this install package. |
|
125 * |
|
126 * @since S60 v3.2 |
|
127 * @return The number of embedded entries. |
|
128 */ |
|
129 IMPORT_C TInt NumberOfEmbeddedEntries() const; |
|
130 |
|
131 |
|
132 /** |
|
133 * CWriteableJavaRegistryPackageEntry::EmbeddedEntryByUidL method |
|
134 * Returns the corresponding embedded entry for the given Uid. |
|
135 * The returned entry can be casted to the appropriate subclass |
|
136 * according to the type property. If type is in the package range |
|
137 * (EGeneralPackage <= entryType < EGeneralApplication), it can |
|
138 * be casted to CWriteableJavaRegistryPackageEntry, and if type is |
|
139 * in the application range (EGeneralApplication <= entryType), |
|
140 * it can be casted to CWriteableJavaRegistryApplicationEntry. |
|
141 * The function may leave with one of the system-wide error codes. |
|
142 * |
|
143 * @since S60 v3.2 |
|
144 * @param aEntryUid The Uid of the embedded entry to be retrieved. |
|
145 * @return The returned embedded entry or null if entry is not found. |
|
146 * Caller takes over the ownership of the object being |
|
147 * transferred. |
|
148 */ |
|
149 IMPORT_C CWriteableJavaRegistryEntry* EmbeddedEntryByUidL( |
|
150 const TUid& aEntryUid) const; |
|
151 |
|
152 |
|
153 /** |
|
154 * CWriteableJavaRegistryPackageEntry::EmbeddedEntryByNumberL method |
|
155 * Returns the corresponding embedded entry for the given application |
|
156 * number. |
|
157 * The returned entry can be casted to the appropriate subclass |
|
158 * according to the type property. If type is in the package range |
|
159 * (EGeneralPackage <= entryType < EGeneralApplication), it can |
|
160 * be casted to CWriteableJavaRegistryPackageEntry, and if type is |
|
161 * in the application range (EGeneralApplication <= entryType), |
|
162 * it can be casted to CWriteableJavaRegistryApplicationEntry. |
|
163 * The function may leave with one of the system-wide error codes. |
|
164 * |
|
165 * @since S60 v3.2 |
|
166 * @param aEntryNum Number of the embedded entry to be retrieved |
|
167 * (NOTE: Starting from 0) |
|
168 * @return The returned embedded entry or null if entry is not found. |
|
169 * Caller takes over the ownership of the object being |
|
170 * transferred. |
|
171 */ |
|
172 IMPORT_C CWriteableJavaRegistryEntry* EmbeddedEntryByNumberL( |
|
173 TInt aEntryNum) const; |
|
174 |
|
175 |
|
176 /** |
|
177 * CWriteableJavaRegistryPackageEntry::Attribute method gets the |
|
178 * additional attribute. |
|
179 * |
|
180 * @since S60 v5.0 |
|
181 * @param aName The name the searched attribute. |
|
182 * @return MJavaAttribute poiter to instance, which contain attribute. |
|
183 * If attribute doesn't exist return NULL. |
|
184 */ |
|
185 IMPORT_C virtual const MJavaAttribute* AttributeL( |
|
186 const TDesC& aName) const; |
|
187 |
|
188 /** |
|
189 * CWriteableJavaRegistryPackageEntry::Attributes method gets the |
|
190 * additional attributes array. |
|
191 * |
|
192 * @since S60 v5.0 |
|
193 * @return RPointerArray& with all additional attributes. |
|
194 */ |
|
195 IMPORT_C virtual const RPointerArray<MJavaAttribute>& AttributesL() const; |
|
196 |
|
197 |
|
198 /** |
|
199 * CWriteableJavaRegistryPackageEntry::UsedUserDiskSpace gets the |
|
200 * amount of disk space taken by the installed application. |
|
201 * |
|
202 * @since S60 v5.1 |
|
203 * @return Returns the size of used disk space in bytes. |
|
204 */ |
|
205 IMPORT_C TInt64 UsedUserDiskSpace() const; |
|
206 |
|
207 /** |
|
208 * Tells if the application package is pre-installed. |
|
209 * |
|
210 * If a pre-installed application package is upgraded, |
|
211 * it remains marked as pre-installed. |
|
212 * |
|
213 * If a pre-installed application package is uninstalled |
|
214 * and later installed again, it is no more marked as |
|
215 * pre-installed. |
|
216 * |
|
217 * @since S60 v5.1 |
|
218 * @return ETrue if the application suite is pre-installed, |
|
219 * EFalse otherwise. |
|
220 */ |
|
221 IMPORT_C TBool IsPreinstalled() const; |
|
222 |
|
223 |
|
224 private: |
|
225 |
|
226 /** |
|
227 * Read all application entries belogning to this suite. |
|
228 * |
|
229 * @param aUid application suite uid. |
|
230 * @param[out] aApps application list to be populated. |
|
231 */ |
|
232 void SuiteEntries(const java::util::Uid& aUid, |
|
233 java::storage::JavaStorageApplicationList_t& aApps) const; |
|
234 |
|
235 private: // Data |
|
236 |
|
237 mutable HBufC16* iVendor; |
|
238 }; |
|
239 |
|
240 } // namespace Registry |
|
241 } // namespace Manager |
|
242 } // namespace Java |
|
243 |
|
244 #endif // WRITEABLEJAVAREGISTRYPACKAGEENTRY_H |
|
245 |
|
246 // End of File |