|
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : LbsFields.h |
|
16 * Part of : Mobile Location Framework/Location FW |
|
17 * Interface : Location Acquisition API |
|
18 * Position data Fields manager |
|
19 * Version : |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 #ifndef __LBSFIELDS_H__ |
|
26 #define __LBSFIELDS_H__ |
|
27 |
|
28 #include <e32std.h> |
|
29 #include <lbsfieldids.h> |
|
30 |
|
31 /* |
|
32 * This header file defines the helper classes used by HPositionGenericInfo |
|
33 * The client should not use this class to access any positioning related information. |
|
34 * Instead the cleitn should use the methods provided by HGenericPositionInfo. |
|
35 */ |
|
36 |
|
37 /** |
|
38 * Standard position field identifiers. It takes one of the enumerated values of _TPositionFieldId |
|
39 * @publishedAll |
|
40 * @released |
|
41 */ |
|
42 typedef TUint16 TPositionFieldId; |
|
43 |
|
44 /** |
|
45 * Array of standard position field identifiers |
|
46 * @publishedAll |
|
47 * @released |
|
48 */ |
|
49 typedef TPositionFieldId TPositionFieldIdList[]; |
|
50 class HPositionGenericInfo; |
|
51 |
|
52 |
|
53 /** |
|
54 * This is an internal class to provide the interface for the |
|
55 * HPositionGenericInfo::GetValue() and HPositionGenericInfo::SetValue() |
|
56 * methods. Methods in this class are not intended to be called directly. |
|
57 * Clients should use HPositionGenericInfo::GetValue() and |
|
58 * HPositionGenericInfo::SetValue() methods. |
|
59 * @internalTechnology |
|
60 * @released |
|
61 */ |
|
62 class PositionFieldManager |
|
63 { |
|
64 public: |
|
65 /** |
|
66 * Supported data types |
|
67 */ |
|
68 enum TFieldType |
|
69 { |
|
70 /// Undefined data type. This value should not be used. |
|
71 EUndefined, |
|
72 /// TInt8 datatype |
|
73 ETInt8, |
|
74 /// TInt16 datatype |
|
75 ETInt16, |
|
76 /// TInt32 datatype |
|
77 ETInt32, |
|
78 /// TInt64 datatype |
|
79 ETInt64, |
|
80 /// TUint8 datatype |
|
81 ETUint8, |
|
82 /// TUint16 datatype |
|
83 ETUint16, |
|
84 /// TUint32 datatype |
|
85 ETUint32, |
|
86 /// TReal32 datatype |
|
87 ETReal32, |
|
88 /// TReal64 datatype |
|
89 ETReal64, |
|
90 /// TTime datatype |
|
91 ETTime, |
|
92 /// Time specified in microseconds |
|
93 ETTimeIntervalMicroSeconds, |
|
94 /// 8-bit descriptor datatype |
|
95 ETDesC8, |
|
96 /// 16-bit descriptor datatype |
|
97 ETDesC16 |
|
98 }; |
|
99 |
|
100 friend class HPositionGenericInfo; |
|
101 private: |
|
102 /** |
|
103 * Set the value for a location field of data type TInt8 in the |
|
104 * HPositionGenericInfo. |
|
105 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
106 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
107 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
108 * be added. |
|
109 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
110 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
111 * object. |
|
112 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
113 * HPositionGenericInfo object. |
|
114 * @return KErrNone if the SetValue was successful. |
|
115 */ |
|
116 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
117 TInt8 aValue, |
|
118 HPositionGenericInfo& aInfo); |
|
119 |
|
120 /** |
|
121 * Get the value for a location field of data type TInt8 from the |
|
122 * HPositionGenericInfo. |
|
123 * @param aFieldId Id of the field for which the value should be read from |
|
124 * HPositionGenericInfo. |
|
125 * @param[out] aValue The object where the data from the |
|
126 * HPositionGenericInfo is returned. |
|
127 * @param[in] aInfo The HPositionGenericInfo object from where this field needs |
|
128 * to be read. |
|
129 * @return KErrNone is the operation was successful. |
|
130 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
131 */ |
|
132 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
133 TInt8& aValue, |
|
134 const HPositionGenericInfo& aInfo); |
|
135 |
|
136 /** |
|
137 * Set the value for a location field of data type TInt16 in the |
|
138 * HPositionGenericInfo. |
|
139 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
140 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
141 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
142 * be added. |
|
143 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
144 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
145 * object. |
|
146 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
147 * HPositionGenericInfo object. |
|
148 * @return KErrNone if the SetValue was successful. |
|
149 */ |
|
150 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
151 TInt16 aValue, |
|
152 HPositionGenericInfo& aInfo); |
|
153 |
|
154 /** |
|
155 * Get the value for a location field of data type TInt16 from the |
|
156 * HPositionGenericInfo. |
|
157 * @param aFieldId Id of the field for which the value should be read from |
|
158 * HPositionGenericInfo. |
|
159 * @param[in] aValue The object where the data from the |
|
160 * HPositionGenericInfo is returned. |
|
161 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
162 * to be read. |
|
163 * @return KErrNone is the operation was successful. |
|
164 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
165 */ |
|
166 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
167 TInt16& aValue, |
|
168 const HPositionGenericInfo& aInfo); |
|
169 |
|
170 /** |
|
171 * Set the value for a location field of data type TInt32 in the |
|
172 * HPositionGenericInfo. |
|
173 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
174 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
175 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
176 * be added. |
|
177 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
178 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
179 * object. |
|
180 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
181 * HPositionGenericInfo object. |
|
182 * @return KErrNone if the SetValue was successful. |
|
183 */ |
|
184 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
185 TInt32 aValue, |
|
186 HPositionGenericInfo& aInfo); |
|
187 |
|
188 /** |
|
189 * Get the value for a location field of data type TInt32 from the |
|
190 * HPositionGenericInfo. |
|
191 * @param aFieldId Id of the field for which the value should be read from |
|
192 * HPositionGenericInfo. |
|
193 * @param[out] aValue The object where the data from the |
|
194 * HPositionGenericInfo is returned. |
|
195 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
196 * to be read. |
|
197 * @return KErrNone is the operation was successful. |
|
198 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
199 */ |
|
200 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
201 TInt32& aValue, |
|
202 const HPositionGenericInfo& aInfo); |
|
203 |
|
204 /** |
|
205 * Set the value for a location field of data type TInt64 in the |
|
206 * HPositionGenericInfo. |
|
207 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
208 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
209 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
210 * be added. |
|
211 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
212 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
213 * object. |
|
214 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
215 * HPositionGenericInfo object. |
|
216 * @return KErrNone if the SetValue was successful. |
|
217 */ |
|
218 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
219 const TInt64& aValue, |
|
220 HPositionGenericInfo& aInfo); |
|
221 |
|
222 /** |
|
223 * Get the value for a location field of data type TInt64 from the |
|
224 * HPositionGenericInfo. |
|
225 * @param aFieldId Id of the field for which the value should be read from |
|
226 * HPositionGenericInfo. |
|
227 * @param[out] aValue The object where the data from the |
|
228 * HPositionGenericInfo is returned. |
|
229 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
230 * to be read. |
|
231 * @return KErrNone is the operation was successful. |
|
232 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
233 */ |
|
234 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
235 TInt64& aValue, |
|
236 const HPositionGenericInfo& aInfo); |
|
237 |
|
238 /** |
|
239 * Set the value for a location field of data type TUint8 in the |
|
240 * HPositionGenericInfo. |
|
241 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
242 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
243 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
244 * be added. |
|
245 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
246 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
247 * object. |
|
248 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
249 * HPositionGenericInfo object. |
|
250 * @return KErrNone if the SetValue was successful. |
|
251 */ |
|
252 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
253 TUint8 aValue, |
|
254 HPositionGenericInfo& aInfo); |
|
255 |
|
256 /** |
|
257 * Get the value for a location field of data type TUint8 from the |
|
258 * HPositionGenericInfo. |
|
259 * @param aFieldId Id of the field for which the value should be read from |
|
260 * HPositionGenericInfo. |
|
261 * @param[out] aValue The object where the data from the |
|
262 * HPositionGenericInfo is returned. |
|
263 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
264 * to be read. |
|
265 * @return KErrNone is the operation was successful. |
|
266 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
267 */ |
|
268 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
269 TUint8& aValue, |
|
270 const HPositionGenericInfo& aInfo); |
|
271 |
|
272 /** |
|
273 * Set the value for a location field of data type TUint16 in the |
|
274 * HPositionGenericInfo. |
|
275 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
276 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
277 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
278 * be added. |
|
279 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
280 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
281 * object. |
|
282 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
283 * HPositionGenericInfo object. |
|
284 * @return KErrNone if the SetValue was successful. |
|
285 */ |
|
286 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
287 TUint16 aValue, |
|
288 HPositionGenericInfo& aInfo); |
|
289 |
|
290 /** |
|
291 * Get the value for a location field of data type TUint16 from the |
|
292 * HPositionGenericInfo. |
|
293 * @param aFieldId Id of the field for which the value should be read from |
|
294 * HPositionGenericInfo. |
|
295 * @param[out] aValue The object where the data from the |
|
296 * HPositionGenericInfo is returned. |
|
297 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
298 * to be read. |
|
299 * @return KErrNone is the operation was successful. |
|
300 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
301 */ |
|
302 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
303 TUint16& aValue, |
|
304 const HPositionGenericInfo& aInfo); |
|
305 |
|
306 /** |
|
307 * Set the value for a location field of data type TUint32 in the |
|
308 * HPositionGenericInfo. |
|
309 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
310 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
311 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
312 * be added. |
|
313 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
314 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
315 * object. |
|
316 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
317 * HPositionGenericInfo object. |
|
318 * @return KErrNone if the SetValue was successful. |
|
319 */ |
|
320 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
321 TUint32 aValue, |
|
322 HPositionGenericInfo& aInfo); |
|
323 |
|
324 /** |
|
325 * Get the value for a location field of data type TUint32 from the |
|
326 * HPositionGenericInfo. |
|
327 * @param aFieldId Id of the field for which the value should be read from |
|
328 * HPositionGenericInfo. |
|
329 * @param[out] aValue The object where the data from the |
|
330 * HPositionGenericInfo is returned. |
|
331 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
332 * to be read. |
|
333 * @return KErrNone is the operation was successful. |
|
334 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
335 */ |
|
336 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
337 TUint32& aValue, |
|
338 const HPositionGenericInfo& aInfo); |
|
339 |
|
340 /** |
|
341 * Set the value for a location field of data type TReal32 in the |
|
342 * HPositionGenericInfo. |
|
343 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
344 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
345 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
346 * be added. |
|
347 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
348 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
349 * object. |
|
350 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
351 * HPositionGenericInfo object. |
|
352 * @return KErrNone if the SetValue was successful. |
|
353 */ |
|
354 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
355 TReal32 aValue, |
|
356 HPositionGenericInfo& aInfo); |
|
357 |
|
358 /** |
|
359 * Get the value for a location field of data type TReal32 from the |
|
360 * HPositionGenericInfo. |
|
361 * @param aFieldId Id of the field for which the value should be read from |
|
362 * HPositionGenericInfo. |
|
363 * @param[out] aValue The object where the data from the |
|
364 * HPositionGenericInfo is returned. |
|
365 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
366 * to be read. |
|
367 * @return KErrNone is the operation was successful. |
|
368 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
369 */ |
|
370 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
371 TReal32& aValue, |
|
372 const HPositionGenericInfo& aInfo); |
|
373 |
|
374 /** |
|
375 * Set the value for a location field of data type TReal64 in the |
|
376 * HPositionGenericInfo. |
|
377 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
378 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
379 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
380 * be added. |
|
381 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
382 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
383 * object. |
|
384 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
385 * HPositionGenericInfo object. |
|
386 * @return KErrNone if the SetValue was successful. |
|
387 */ |
|
388 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
389 const TReal64& aValue, |
|
390 HPositionGenericInfo& aInfo); |
|
391 |
|
392 /** |
|
393 * Get the value for a location field of data type TReal64 from the |
|
394 * HPositionGenericInfo. |
|
395 * @param aFieldId Id of the field for which the value should be read from |
|
396 * HPositionGenericInfo. |
|
397 * @param[out] aValue The object where the data from the |
|
398 * HPositionGenericInfo is returned. |
|
399 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
400 * to be read. |
|
401 * @return KErrNone is the operation was successful. |
|
402 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
403 */ |
|
404 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
405 TReal64& aValue, |
|
406 const HPositionGenericInfo& aInfo); |
|
407 |
|
408 /** |
|
409 * Set the value for a location field of data type TDesC8 & TDes8 in the |
|
410 * HPositionGenericInfo. |
|
411 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
412 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
413 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
414 * be added. |
|
415 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
416 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
417 * object. |
|
418 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
419 * HPositionGenericInfo object. |
|
420 * @return KErrNone if the SetValue was successful. |
|
421 */ |
|
422 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
423 const TDesC8& aValue, |
|
424 HPositionGenericInfo& aInfo); |
|
425 |
|
426 /** |
|
427 * Get the value for a location field of data type TDes8 from the |
|
428 * HPositionGenericInfo. |
|
429 * @param aFieldId Id of the field for which the value should be read from |
|
430 * HPositionGenericInfo. |
|
431 * @param[out] aValue The object where the data from the |
|
432 * HPositionGenericInfo is returned. |
|
433 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
434 * to be read. |
|
435 * @return KErrNone is the operation was successful. |
|
436 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
437 */ |
|
438 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
439 TDes8& aValue, |
|
440 const HPositionGenericInfo& aInfo); |
|
441 |
|
442 /** |
|
443 * Set the value for a location field of data type TDesC16 & TDes16 in the |
|
444 * HPositionGenericInfo. |
|
445 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
446 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
447 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
448 * be added. |
|
449 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
450 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
451 * object. |
|
452 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
453 * HPositionGenericInfo object. |
|
454 * @return KErrNone if the SetValue was successful. |
|
455 */ |
|
456 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
457 const TDesC16& aValue, |
|
458 HPositionGenericInfo& aInfo); |
|
459 |
|
460 /** |
|
461 * Get the value for a location field of data type TDes16 from the |
|
462 * HPositionGenericInfo. |
|
463 * @param aFieldId Id of the field for which the value should be read from |
|
464 * HPositionGenericInfo. |
|
465 * @param[out] aValue The object where the data from the |
|
466 * HPositionGenericInfo is returned. |
|
467 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
468 * to be read. |
|
469 * @return KErrNone is the operation was successful. |
|
470 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
471 */ |
|
472 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
473 TDes16& aValue, |
|
474 const HPositionGenericInfo& aInfo); |
|
475 |
|
476 /** |
|
477 * Get the value for a location field of data type TPtrC8 from the |
|
478 * HPositionGenericInfo. |
|
479 * @param aFieldId Id of the field for which the value should be read from |
|
480 * HPositionGenericInfo. |
|
481 * @param[out] aValue The object where the data from the |
|
482 * HPositionGenericInfo is returned. |
|
483 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
484 * to be read. |
|
485 * @return KErrNone is the operation was successful. |
|
486 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
487 */ |
|
488 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
489 TPtrC8& aValue, |
|
490 const HPositionGenericInfo& aInfo); |
|
491 |
|
492 /** |
|
493 * Get the value for a location field of data type TPtrC16 from the |
|
494 * HPositionGenericInfo. |
|
495 * @param aFieldId Id of the field for which the value should be read from |
|
496 * HPositionGenericInfo. |
|
497 * @param[out] aValue The object where the data from the |
|
498 * HPositionGenericInfo is returned. |
|
499 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
500 * to be read. |
|
501 * @return KErrNone is the operation was successful. |
|
502 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
503 */ |
|
504 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
505 TPtrC16& aValue, |
|
506 const HPositionGenericInfo& aInfo); |
|
507 |
|
508 /** |
|
509 * Set the value for a location field of data type TTime in the |
|
510 * HPositionGenericInfo. |
|
511 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
512 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
513 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
514 * be added. |
|
515 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
516 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
517 * object. |
|
518 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
519 * HPositionGenericInfo object. |
|
520 * @return KErrNone if the SetValue was successful. |
|
521 */ |
|
522 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
523 const TTime& aValue, |
|
524 HPositionGenericInfo& aInfo); |
|
525 |
|
526 /** |
|
527 * Get the value for a location field of data type TTime from the |
|
528 * HPositionGenericInfo. |
|
529 * @param aFieldId Id of the field for which the value should be read from |
|
530 * HPositionGenericInfo. |
|
531 * @param[out] aValue The object where the data from the |
|
532 * HPositionGenericInfo is returned. |
|
533 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
534 * to be read. |
|
535 * @return KErrNone is the operation was successful. |
|
536 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
537 */ |
|
538 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
539 TTime& aValue, |
|
540 const HPositionGenericInfo& aInfo); |
|
541 |
|
542 /** |
|
543 * Set the value for a location field of data type TTimeIntervalMicroSeconds in the |
|
544 * HPositionGenericInfo. |
|
545 * @param aFieldId Id of the field to be copied into the HPositionGenericInfo. |
|
546 * @param aValue Value to be copied into the HPositionGenericInfo. |
|
547 * @param aInfo The HPositionGenericInfo object where this field needs to |
|
548 * be added. |
|
549 * @return KErrArgument if aFieldId is EPositionFieldNone. |
|
550 * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo |
|
551 * object. |
|
552 * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the |
|
553 * HPositionGenericInfo object. |
|
554 * @return KErrNone if the SetValue was successful. |
|
555 */ |
|
556 IMPORT_C static TInt SetValue(TPositionFieldId aFieldId, |
|
557 const TTimeIntervalMicroSeconds& aValue, |
|
558 HPositionGenericInfo& aInfo); |
|
559 |
|
560 /** |
|
561 * Get the value for a location field of data type TTimeIntervalMicroSeconds from the |
|
562 * HPositionGenericInfo. |
|
563 * @param aFieldId Id of the field for which the value should be read from |
|
564 * HPositionGenericInfo. |
|
565 * @param[out] aValue The object where the data from the |
|
566 * HPositionGenericInfo is returned. |
|
567 * @param aInfo The HPositionGenericInfo object from where this field needs |
|
568 * to be read. |
|
569 * @return KErrNone is the operation was successful. |
|
570 * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. |
|
571 */ |
|
572 IMPORT_C static TInt GetValue(TPositionFieldId aFieldId, |
|
573 TTimeIntervalMicroSeconds& aValue, |
|
574 const HPositionGenericInfo& aInfo); |
|
575 }; |
|
576 |
|
577 /** |
|
578 * This is an internal class used for indexing entries in HPositionGenericInfo. |
|
579 * Methods in this class are not intended to be called directly. Clients should use |
|
580 * HPositionGenericInfo::GetValue() and HPositionGenericInfo::SetValue() methods. |
|
581 * @internalTechnology |
|
582 * @released |
|
583 */ |
|
584 class TPositionFieldIndex |
|
585 { |
|
586 public: |
|
587 /** Constructor */ |
|
588 inline TPositionFieldIndex(); |
|
589 |
|
590 /** |
|
591 * Get the field ID referred to by this object. |
|
592 * @return The Field Id. The Id is one of the enumerated values of |
|
593 * #_TPositionFieldId. |
|
594 */ |
|
595 inline TPositionFieldId FieldId() const; |
|
596 /** |
|
597 * Get the offset in buffer where this field is contained. |
|
598 * @return The offset in the buffer. |
|
599 */ |
|
600 inline TUint16 FieldStartPos() const; |
|
601 /** |
|
602 * Get the data type of this field. |
|
603 * @return The data type of this field. The data type is one of the |
|
604 * enumerated values of PositionFieldManager::TFieldType. |
|
605 */ |
|
606 inline PositionFieldManager::TFieldType FieldType() const; |
|
607 /** |
|
608 * Set the field ID referred to by this object. |
|
609 * @param aFieldId The Id of the field referred by this object. The Id is |
|
610 * one of the enumerated values of #_TPositionFieldId. |
|
611 */ |
|
612 inline void SetFieldId(TPositionFieldId aFieldId); |
|
613 /** |
|
614 * Set the offset in buffer where this field is contained. |
|
615 * @param aFieldStartPos The offset in the buffer where this field is added. |
|
616 */ |
|
617 inline void SetFieldStartPos(TUint16 aFieldStartPos); |
|
618 /** |
|
619 * Set the data type of this field. |
|
620 * @param aFieldType The data type of this field. The data type is one of |
|
621 * the enumerated values of PositionFieldManager::TFieldType. |
|
622 */ |
|
623 inline void SetFieldType(PositionFieldManager::TFieldType aFieldType); |
|
624 |
|
625 private: |
|
626 /** Id of the field that this index refers to. */ |
|
627 TPositionFieldId iFieldId; |
|
628 /** Offset from HPositionGenericInfo::iBuffer that the object referred to by |
|
629 this index starts at. */ |
|
630 TUint16 iFieldStartPos; |
|
631 /** Type of the data that this index refers to. */ |
|
632 PositionFieldManager::TFieldType iFieldType; |
|
633 }; |
|
634 |
|
635 #endif //__LBSFIELDS_H__ |