|
1 /* |
|
2 * Copyright (c) 2008 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: Holds Location API address information |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CLAPIADDRESSINFO_H |
|
20 #define CLAPIADDRESSINFO_H |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 /** |
|
26 * Holds Location API address information |
|
27 * |
|
28 * Basically this class is a value and identifier holder which maps |
|
29 * each value to a specific field index. The values can be obtained |
|
30 * using these indexes |
|
31 * |
|
32 * Values can be null or non-null |
|
33 * |
|
34 * @lib N/A |
|
35 * @since S60 3.2 |
|
36 */ |
|
37 NONSHARABLE_CLASS(CLAPIAddressInfo) : public CBase |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. Creates an instance from this class |
|
43 * The caller takes the ownership of the returned instance |
|
44 * |
|
45 * @return New instance from this class |
|
46 */ |
|
47 static CLAPIAddressInfo* NewL(); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. Creates an instance from this class |
|
51 * The caller takes the ownership of the returned instance which |
|
52 * is left to the cleanup stack |
|
53 * |
|
54 * @return New instance from this class |
|
55 */ |
|
56 static CLAPIAddressInfo* NewLC(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CLAPIAddressInfo(); |
|
62 |
|
63 public: // New methods |
|
64 |
|
65 /** |
|
66 * Returns the value count of this address information |
|
67 * |
|
68 * The count includes both, null and non-null elements |
|
69 * |
|
70 * @return The number of values in this address information object |
|
71 */ |
|
72 TInt ValueCount() const; |
|
73 |
|
74 /** |
|
75 * Sets an address information value to a specific field id |
|
76 * |
|
77 * The existing value will be overwritten or a new value will |
|
78 * be added if the field identifier does not exist |
|
79 * |
|
80 * @param aFieldId The identifier of the value |
|
81 * @param aValue The value which maps to the identifier. The |
|
82 * ownership of the value is NOT tranferred to this class |
|
83 */ |
|
84 void SetValueL(TInt aFieldId, const TDesC* aValue); |
|
85 |
|
86 /** |
|
87 * Returns the value of the given field identifier |
|
88 * |
|
89 * A null value is returned if there is no value which maps |
|
90 * to the given identifier. The ownership of the value is NOT |
|
91 * transferred to the caller |
|
92 * |
|
93 * @param aFieldId The field id which value should be returned |
|
94 * @return The value which maps to the given indentifier. Null |
|
95 * is returned if there is no value which maps to the |
|
96 * given identifier |
|
97 */ |
|
98 const TDesC* Value(TInt aFieldId) const; |
|
99 |
|
100 private: // Constructors |
|
101 |
|
102 /** |
|
103 * Constructor |
|
104 */ |
|
105 CLAPIAddressInfo(); |
|
106 |
|
107 private: // Data |
|
108 |
|
109 // Values. Owned |
|
110 RPointerArray< HBufC> iValues; |
|
111 // Ids. Owned |
|
112 RArray< TInt> iIds; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // CLAPIADDRESSINFO_H |
|
117 // End of file |