author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:15:03 +0100 | |
branch | RCL_3 |
changeset 20 | 987c9837762f |
parent 19 | 7d48bed6ce0c |
permissions | -rw-r--r-- |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Header file of service provider settings property class |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#ifndef C_SPPROPERTY_H |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#define C_SPPROPERTY_H |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <e32base.h> |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "spdefinitions.h" |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
/** |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
* Service provider settings property class |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
* This class represent one property of Sevice Provider settings |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
* |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
* @lib serviceprovidersettings.lib |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
* @since S60 V3.2 |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
*/ |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
NONSHARABLE_CLASS( CSPProperty ): public CBase |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
{ |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
|
20 | 37 |
public: // Constructor and destructor |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
20 | 39 |
/** |
40 |
* Two-phased constructor. |
|
41 |
*/ |
|
42 |
IMPORT_C static CSPProperty* NewL(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
|
20 | 44 |
/** |
45 |
* Two-phased constructor. |
|
46 |
*/ |
|
47 |
IMPORT_C static CSPProperty* NewLC(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
|
20 | 49 |
/** |
50 |
* Destructors. |
|
51 |
*/ |
|
52 |
IMPORT_C virtual ~CSPProperty(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
20 | 54 |
public: // member functions |
55 |
/** |
|
56 |
* Returns the name of this property |
|
57 |
* |
|
58 |
* @since S60 V3.2 |
|
59 |
* @return Name of property |
|
60 |
*/ |
|
61 |
IMPORT_C TServicePropertyName GetName() const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
|
20 | 63 |
/** |
64 |
* Sets the name for this property |
|
65 |
* |
|
66 |
* @since S60 V3.2 |
|
67 |
* @param aPropertyname new property name |
|
68 |
*/ |
|
69 |
IMPORT_C TInt SetName( TServicePropertyName aPropertyname ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
20 | 71 |
/** |
72 |
* Returns the type of this property |
|
73 |
* |
|
74 |
* @since S60 V3.2 |
|
75 |
* @return Type of property |
|
76 |
*/ |
|
77 |
IMPORT_C TSPItemType GetPropertyType() const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
|
20 | 79 |
/** |
80 |
* Sets the type for this property |
|
81 |
* |
|
82 |
* @since S60 V3.2 |
|
83 |
* @param aPropertyType property type |
|
84 |
*/ |
|
85 |
TInt SetPropertyType( TSPItemType aPropertyType ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
|
20 | 88 |
/** |
89 |
* Returns the datatype of this property |
|
90 |
* No imported, set automatically. |
|
91 |
* |
|
92 |
* @since S60 V3.2 |
|
93 |
* @return Datatype of property |
|
94 |
*/ |
|
95 |
IMPORT_C TPropertyDataType GetDataType() const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
|
20 | 97 |
/** |
98 |
* Sets the datatype of this property |
|
99 |
* |
|
100 |
* @since S60 V3.2 |
|
101 |
* @param aDataType new data type |
|
102 |
*/ |
|
103 |
void SetDataType( TPropertyDataType aDataType ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
|
20 | 105 |
/** |
106 |
* Returns value of property |
|
107 |
* |
|
108 |
* @since S60 V3.2 |
|
109 |
* @param aValue on return, TInt value |
|
110 |
* @return Error code |
|
111 |
*/ |
|
112 |
IMPORT_C TInt GetValue( TInt& aValue ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
|
20 | 114 |
/** |
115 |
* Sets value of property. Value must match to datatype. |
|
116 |
* |
|
117 |
* @since S60 V3.2 |
|
118 |
* @param aValue new TInt value to be set |
|
119 |
* @return Error code |
|
120 |
*/ |
|
121 |
IMPORT_C TInt SetValue( TInt aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
|
20 | 123 |
/** |
124 |
* Returns value of property |
|
125 |
* |
|
126 |
* @since S60 V3.2 |
|
127 |
* @param aValue on return, descriptor value |
|
128 |
* @return Error code |
|
129 |
*/ |
|
130 |
IMPORT_C TInt GetValue( TDes& aValue ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
|
20 | 132 |
/** |
133 |
* Sets the value of property. Value must match to datatype. |
|
134 |
* |
|
135 |
* @since S60 V3.2 |
|
136 |
* @param aValue new descriptor |
|
137 |
* @return Error code |
|
138 |
*/ |
|
139 |
IMPORT_C TInt SetValue( const TDesC& aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
|
20 | 142 |
/** |
143 |
* Returns value of property |
|
144 |
* |
|
145 |
* @since S60 V3.2 |
|
146 |
* @param aValue on return, On/Off value |
|
147 |
* @return Error code |
|
148 |
*/ |
|
149 |
IMPORT_C TInt GetValue( TOnOff& aValue ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
|
20 | 151 |
/** |
152 |
* Sets the value of property. Value must match to datatype. |
|
153 |
* |
|
154 |
* @since S60 V3.2 |
|
155 |
* @param aValue new On/Off value |
|
156 |
* @return Error code |
|
157 |
*/ |
|
158 |
IMPORT_C TInt SetValue( TOnOff aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
|
20 | 160 |
/** |
161 |
* Sets the value of this property without datatype check |
|
162 |
* |
|
163 |
* @since S60 V3.2 |
|
164 |
* @param aValue new value |
|
165 |
* @return Error code |
|
166 |
*/ |
|
167 |
TInt SetValueNoDataTypeCheck( const TDesC& aValue ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
|
20 | 169 |
/** |
170 |
* Returns datatype of given property |
|
171 |
* |
|
172 |
* @since S60 V3.2 |
|
173 |
* @param aProperty property name |
|
174 |
* @return Datatype of given property |
|
175 |
*/ |
|
176 |
IMPORT_C static TPropertyDataType DataType( TServicePropertyName aProperty ); |
|
177 |
||
178 |
/** |
|
179 |
* Returns property type of given property |
|
180 |
* |
|
181 |
* @since S60 V3.2 |
|
182 |
* @param aProperty property name |
|
183 |
* @return property type of given property |
|
184 |
*/ |
|
185 |
IMPORT_C static TSPItemType PropertyType( TServicePropertyName aProperty ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
|
20 | 187 |
/** |
188 |
* Copies data from source property // to be removed? |
|
189 |
* |
|
190 |
* @since S60 V3.2 |
|
191 |
* @param aSource source property |
|
192 |
*/ |
|
193 |
IMPORT_C void CopyL( const CSPProperty& aSource ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
|
20 | 195 |
/** |
196 |
* Compares data of this property to another. |
|
197 |
* |
|
198 |
* @since S60 V3.2 |
|
199 |
* @param aProperty property to be compared |
|
200 |
* @return ETrue if properties have same data |
|
201 |
*/ |
|
202 |
IMPORT_C TBool operator==( |
|
203 |
const CSPProperty& aProperty ) const; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
|
20 | 205 |
private: |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
|
20 | 207 |
/** |
208 |
* C++ default constructor. |
|
209 |
*/ |
|
210 |
CSPProperty(); |
|
211 |
||
212 |
/** |
|
213 |
* By default Symbian 2nd phase constructor is private. |
|
214 |
*/ |
|
215 |
void ConstructL(); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
|
20 | 217 |
/** |
218 |
* Sets default value of property if defined |
|
219 |
* |
|
220 |
* @since S60 V3.2 |
|
221 |
* @param aProperty property name |
|
222 |
* @return An error code |
|
223 |
*/ |
|
224 |
TInt SetDefaultValue( TServicePropertyName aProperty ); |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
|
20 | 226 |
private: // data |
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
|
20 | 228 |
/** |
229 |
* Descriptor of property value |
|
230 |
* Own. |
|
231 |
*/ |
|
232 |
RBuf iPropertyValue; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
|
20 | 234 |
/** |
235 |
* Name of property |
|
236 |
*/ |
|
237 |
TServicePropertyName iPropertyName; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
|
20 | 239 |
/** |
240 |
* Datatype of property |
|
241 |
*/ |
|
242 |
TPropertyDataType iDataType; |
|
243 |
||
244 |
/** |
|
245 |
* Property type |
|
246 |
*/ |
|
247 |
TSPItemType iPropertyType; |
|
0
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
}; |
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
|
ff3b6d0fd310
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
#endif // C_SPPROPERTY_H |