32 * @since S60 V3.2 |
32 * @since S60 V3.2 |
33 */ |
33 */ |
34 NONSHARABLE_CLASS( CSPProperty ): public CBase |
34 NONSHARABLE_CLASS( CSPProperty ): public CBase |
35 { |
35 { |
36 |
36 |
37 public: // Constructor and destructor |
37 public: // Constructor and destructor |
38 |
38 |
39 /** |
39 /** |
40 * Two-phased constructor. |
40 * Two-phased constructor. |
41 */ |
41 */ |
42 IMPORT_C static CSPProperty* NewL(); |
42 IMPORT_C static CSPProperty* NewL(); |
43 |
43 |
44 /** |
44 /** |
45 * Two-phased constructor. |
45 * Two-phased constructor. |
46 */ |
46 */ |
47 IMPORT_C static CSPProperty* NewLC(); |
47 IMPORT_C static CSPProperty* NewLC(); |
48 |
48 |
49 /** |
49 /** |
50 * Destructors. |
50 * Destructors. |
51 */ |
51 */ |
52 IMPORT_C virtual ~CSPProperty(); |
52 IMPORT_C virtual ~CSPProperty(); |
53 |
53 |
54 public: // member functions |
54 public: // member functions |
55 /** |
55 /** |
56 * Returns the name of this property |
56 * Returns the name of this property |
57 * |
57 * |
58 * @since S60 V3.2 |
58 * @since S60 V3.2 |
59 * @return Name of property |
59 * @return Name of property |
60 */ |
60 */ |
61 IMPORT_C TServicePropertyName GetName() const; |
61 IMPORT_C TServicePropertyName GetName() const; |
62 |
62 |
63 /** |
63 /** |
64 * Sets the name for this property |
64 * Sets the name for this property |
65 * |
65 * |
66 * @since S60 V3.2 |
66 * @since S60 V3.2 |
67 * @param aPropertyname new property name |
67 * @param aPropertyname new property name |
68 */ |
68 */ |
69 IMPORT_C TInt SetName( TServicePropertyName aPropertyname ); |
69 IMPORT_C TInt SetName( TServicePropertyName aPropertyname ); |
70 |
70 |
71 /** |
71 /** |
72 * Returns the type of this property |
72 * Returns the type of this property |
73 * |
73 * |
74 * @since S60 V3.2 |
74 * @since S60 V3.2 |
75 * @return Type of property |
75 * @return Type of property |
76 */ |
76 */ |
77 IMPORT_C TSPItemType GetPropertyType() const; |
77 IMPORT_C TSPItemType GetPropertyType() const; |
78 |
78 |
79 /** |
79 /** |
80 * Sets the type for this property |
80 * Sets the type for this property |
81 * |
81 * |
82 * @since S60 V3.2 |
82 * @since S60 V3.2 |
83 * @param aPropertyType property type |
83 * @param aPropertyType property type |
84 */ |
84 */ |
85 TInt SetPropertyType( TSPItemType aPropertyType ); |
85 TInt SetPropertyType( TSPItemType aPropertyType ); |
86 |
86 |
87 |
87 |
88 /** |
88 /** |
89 * Returns the datatype of this property |
89 * Returns the datatype of this property |
90 * No imported, set automatically. |
90 * No imported, set automatically. |
91 * |
91 * |
92 * @since S60 V3.2 |
92 * @since S60 V3.2 |
93 * @return Datatype of property |
93 * @return Datatype of property |
94 */ |
94 */ |
95 IMPORT_C TPropertyDataType GetDataType() const; |
95 IMPORT_C TPropertyDataType GetDataType() const; |
96 |
96 |
97 /** |
97 /** |
98 * Sets the datatype of this property |
98 * Sets the datatype of this property |
99 * |
99 * |
100 * @since S60 V3.2 |
100 * @since S60 V3.2 |
101 * @param aDataType new data type |
101 * @param aDataType new data type |
102 */ |
102 */ |
103 void SetDataType( TPropertyDataType aDataType ); |
103 void SetDataType( TPropertyDataType aDataType ); |
104 |
104 |
105 /** |
105 /** |
106 * Returns value of property |
106 * Returns value of property |
107 * |
107 * |
108 * @since S60 V3.2 |
108 * @since S60 V3.2 |
109 * @param aValue on return, TInt value |
109 * @param aValue on return, TInt value |
110 * @return Error code |
110 * @return Error code |
111 */ |
111 */ |
112 IMPORT_C TInt GetValue( TInt& aValue ) const; |
112 IMPORT_C TInt GetValue( TInt& aValue ) const; |
113 |
113 |
114 /** |
114 /** |
115 * Sets value of property. Value must match to datatype. |
115 * Sets value of property. Value must match to datatype. |
116 * |
116 * |
117 * @since S60 V3.2 |
117 * @since S60 V3.2 |
118 * @param aValue new TInt value to be set |
118 * @param aValue new TInt value to be set |
119 * @return Error code |
119 * @return Error code |
120 */ |
120 */ |
121 IMPORT_C TInt SetValue( TInt aValue ); |
121 IMPORT_C TInt SetValue( TInt aValue ); |
122 |
122 |
123 /** |
123 /** |
124 * Returns value of property |
124 * Returns value of property |
125 * |
125 * |
126 * @since S60 V3.2 |
126 * @since S60 V3.2 |
127 * @param aValue on return, descriptor value |
127 * @param aValue on return, descriptor value |
128 * @return Error code |
128 * @return Error code |
129 */ |
129 */ |
130 IMPORT_C TInt GetValue( TDes& aValue ) const; |
130 IMPORT_C TInt GetValue( TDes& aValue ) const; |
131 |
131 |
132 /** |
132 /** |
133 * Sets the value of property. Value must match to datatype. |
133 * Sets the value of property. Value must match to datatype. |
134 * |
134 * |
135 * @since S60 V3.2 |
135 * @since S60 V3.2 |
136 * @param aValue new descriptor |
136 * @param aValue new descriptor |
137 * @return Error code |
137 * @return Error code |
138 */ |
138 */ |
139 IMPORT_C TInt SetValue( const TDesC& aValue ); |
139 IMPORT_C TInt SetValue( const TDesC& aValue ); |
140 |
140 |
141 |
141 |
142 /** |
142 /** |
143 * Returns value of property |
143 * Returns value of property |
144 * |
144 * |
145 * @since S60 V3.2 |
145 * @since S60 V3.2 |
146 * @param aValue on return, On/Off value |
146 * @param aValue on return, On/Off value |
147 * @return Error code |
147 * @return Error code |
148 */ |
148 */ |
149 IMPORT_C TInt GetValue( TOnOff& aValue ) const; |
149 IMPORT_C TInt GetValue( TOnOff& aValue ) const; |
150 |
150 |
151 /** |
151 /** |
152 * Sets the value of property. Value must match to datatype. |
152 * Sets the value of property. Value must match to datatype. |
153 * |
153 * |
154 * @since S60 V3.2 |
154 * @since S60 V3.2 |
155 * @param aValue new On/Off value |
155 * @param aValue new On/Off value |
156 * @return Error code |
156 * @return Error code |
157 */ |
157 */ |
158 IMPORT_C TInt SetValue( TOnOff aValue ); |
158 IMPORT_C TInt SetValue( TOnOff aValue ); |
159 |
159 |
160 /** |
160 /** |
161 * Sets the value of this property without datatype check |
161 * Sets the value of this property without datatype check |
162 * |
162 * |
163 * @since S60 V3.2 |
163 * @since S60 V3.2 |
164 * @param aValue new value |
164 * @param aValue new value |
165 * @return Error code |
165 * @return Error code |
166 */ |
166 */ |
167 TInt SetValueNoDataTypeCheck( const TDesC& aValue ); |
167 TInt SetValueNoDataTypeCheck( const TDesC& aValue ); |
168 |
168 |
169 /** |
169 /** |
170 * Returns datatype of given property |
170 * Returns datatype of given property |
171 * |
171 * |
172 * @since S60 V3.2 |
172 * @since S60 V3.2 |
173 * @param aProperty property name |
173 * @param aProperty property name |
174 * @return Datatype of given property |
174 * @return Datatype of given property |
175 */ |
175 */ |
176 IMPORT_C static TPropertyDataType DataType( TServicePropertyName aProperty ); |
176 IMPORT_C static TPropertyDataType DataType( TServicePropertyName aProperty ); |
177 |
177 |
178 /** |
178 /** |
179 * Returns property type of given property |
179 * Returns property type of given property |
180 * |
180 * |
181 * @since S60 V3.2 |
181 * @since S60 V3.2 |
182 * @param aProperty property name |
182 * @param aProperty property name |
183 * @return property type of given property |
183 * @return property type of given property |
184 */ |
184 */ |
185 IMPORT_C static TSPItemType PropertyType( TServicePropertyName aProperty ); |
185 IMPORT_C static TSPItemType PropertyType( TServicePropertyName aProperty ); |
186 |
186 |
187 /** |
187 /** |
188 * Copies data from source property // to be removed? |
188 * Copies data from source property // to be removed? |
189 * |
189 * |
190 * @since S60 V3.2 |
190 * @since S60 V3.2 |
191 * @param aSource source property |
191 * @param aSource source property |
192 */ |
192 */ |
193 IMPORT_C void CopyL( const CSPProperty& aSource ); |
193 IMPORT_C void CopyL( const CSPProperty& aSource ); |
194 |
194 |
195 /** |
195 /** |
196 * Compares data of this property to another. |
196 * Compares data of this property to another. |
197 * |
197 * |
198 * @since S60 V3.2 |
198 * @since S60 V3.2 |
199 * @param aProperty property to be compared |
199 * @param aProperty property to be compared |
200 * @return ETrue if properties have same data |
200 * @return ETrue if properties have same data |
201 */ |
201 */ |
202 IMPORT_C TBool operator==( |
202 IMPORT_C TBool operator==( |
203 const CSPProperty& aProperty ) const; |
203 const CSPProperty& aProperty ) const; |
204 |
204 |
205 private: |
205 private: |
206 |
206 |
207 /** |
207 /** |
208 * C++ default constructor. |
208 * C++ default constructor. |
209 */ |
209 */ |
210 CSPProperty(); |
210 CSPProperty(); |
211 |
211 |
212 /** |
212 /** |
213 * By default Symbian 2nd phase constructor is private. |
213 * By default Symbian 2nd phase constructor is private. |
214 */ |
214 */ |
215 void ConstructL(); |
215 void ConstructL(); |
216 |
216 |
217 /** |
217 /** |
218 * Sets default value of property if defined |
218 * Sets default value of property if defined |
219 * |
219 * |
220 * @since S60 V3.2 |
220 * @since S60 V3.2 |
221 * @param aProperty property name |
221 * @param aProperty property name |
222 * @return An error code |
222 * @return An error code |
223 */ |
223 */ |
224 TInt SetDefaultValue( TServicePropertyName aProperty ); |
224 TInt SetDefaultValue( TServicePropertyName aProperty ); |
225 |
225 |
226 private: // data |
226 private: // data |
227 |
227 |
228 /** |
228 /** |
229 * Descriptor of property value |
229 * Descriptor of property value |
230 * Own. |
230 * Own. |
231 */ |
231 */ |
232 RBuf iPropertyValue; |
232 RBuf iPropertyValue; |
233 |
233 |
234 /** |
234 /** |
235 * Name of property |
235 * Name of property |
236 */ |
236 */ |
237 TServicePropertyName iPropertyName; |
237 TServicePropertyName iPropertyName; |
238 |
238 |
239 /** |
239 /** |
240 * Datatype of property |
240 * Datatype of property |
241 */ |
241 */ |
242 TPropertyDataType iDataType; |
242 TPropertyDataType iDataType; |
243 |
243 |
244 /** |
244 /** |
245 * Property type |
245 * Property type |
246 */ |
246 */ |
247 TSPItemType iPropertyType; |
247 TSPItemType iPropertyType; |
248 |
248 |
249 }; |
249 }; |
250 |
250 |
251 |
251 |
252 #endif // C_SPPROPERTY_H |
252 #endif // C_SPPROPERTY_H |