|
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: javaregclient definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef JAVAREGCLIENT_H |
|
20 #define JAVAREGCLIENT_H |
|
21 |
|
22 #include "javaregdef.h" |
|
23 #include "javaregburstates.h" |
|
24 |
|
25 namespace Java |
|
26 { |
|
27 namespace Manager |
|
28 { |
|
29 namespace Registry |
|
30 { |
|
31 // FORWARD DECLARATIONS |
|
32 class CJavaPropertyArray; |
|
33 |
|
34 /** |
|
35 * RJavaRegSession class makes it possible to access java registry server |
|
36 * services like adding, getting and removing entries. |
|
37 * The class implements the client side of java registry |
|
38 * client-server communication. |
|
39 * |
|
40 * @since S60 v3.2 |
|
41 */ |
|
42 class RJavaRegSession : public RSessionBase |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Constructor |
|
49 * |
|
50 * @since S60 v3.2 |
|
51 */ |
|
52 RJavaRegSession(); |
|
53 |
|
54 /** |
|
55 * Connects to registry server and sets integrity service's |
|
56 * transaction id. |
|
57 * |
|
58 * @since S60 v3.2 |
|
59 * @param aTransactionId transaction id of integrity service |
|
60 * @param aLegacy legacy flag, must be set to true if |
|
61 * legacy api wants to use server services |
|
62 * @return KErrNone if connection was successful or an error code |
|
63 */ |
|
64 TInt Connect(TInt64 aTransactionId, TBool aLegacy = EFalse); |
|
65 |
|
66 /** |
|
67 * Connects to registry server and sets if integrity service |
|
68 * is required or not to be created in registry. |
|
69 * |
|
70 * @since S60 v3.2 |
|
71 * @param aUseIntegrity true if registry should create an |
|
72 * interior integrity session |
|
73 * @param aLegacy if true legacy api uses server services |
|
74 * @return KErrNone if connection was successful or an error code |
|
75 */ |
|
76 TInt Connect(TBool aUseIntegrity, TBool aLegacy = EFalse); |
|
77 |
|
78 /** |
|
79 * Checks if an entry with specified uid exist or not |
|
80 * in the registry. |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 * @param aUid uid of the entry to be checked if exists |
|
84 * @return true if the entry exists and false if not |
|
85 */ |
|
86 TBool EntryExistsL(TUid aUid) const; |
|
87 |
|
88 /** |
|
89 * Gets uids of entries stored in registry. |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 * @param[out] aUids reference to an array where stored uids |
|
93 * are returned |
|
94 */ |
|
95 void GetEntryUidsL(RArray<TUid>& aUids) const; |
|
96 |
|
97 /** |
|
98 * Gets uids of entries stored in registry and belonging to |
|
99 * the given drive. |
|
100 * |
|
101 * @since S60 v3.2 |
|
102 * @param[out] aUids reference to an array where stored uids |
|
103 * are returned |
|
104 * @param aDrive drive whose entry uids must be returned |
|
105 */ |
|
106 void GetEntryUidsL(RArray<TUid>& aUids, TInt aDrive) const; |
|
107 |
|
108 /** |
|
109 * Gets the entry belonging to the given uid. |
|
110 * The entry is represented as a set of properties. |
|
111 * If no entry found for the given uid aProperties is null else |
|
112 * it is allocated a new CJavaPropertyArray object containing the read |
|
113 * entry. |
|
114 * |
|
115 * @since S60 v3.2 |
|
116 * @param aUid the uid of entry we are interested in |
|
117 * @param[out] aProperties entry is read in this parameter |
|
118 * @param aAllEntries decision if we want to read entry from not |
|
119 * presented MMC |
|
120 */ |
|
121 void GetEntryL(TUid aUid, |
|
122 CJavaPropertyArray*& aProperties, |
|
123 TBool aAllEntries = EFalse) const; |
|
124 |
|
125 /** |
|
126 * Adds a new entry or updates an existent one with the given uid. |
|
127 * The entry is represented as a set of properties. |
|
128 * |
|
129 * @since S60 v3.2 |
|
130 * @param aUid the uid of the entry to be added or updated |
|
131 * @param aProperties the entry to be added or updated |
|
132 * @param aDrive the drive to which the set entry belongs |
|
133 */ |
|
134 void SetEntryL(TUid aUid, |
|
135 const CJavaPropertyArray& aProperties, |
|
136 TInt aDrive) const; |
|
137 |
|
138 /** |
|
139 * Returns a set of uids whose entries contains the properties (and |
|
140 * has the same values) given in the aProperties parameter. |
|
141 * |
|
142 * @since S60 v3.2 |
|
143 * @param aProperties the set of properties which must exists |
|
144 * (and must have the same values) in the looked entries |
|
145 * @param[out] aUids uids of the found entries are returned |
|
146 * in this parameter |
|
147 * @param aAllEntries means, that method give all entries including |
|
148 * entries, which regards with midlets stored in not presented |
|
149 * media. EFalse means entries with regarding not presented |
|
150 * media will not return. |
|
151 */ |
|
152 void FindEntriesL(const CJavaPropertyArray& aProperties, |
|
153 RArray<TUid>& aUids, TBool aAllEntries = EFalse) const; |
|
154 |
|
155 /** |
|
156 * Removes the entry belonging to the given uid. |
|
157 * |
|
158 * @since S60 v3.2 |
|
159 * @param aUid uid of entry which must be deleted |
|
160 * @param aAllEntries means, that method give all entries including |
|
161 * entries, which regards with midlets stored in not presented |
|
162 * media. EFalse means entries with regarding not presented |
|
163 * media will not return. |
|
164 */ |
|
165 void RemoveEntryL(TUid aUid, TBool aAllEntries = EFalse) const; |
|
166 |
|
167 /** |
|
168 * Allocates a range of new uids. |
|
169 * |
|
170 * @since S60 v3.2 |
|
171 * @param[out] aUids array reference where the allocated uids |
|
172 * will be returned |
|
173 * @param aUidCount number of uids to be allocated |
|
174 */ |
|
175 void AllocateUidsL(RArray<TUid>& aUids, |
|
176 TInt aUidCount = 1) const; |
|
177 |
|
178 /** |
|
179 * Sets the backup state of registry. |
|
180 * If the registry is in backing up or restoring state |
|
181 * the client requests will not be executed. |
|
182 * |
|
183 * @since S60 v3.2 |
|
184 * @param aBackupState the requested backup state |
|
185 */ |
|
186 void SetBackupStateL(TBackupState aBackupState) const; |
|
187 |
|
188 private: |
|
189 |
|
190 /** |
|
191 * Initializes server with integrity service transaction id |
|
192 * and the legacy api flag. |
|
193 * |
|
194 * @since S60 v3.2 |
|
195 * @param aTransactionId integrity service transaction id |
|
196 * @param aLegacy legacy flag, must be set to true if |
|
197 * legacy api wants to use server services |
|
198 * @return KErrNone if no error or the appropriate error code |
|
199 */ |
|
200 TInt InitializeServer(TInt64 aTransactionId, TBool aLegacy) const; |
|
201 |
|
202 /** |
|
203 * Initializes server with use integrity session flag, |
|
204 * and the legacy api flag. |
|
205 * |
|
206 * @since S60 v3.2 |
|
207 * @param aUseIntegrity true if registry should create an interior |
|
208 * integrity session |
|
209 * @param aLegacy legacy flag, must be set to true if |
|
210 * legacy api wants to use server services |
|
211 * @return KErrNone if no error or the appropriate error code |
|
212 */ |
|
213 TInt InitializeServer(TBool aUseIntegrity, TBool aLegacy) const; |
|
214 |
|
215 /** |
|
216 * Sends to server a message containing the function id and the |
|
217 * arguments given in TIpcArgs argument. |
|
218 * The first and second arguments of TIpcArgs are reserved. |
|
219 * |
|
220 * @since S60 v3.2 |
|
221 * @param aFunction funtion id |
|
222 * @param[out] aBuffer the received buffer is returned |
|
223 * in this parameter |
|
224 * @param aArgs arguments to be sent for server, first and second |
|
225 * argument must be left empty |
|
226 */ |
|
227 void GetBuffer8FromServerL(TInt aFunction, |
|
228 HBufC8*& aBuffer, |
|
229 TIpcArgs& aArgs) const; |
|
230 |
|
231 /** |
|
232 * Sends to server a message containing the function id and the |
|
233 * arguments given in TIpcArgs argument. |
|
234 * The first and second arguments of TIpcArgs are reserved. |
|
235 * |
|
236 * @since S60 v3.2 |
|
237 * @param aFunction funtion id |
|
238 * @param[out] aBuffer the received buffer is returned |
|
239 * in this parameter |
|
240 * @param aArgs arguments to be sent for server, first and second |
|
241 * argument must be left empty |
|
242 */ |
|
243 void GetBuffer16FromServerL(TInt aFunction, |
|
244 HBufC16*& aBuffer, |
|
245 TIpcArgs& aArgs) const; |
|
246 |
|
247 /** |
|
248 * Sends to server a message containing the function id and the |
|
249 * arguments given in TIpcArgs argument. |
|
250 * The first and second arguments of TIpcArgs are reserved. |
|
251 * |
|
252 * @since S60 v3.2 |
|
253 * @param aFunction funtion id |
|
254 * @param[out] aBuffer the received buffer is returned |
|
255 * in this parameter |
|
256 * @param aArgs arguments to be sent for server, first and second |
|
257 * argument must be left empty |
|
258 * @param a8BitDesc if true a 8 bit descriptor must be allocated |
|
259 * in other case a 16 bit descriptor must be allocated |
|
260 */ |
|
261 void GetBufferFromServerL(TInt aFunction, |
|
262 TAny** aBuffer, |
|
263 TIpcArgs& aArgs, |
|
264 TBool a8BitDesc) const; |
|
265 /** |
|
266 * Connects to server. |
|
267 * |
|
268 * @since S60 v3.2 |
|
269 * @return KErrNone if connection was successful or an error code |
|
270 */ |
|
271 TInt Connect(); |
|
272 |
|
273 private: |
|
274 |
|
275 }; |
|
276 |
|
277 }//namespace Registry |
|
278 }//namespace Manager |
|
279 }//namespace Java |
|
280 |
|
281 #endif // JAVAREGCLIENT_H |