|
1 /* |
|
2 * Copyright (c) 2006 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPGENERALVOIPSETTINGSADAPTER_H |
|
20 #define CWPGENERALVOIPSETTINGSADAPTER_H |
|
21 |
|
22 #include <CWPAdapter.h> |
|
23 #include <MWPContextExtension.h> |
|
24 |
|
25 class CWPCharacteristic; |
|
26 |
|
27 /** |
|
28 * Realizes general VoIP settings provisioning adapter. |
|
29 * |
|
30 * General VoIP settings adapter handles general VoIP settings and stores |
|
31 * them via Central Repository. |
|
32 * |
|
33 * @lib CWPGeneralVoIPSettingsAdapter.lib |
|
34 * @since S60 v3.0. |
|
35 */ |
|
36 class CWPGeneralVoIPSettingsAdapter : public CWPAdapter, public MWPContextExtension |
|
37 { |
|
38 #ifdef _DEBUG |
|
39 /** |
|
40 * Friend class for unit testing. |
|
41 */ |
|
42 friend class UT_CWPGeneralVoIPSettingsAdapter; |
|
43 #endif |
|
44 |
|
45 public: |
|
46 |
|
47 static CWPGeneralVoIPSettingsAdapter* NewL(); |
|
48 |
|
49 virtual ~CWPGeneralVoIPSettingsAdapter(); |
|
50 |
|
51 /** |
|
52 * Setter for iName. |
|
53 * |
|
54 * @since S60 v3.0. |
|
55 * @param aName User viewable name of general VoIP settings. |
|
56 */ |
|
57 void SetNameL( const TDesC& aName ); |
|
58 |
|
59 /** |
|
60 * Setter for iToAppref. Value is changed only if iToApprefSet |
|
61 * is EFalse. |
|
62 * |
|
63 * @since S60 v3.2.3. |
|
64 * @param aToAppRef Value for TO-APPREF. Links to VoIP settings. |
|
65 */ |
|
66 void SetToApprefL( const TDesC8& aToAppRef ); |
|
67 |
|
68 /** |
|
69 * Setter for iClir. |
|
70 * |
|
71 * @since S60 v3.0. |
|
72 * @param aClir Value for VoIP CLIR enabling rule. |
|
73 */ |
|
74 void SetClir( const TInt aClir ); |
|
75 |
|
76 /** |
|
77 * Setter for iACBRule. |
|
78 * |
|
79 * @since S60 v3.0. |
|
80 * @param aACBRule Value for anonymous call blocking rule. |
|
81 */ |
|
82 void SetACBRule( const TInt aACBRule ); |
|
83 |
|
84 /** |
|
85 * Setter for iPrefTel. |
|
86 * |
|
87 * @since S60 v3.0. |
|
88 * @param aPrefTel Preferred telephony mode value. |
|
89 */ |
|
90 void SetPrefTel( const TInt aPrefTel ); |
|
91 |
|
92 /** |
|
93 * Setter for iDnd. |
|
94 * |
|
95 * @since S60 v3.0. |
|
96 * @param aDnd Value for do not disturb setting. |
|
97 */ |
|
98 void SetDnd( const TInt aDnd ); |
|
99 |
|
100 /** |
|
101 * Setter for iPSCallWaiting. |
|
102 * |
|
103 * @since S60 v3.0. |
|
104 * @param aPSCallWaiting Value for PS call waiting rule. |
|
105 */ |
|
106 void SetPSCallWaiting( const TInt aPSCallWaiting ); |
|
107 |
|
108 /** |
|
109 * Setter for iPrefTelLock. |
|
110 * |
|
111 * @since S60 v3.0. |
|
112 * @param aPrefTelLock Value for telephony preference lock. |
|
113 */ |
|
114 void SetPrefTelLock( const TInt aPrefTelLock ); |
|
115 |
|
116 /** |
|
117 * Setter for iCsRadioWifiOff. |
|
118 * |
|
119 * @since S60 v3.0. |
|
120 * @param aCsRadioWifiOff Value for turning CS radio off in WiFi mode. |
|
121 */ |
|
122 void SetCsRadioWifiOff( const TInt aCsRadioWifiOff ); |
|
123 |
|
124 /** |
|
125 * Getter for iProviderId. |
|
126 * |
|
127 * @since S60 v3.0. |
|
128 * @return Provider of general VoIP settings. |
|
129 */ |
|
130 TDesC& ProviderId(); |
|
131 |
|
132 /** |
|
133 * Getter for iName. |
|
134 * |
|
135 * @since S60 v3.0. |
|
136 * @return User viewable name of general VoIP settings. |
|
137 */ |
|
138 TDesC& Name(); |
|
139 |
|
140 /** |
|
141 * Getter for iClir. |
|
142 * |
|
143 * @since S60 v3.0. |
|
144 * @return Value for VoIP CLIR enabling rule. |
|
145 */ |
|
146 TInt Clir(); |
|
147 |
|
148 /** |
|
149 * Getter for iACBRule. |
|
150 * |
|
151 * @since S60 v3.0. |
|
152 * @return Value for anonymous call blocking rule. |
|
153 */ |
|
154 TInt ACBRule(); |
|
155 |
|
156 /** |
|
157 * Getter for iPrefTel. |
|
158 * |
|
159 * @since S60 v3.0. |
|
160 * @return Preferred telephony mode value. |
|
161 */ |
|
162 TInt PrefTel(); |
|
163 |
|
164 /** |
|
165 * Getter for iDnd. |
|
166 * |
|
167 * @since S60 v3.0. |
|
168 * @return Value for do not disturb setting. |
|
169 */ |
|
170 TInt Dnd(); |
|
171 |
|
172 /** |
|
173 * Getter for iPSCallWaiting. |
|
174 * |
|
175 * @since S60 v3.0. |
|
176 * @return Value for call waiting rule. |
|
177 */ |
|
178 TInt PSCallWaiting(); |
|
179 |
|
180 /** |
|
181 * Getter for iPrefTelLock. |
|
182 * |
|
183 * @since S60 v3.0. |
|
184 * @return Value for telephony preference lock. |
|
185 */ |
|
186 TInt PrefTelLock(); |
|
187 |
|
188 /** |
|
189 * Getter for iCsRadioWifiOff. |
|
190 * |
|
191 * @since S60 v3.0. |
|
192 * @return Value for turning CS radio off in WiFi mode. |
|
193 */ |
|
194 TInt CsRadioWifiOff(); |
|
195 |
|
196 // from base class CWPAdapter |
|
197 |
|
198 /** |
|
199 * From CWPAdapter. |
|
200 * Checks the number of settings items. |
|
201 * |
|
202 * @since S60 v3.0. |
|
203 * @return Quantity of items (always one). |
|
204 */ |
|
205 TInt ItemCount() const; |
|
206 |
|
207 /** |
|
208 * From CWPAdapter. |
|
209 * Getter for the summary title of general VoIP settings item. Text is |
|
210 * shown to the user in an opened configuration message. |
|
211 * |
|
212 * @since S60 v3.0. |
|
213 * @param aIndex Not used. |
|
214 * @return Summary title. |
|
215 */ |
|
216 const TDesC16& SummaryTitle( TInt /*aIndex*/ ) const; |
|
217 |
|
218 /** |
|
219 * From CWPAdapter. |
|
220 * Getter for the summary text of general VoIP settings. Text is shown |
|
221 * to the user in opened configuration message. |
|
222 * |
|
223 * @since S60 v3.0. |
|
224 * @param aIndex Not used. |
|
225 * @return Summary text. |
|
226 */ |
|
227 const TDesC16& SummaryText( TInt /*aIndex*/ ) const; |
|
228 |
|
229 /** |
|
230 * From CWPAdapter. |
|
231 * Saves general VoIP settings. |
|
232 * |
|
233 * @since S60 v3.0. |
|
234 * @param aIndex Not used. |
|
235 */ |
|
236 void SaveL( TInt /*aIndex*/ ); |
|
237 |
|
238 /** |
|
239 * From CWPAdapter. |
|
240 * Returns EFalse since there can only be one set of general VoIP |
|
241 * settings. |
|
242 * |
|
243 * @since S60 v3.0. |
|
244 * @param aIndex Location of the general VoIP settings item to |
|
245 * be queried. Not used. |
|
246 * @return Information whether these settings can be set as default. |
|
247 */ |
|
248 TBool CanSetAsDefault( TInt /*aIndex*/ ) const; |
|
249 |
|
250 /** |
|
251 * From CWPAdapter. |
|
252 * Adapter sets the settings as default. Not supported. |
|
253 * |
|
254 * @since S60 v3.0. |
|
255 * @param aIndex Location of the general VoIP settings item to be |
|
256 * set as default. |
|
257 */ |
|
258 void SetAsDefaultL( TInt /*aIndex*/ ) |
|
259 { |
|
260 }; |
|
261 |
|
262 /** |
|
263 * From CWPAdapter. |
|
264 * Query for detailed information about the general VoIP settings. |
|
265 * This is not supported feature as in other adapters in the framework. |
|
266 * |
|
267 * @since S60 v3.0. |
|
268 * @param aItem Not used but here because of inheritance. |
|
269 * @param aVisitor Object for retrieveing details of a setting entry. |
|
270 * @return KErrNotSupported if not supported. |
|
271 */ |
|
272 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
273 |
|
274 /** |
|
275 * From CWPAdapter. |
|
276 * Visit method. Visits the adapter. Adapter checks from |
|
277 * aCharacteristic if the data is targetet to it and acts according to |
|
278 * that. |
|
279 * |
|
280 * @since S60 v3.0. |
|
281 * @param aCharacteristic The characteristic found. |
|
282 */ |
|
283 void VisitL( CWPCharacteristic& aCharacteristic ); |
|
284 |
|
285 /** |
|
286 * From CWPAdapter. |
|
287 * Visit method. Visits the adapter. Method sets the iAppId value. |
|
288 * |
|
289 * @since S60 v3.0. |
|
290 * @param aParameter The parameter found. |
|
291 */ |
|
292 void VisitL( CWPParameter& aParameter ); |
|
293 |
|
294 /** |
|
295 * From CWPAdapter. |
|
296 * Visit method. Not supported. |
|
297 * |
|
298 * @since S60 v3.0. |
|
299 * @param aLink Link to the characteristic. |
|
300 */ |
|
301 void VisitLinkL( CWPCharacteristic& /*aLink*/ ) |
|
302 { |
|
303 }; |
|
304 |
|
305 /** |
|
306 * From CWPAdapter. |
|
307 * Informs the adapters of the saved settings. Not supported since |
|
308 * this adapter does not communicate with other adapters. |
|
309 * |
|
310 * @since S60 v3.0. |
|
311 * @param aAppIdOfSavingItem UID of the adapter component. |
|
312 * @param aAppRef APPREF of the saved settings. |
|
313 * @param aStorageIdValue Value that identifies the settings in its |
|
314 * storage. |
|
315 */ |
|
316 void SettingsSavedL ( const TDesC8& aAppIdOfSavingItem, |
|
317 const TDesC8& aAppRef, const TDesC8& aStorageIdValue ); |
|
318 |
|
319 /** |
|
320 * From CWPAdapter. |
|
321 * Lets the adapters know when the saving has been finalized in |
|
322 * viewpoint of the provisioning framework. The adapters can make |
|
323 * finalization of saving the settings after receiving this call. |
|
324 * |
|
325 * @since S60 v3.0. |
|
326 */ |
|
327 void SavingFinalizedL(); |
|
328 |
|
329 // from base class MWPContextExtension |
|
330 |
|
331 /** |
|
332 * From MWPContextExtension. |
|
333 * Returns a pointer to a context extension. |
|
334 * |
|
335 * @since S60 v3.0. |
|
336 * @param aExtension Contains a pointer to MWPContextExtension if |
|
337 * supported. |
|
338 * @return KErrNotSupported if not supported, otherwise KErrNone. |
|
339 */ |
|
340 TInt ContextExtension( MWPContextExtension*& aExtension ); |
|
341 |
|
342 /** |
|
343 * From MWPContextExtension. |
|
344 * Returns the data used for saving. |
|
345 * |
|
346 * @since S60 v3.0. |
|
347 * @param aIndex The index of the data. |
|
348 * @return The data; ownership is transferred. |
|
349 */ |
|
350 const TDesC8& SaveDataL( TInt /*aIndex*/ ) const; |
|
351 |
|
352 /** |
|
353 * From MWPContextExtension. |
|
354 * Deletes a saved settings. |
|
355 * |
|
356 * @since S60 v3.0. |
|
357 * @param aSaveData The data used for saving. |
|
358 */ |
|
359 void DeleteL( const TDesC8& aSaveData ); |
|
360 |
|
361 /** |
|
362 * From MWPContextExtension. |
|
363 * Returns the UID of the adapter. |
|
364 * |
|
365 * @since S60 v3.0. |
|
366 * @return UID of the adapter. |
|
367 */ |
|
368 TUint32 Uid() const; |
|
369 |
|
370 protected: |
|
371 |
|
372 private: |
|
373 |
|
374 CWPGeneralVoIPSettingsAdapter(); |
|
375 |
|
376 void ConstructL(); |
|
377 |
|
378 public: // Data |
|
379 |
|
380 private: // Data |
|
381 |
|
382 /** |
|
383 * Application ID of the current characteristic. |
|
384 */ |
|
385 TPtrC iAppID; |
|
386 |
|
387 /** |
|
388 * Confirms whether APPID is correct (w9033). |
|
389 */ |
|
390 TBool iIsAppIdOk; |
|
391 |
|
392 /** |
|
393 * Confirms whether iName has been correctly set. |
|
394 */ |
|
395 TBool iIsNameOk; |
|
396 |
|
397 /** |
|
398 * Title for general VoIP settings. Value read from the resource file |
|
399 * in initiation phase. |
|
400 * Own. |
|
401 */ |
|
402 HBufC16* iTitle; |
|
403 |
|
404 /** |
|
405 * Holds the ID of saved data. |
|
406 * Here because of inherited method SaveDataL. |
|
407 * Own. |
|
408 */ |
|
409 HBufC8* iSavedDataId; |
|
410 |
|
411 /** |
|
412 * Default name of general VoIP settings visible to user when viewing |
|
413 * the provisioning message. Value is read from the resource file in |
|
414 * initiation phase. |
|
415 * Own. |
|
416 */ |
|
417 HBufC* iDefaultName; |
|
418 |
|
419 /** |
|
420 * Name of general VoIP settings visible to user when viewing the |
|
421 * provisioning message. |
|
422 * Own. |
|
423 */ |
|
424 HBufC* iName; |
|
425 |
|
426 /** |
|
427 * The VoIP APPREF references by TO-APPREF of general VoIP settings. |
|
428 * Own. |
|
429 */ |
|
430 HBufC8* iToAppref; |
|
431 |
|
432 /** |
|
433 * A flag indicating whether or not correct TO-APPREF value |
|
434 * has been found. |
|
435 */ |
|
436 TBool iToApprefSet; |
|
437 |
|
438 /** |
|
439 * VoIP CLIR. Tells whether CLIR (Calling Line Identification |
|
440 * Restriction) is enabled or disabled. See w9033.txt or |
|
441 * VoIP software settings document. |
|
442 * CP parameter: CLIR. |
|
443 */ |
|
444 TInt iClir; |
|
445 |
|
446 /** |
|
447 * Anonymous Call Block rule. Determines the rule for Anonymous Call |
|
448 * Block feature. See w9033.txt or VoIP software settings document. |
|
449 * CP parameter: ACBRULE. |
|
450 */ |
|
451 TInt iACBRule; |
|
452 |
|
453 /** |
|
454 * Preferred telephony. Tells which telephony mode is preferred. |
|
455 * See w9033.txt or VoIP software settings document. |
|
456 * CP parameter: PREFTEL. |
|
457 */ |
|
458 TInt iPrefTel; |
|
459 |
|
460 /** |
|
461 * Do Not Disturb (DND) setting. See w9033.txt or VoIP software |
|
462 * settings document. |
|
463 * CP parameter: DND. |
|
464 */ |
|
465 TInt iDnd; |
|
466 |
|
467 /** |
|
468 * Call waiting. Tells whether call waiting is enabled or disabled. |
|
469 * See w9033.txt or VoIP software settings document. |
|
470 * CP parameter: PSCALLWAITING. |
|
471 */ |
|
472 TInt iPSCallWaiting; |
|
473 |
|
474 |
|
475 /** |
|
476 * Telephony preference lock. Tells whether preferred telephony mode |
|
477 * is UI editable. See w9033.txt or VoIP software settings document. |
|
478 * CP parameter: PREFTELLOCK. |
|
479 */ |
|
480 TInt iPrefTelLock; |
|
481 |
|
482 |
|
483 /** |
|
484 * Shut down CS radio in WiFi mode. Tells whether CS radio is turned |
|
485 * off in WiFi mode. See w9033.txt or VoIP software settings document. |
|
486 * CP parameter: CSRADIOWIFIOFF. |
|
487 */ |
|
488 TInt iCsRadioWifiOff; |
|
489 |
|
490 /** |
|
491 * Flag telling if feature manager has been initialized. |
|
492 */ |
|
493 TBool iFeatMgrInitialized; |
|
494 |
|
495 /** |
|
496 * VoIP ID received from cpvoipadapter in SettingsSavedL method. |
|
497 */ |
|
498 TUint32 iVoipId; |
|
499 |
|
500 }; |
|
501 |
|
502 #endif // CWPGENERALVOIPSETTINGSADAPTER_H |
|
503 |
|
504 // End of File |