|
1 /* |
|
2 * Copyright (c) 2002 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: ImumInSettingsDataCtrl.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IMUMINDATAKEYCTRL_H |
|
20 #define IMUMINDATAKEYCTRL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // CONSTANTS |
|
26 // MACROS |
|
27 // DATA TYPES |
|
28 // FUNCTION PROTOTYPES |
|
29 // FORWARD DECLARATIONS |
|
30 class MImumDaSettingsDataCollection; |
|
31 class CImumInSettingsDataArray; |
|
32 class CImumInSettingsDataAttribute; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Static class to control settings data object handling. |
|
38 * |
|
39 * @lib ImumUtils.lib |
|
40 * @since S60 v3.2 |
|
41 */ |
|
42 NONSHARABLE_CLASS( ImumInSettingsDataCtrl ) |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 public: // New functions |
|
46 |
|
47 /** |
|
48 * Creates an attribute with specific parameters into the array |
|
49 * |
|
50 * @since S60 v3.2 |
|
51 * @param aArray The settings array, the attribute will be created |
|
52 * @param aDefaultData Default data container |
|
53 * @param aAttributeKey Unique key Id |
|
54 * @param aAttributeType Type of the key |
|
55 * @param aAttributeValue The value of the attribute |
|
56 * @param aEmptyDefaultValue The default value of the attribute |
|
57 * @return KErrNone, when ok |
|
58 */ |
|
59 template<class TDefaultDataType, class TAttributeType, class TDefaultType> |
|
60 static inline TInt CreateToArray( |
|
61 CImumInSettingsDataArray& aArray, |
|
62 const TDefaultDataType* aDefaultData, |
|
63 const TUint aAttributeKey, |
|
64 const TInt aAttributeType, |
|
65 const TAttributeType& aAttributeValue, |
|
66 TDefaultType& aEmptyDefaultValue ); |
|
67 |
|
68 /** |
|
69 * Gets attribute value from the array |
|
70 * |
|
71 * @since S60 v3.2 |
|
72 * @param aArray Array which contains the attribute |
|
73 * @param aAttributeKey Unique id of the key to be retrieved |
|
74 * @param aAttributeType Type of the attribute |
|
75 * @param aAttributeValue The return parameter for the value |
|
76 * @return KErrNone, when successful |
|
77 */ |
|
78 template<class TAttributeType> |
|
79 static inline TInt RetrieveFromArray( |
|
80 CImumInSettingsDataArray& aArray, |
|
81 const TUint aAttributeKey, |
|
82 const TInt aAttributeType, |
|
83 TAttributeType& aAttributeValue ); |
|
84 |
|
85 /** |
|
86 * Determines, if the attribute is text type |
|
87 * |
|
88 * @since S60 v3.2 |
|
89 * @param aAttributeType Type of the attribute |
|
90 * @return ETrue, when attribute is a text type |
|
91 */ |
|
92 static TBool IsText( const TInt aAttributeType ); |
|
93 |
|
94 /** |
|
95 * Determines, if the attribute is number type |
|
96 * |
|
97 * @since S60 v3.2 |
|
98 * @param aAttributeType Type of the attribute |
|
99 * @return ETrue, when attribute is a text type |
|
100 */ |
|
101 static TBool IsNumber( const TInt aAttributeType ); |
|
102 |
|
103 /** |
|
104 * Gets next available key in the setting list. |
|
105 * |
|
106 * @deprecated |
|
107 * @since S60 v3.2 |
|
108 */ |
|
109 static TBool GetNextKey( |
|
110 TUint& aKey, |
|
111 const TBool& aIncludeCompulsory ); |
|
112 |
|
113 /** |
|
114 * Checks if the item is compulsory |
|
115 * |
|
116 * @deprecated |
|
117 * @since S60 v3.2 |
|
118 */ |
|
119 static TBool IsCompulsory( TUint& aKey ); |
|
120 |
|
121 |
|
122 /** |
|
123 * Copies the content of source to destination |
|
124 * |
|
125 * @deprecated |
|
126 * @since S60 v3.2 |
|
127 * @param |
|
128 * @return |
|
129 */ |
|
130 template<class T> |
|
131 static inline TInt Copy( |
|
132 MImumDaSettingsDataCollection& aDestination, |
|
133 const MImumDaSettingsDataCollection& aSource, |
|
134 const TUint aAttributeKey, |
|
135 T& aAttribute, |
|
136 const TInt aErrorCode ); |
|
137 |
|
138 /** |
|
139 * |
|
140 * |
|
141 * @deprecated |
|
142 * @since S60 v3.2 |
|
143 * @param |
|
144 * @return |
|
145 */ |
|
146 template<TInt L> |
|
147 static inline TBool CompareText( |
|
148 const MImumDaSettingsDataCollection& aDestinationSettings, |
|
149 const MImumDaSettingsDataCollection& aSourceSettings, |
|
150 const TUint aAttributeKey ); |
|
151 |
|
152 /** |
|
153 * |
|
154 * |
|
155 * @deprecated |
|
156 * @since S60 v3.2 |
|
157 * @param |
|
158 * @return |
|
159 */ |
|
160 template<TInt L> |
|
161 static inline TBool CompareText8( |
|
162 const MImumDaSettingsDataCollection& aDestinationSettings, |
|
163 const MImumDaSettingsDataCollection& aSourceSettings, |
|
164 const TUint aAttributeKey ); |
|
165 |
|
166 /** |
|
167 * |
|
168 * |
|
169 * @deprecated |
|
170 * @since S60 v3.2 |
|
171 * @param |
|
172 * @return |
|
173 */ |
|
174 template<class T> |
|
175 static inline TBool CompareNum( |
|
176 const MImumDaSettingsDataCollection& aDestinationSettings, |
|
177 const MImumDaSettingsDataCollection& aSourceSettings, |
|
178 const TUint aAttributeKey ); |
|
179 |
|
180 public: // Functions from base classes |
|
181 |
|
182 protected: // Constructors |
|
183 protected: // New virtual functions |
|
184 protected: // New functions |
|
185 protected: // Functions from base classes |
|
186 |
|
187 private: // New virtual functions |
|
188 private: // New functions |
|
189 |
|
190 /** |
|
191 * Creates attribute object |
|
192 * |
|
193 * @since S60 v3.2 |
|
194 * @param aAttributeKey Unique key ID |
|
195 * @param aAttributeType Type of the key |
|
196 * @param aAttributeValue The value of the attribute |
|
197 * @param aEmptyDefaultValue The default value of the attribute |
|
198 * @return New attribute object. Ownership to caller. |
|
199 */ |
|
200 template<class TValueType, class TDefaultType> |
|
201 static inline CImumInSettingsDataAttribute* CreateAttributeL( |
|
202 const TUint aAttributeId, |
|
203 const TInt aAttributeType, |
|
204 const TValueType& aAttributeValue, |
|
205 const TDefaultType& aAttributeDefault ); |
|
206 |
|
207 /** |
|
208 * Gets the type of the attribute |
|
209 * |
|
210 * @since S60 v3.2 |
|
211 * @param aAttributeKey Unique key ID |
|
212 * @return Type of the attribute |
|
213 */ |
|
214 static TInt GetKeyAttributeType( const TUint aAttributeKey ); |
|
215 |
|
216 /** |
|
217 * |
|
218 * |
|
219 * @deprected |
|
220 * @since S60 v3.2 |
|
221 * @param |
|
222 * @return |
|
223 */ |
|
224 static TInt MatchKey( |
|
225 const TUint aAttributeKey, |
|
226 const TInt aRequiredKey ); |
|
227 |
|
228 private: // Functions from base classes |
|
229 |
|
230 public: // Data |
|
231 protected: // Data |
|
232 private: // Data |
|
233 }; |
|
234 |
|
235 #include "ImumInSettingsDataCtrl.inl" |
|
236 |
|
237 #endif // IMUMINDATAKEYCTRL_H |
|
238 |
|
239 // End of File |