|
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 the License "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: Map to store attributes |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __FEEDS_MAP_H |
|
19 #define __FEEDS_MAP_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 // CONSTANTS |
|
26 |
|
27 // MACROS |
|
28 |
|
29 // DATA TYPES |
|
30 |
|
31 // FUNCTION PROTOTYPES |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 |
|
38 class CFeedsMap : public CBase |
|
39 { |
|
40 public: // Construct/Destructor |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 IMPORT_C static CFeedsMap* NewL(); |
|
45 |
|
46 static CFeedsMap* NewLC(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 IMPORT_C ~CFeedsMap(); |
|
52 |
|
53 private: |
|
54 /** |
|
55 * C++ default constructor. |
|
56 */ |
|
57 CFeedsMap(); |
|
58 |
|
59 /** |
|
60 * By default Symbian 2nd phase constructor is private. |
|
61 */ |
|
62 void ConstructL(); |
|
63 |
|
64 public: |
|
65 /** |
|
66 * Sets string Attribute |
|
67 * |
|
68 * |
|
69 * @param Enum value representing an attribute |
|
70 * @param aValue - value of the attribute |
|
71 * @return KErrNone if successful otherwise symbian specific error |
|
72 */ |
|
73 IMPORT_C TInt SetStringAttribute(TUint anAttribute, const TDesC& aValue); |
|
74 |
|
75 /** |
|
76 * Sets integer Attribute |
|
77 * |
|
78 * |
|
79 * @param Enum value representing an attribute |
|
80 * @param aValue - value of the attribute |
|
81 * @return KErrNone if successful otherwise symbian specific error |
|
82 */ |
|
83 IMPORT_C TInt SetIntegerAttribute(TUint anAttribute, TInt aValue); |
|
84 |
|
85 /** |
|
86 * Sets time Attribute |
|
87 * |
|
88 * |
|
89 * @param Enum value representing an attribute |
|
90 * @param aValue - value of the attribute |
|
91 * @return KErrNone if successful otherwise symbian specific error |
|
92 */ |
|
93 IMPORT_C TInt SetTimeAttribute(TUint anAttribute, TTime aValue); |
|
94 |
|
95 /** |
|
96 * Gets string Attribute |
|
97 * |
|
98 * |
|
99 * @param Enum value representing an attribute |
|
100 * @param aValue - returned value of the attribute |
|
101 * @return KErrNone if successful otherwise KErrNotFound |
|
102 */ |
|
103 IMPORT_C TInt GetStringAttribute(TUint anAttribute, TPtrC& aValue) const; |
|
104 |
|
105 /** |
|
106 * Gets integer Attribute |
|
107 * |
|
108 * |
|
109 * @param Enum value representing an attribute |
|
110 * @param aValue - returned value of the attribute |
|
111 * @return KErrNone if successful otherwise KErrNotFound |
|
112 */ |
|
113 IMPORT_C TInt GetIntegerAttribute(TUint anAttribute, TInt& aValue) const; |
|
114 |
|
115 /** |
|
116 * Gets time Attribute |
|
117 * |
|
118 * |
|
119 * @param Enum value representing an attribute |
|
120 * @param aValue - returned value of the attribute |
|
121 * @return KErrNone if successful otherwise KErrNotFound |
|
122 */ |
|
123 IMPORT_C TInt GetTimeAttribute(TUint anAttribute, TTime& aValue) const; |
|
124 |
|
125 /** |
|
126 * Resets Map |
|
127 * |
|
128 * |
|
129 * @return void |
|
130 */ |
|
131 IMPORT_C void ResetL(); |
|
132 |
|
133 /** |
|
134 * Checks whether Given attribute exists in map |
|
135 * |
|
136 * |
|
137 * @return ETrue if attribute exits in map |
|
138 */ |
|
139 |
|
140 IMPORT_C TBool IsExist(TUint anAttribute) const; |
|
141 |
|
142 /** |
|
143 * Retuns the count of entries in the map |
|
144 * |
|
145 * @return Total number of entries in the map |
|
146 */ |
|
147 IMPORT_C TInt Count()const; |
|
148 |
|
149 /** |
|
150 * Overloaded array operator funtion |
|
151 * |
|
152 * @return enum value corresponding to an attribute |
|
153 */ |
|
154 IMPORT_C TUint operator[](TInt index)const; |
|
155 |
|
156 |
|
157 private: |
|
158 // Data |
|
159 RArray<TUint> iEnums; |
|
160 HBufC* iValueString; |
|
161 RArray<TInt> iStart; |
|
162 RArray<TInt> iSize; |
|
163 }; |
|
164 |
|
165 #endif // #ifndef __FEEDS_MAP_H |