|
1 /* |
|
2 * Copyright (c) 2003 - 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: Container for Network folder in GSTelPlugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "GSNetworkPluginModel.h" //for CGSModel |
|
21 #include "gssettingid.h" //for view IDs |
|
22 #include "GSNetworkPluginContainer.h" //for CGSNetworkPluginContainer |
|
23 #include "GsLogger.h" |
|
24 |
|
25 |
|
26 #include <aknlists.h> //for CAknSettingStyleListBox |
|
27 #include <aknnotewrappers.h> //for AknErrorNote |
|
28 #include <aknappui.h> //for iAvkonAppUi |
|
29 #include <StringLoader.h> //for StringLoader |
|
30 #include <gsnetworkpluginrsc.rsg> //for resource IDs |
|
31 #include <PsetContainer.h> //for CPsetContainer |
|
32 #include <PsetNetwork.h> //for CPsetNetwork |
|
33 #include <gslistbox.h> //for listbox classes |
|
34 #include <csxhelp/cp.hlp.hrh> |
|
35 #include <gsfwviewuids.h> // for KUidGS |
|
36 #include <MPsetNetworkModeObs.h> //for network mode values |
|
37 #include <gsmerror.h> //for GSM-specific error messages |
|
38 #include <featmgr.h> //Feature Manager |
|
39 #include <MPsetNetworkModeObs.h> |
|
40 #include "GSNetworkDebugHelper.h" |
|
41 |
|
42 #ifndef RD_STARTUP_CHANGE |
|
43 #include <sysstartup.h> //Startup reasons |
|
44 #else |
|
45 #include <starterclient.h> // Startup reasons |
|
46 #endif // RD_STARTUP_CHANGE |
|
47 |
|
48 |
|
49 // LOCAL CONSTANTS |
|
50 _LIT( KNameOfClass, "CGSNetworkPluginContainer" ); |
|
51 |
|
52 // ================= MEMBER FUNCTIONS ======================= |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // C++ Constructor. Needed for initializing iPlugin. |
|
56 // --------------------------------------------------------------------------- |
|
57 CGSNetworkPluginContainer::CGSNetworkPluginContainer( CGSNetworkPlugin* aPlugin ) |
|
58 :iPlugin( aPlugin ) |
|
59 { |
|
60 } |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 // Symbian OS two phased constructor with pointer to Network object |
|
65 // |
|
66 // --------------------------------------------------------------------------- |
|
67 void CGSNetworkPluginContainer::ConstructL( const TRect& aRect ) |
|
68 { |
|
69 iListBox = new ( ELeave ) CAknSettingStyleListBox; |
|
70 |
|
71 //model construction |
|
72 iModel = CGSNetworkPluginModel::NewL( this, iPlugin ); |
|
73 |
|
74 BaseConstructL( aRect, |
|
75 R_GS_NET_VIEW_TITLE, |
|
76 R_NET_LBX ); |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 // Destructor |
|
82 // |
|
83 // --------------------------------------------------------------------------- |
|
84 CGSNetworkPluginContainer::~CGSNetworkPluginContainer() |
|
85 { |
|
86 if ( iListboxItemArray ) |
|
87 { |
|
88 delete iListboxItemArray; |
|
89 iListboxItemArray = NULL; |
|
90 } |
|
91 |
|
92 if( iModel ) |
|
93 { |
|
94 delete iModel; |
|
95 iModel = NULL; |
|
96 } |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // |
|
101 // Creates list box |
|
102 // |
|
103 // --------------------------------------------------------------------------- |
|
104 void CGSNetworkPluginContainer::ConstructListBoxL( TInt aResLbxId ) |
|
105 { |
|
106 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::ConstructListBoxL"); |
|
107 iListBox->ConstructL( this, EAknListBoxSelectionList ); |
|
108 iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, |
|
109 *iListBox, *iCoeEnv ); |
|
110 iListBox->Model()->SetItemTextArray( iListboxItemArray ); |
|
111 iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
112 |
|
113 CreateListBoxItemsL(); |
|
114 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::ConstructListBoxL"); |
|
115 } |
|
116 |
|
117 // --------------------------------------------------------------------------- |
|
118 // |
|
119 // Creates list box items |
|
120 // |
|
121 // --------------------------------------------------------------------------- |
|
122 void CGSNetworkPluginContainer::CreateListBoxItemsL() |
|
123 { |
|
124 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::CreateListBoxItemsL"); |
|
125 // do not get check CSP if not using WINS |
|
126 #ifndef __WINS__ |
|
127 //Set CSP on, if it is not already |
|
128 if ( !iModel->GetCSPStatus() ) |
|
129 { |
|
130 iModel->SetCSPActiveL( ETrue ); |
|
131 } |
|
132 #endif |
|
133 |
|
134 if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) ) |
|
135 { |
|
136 if ( iModel->IsNetworkModeVisible() ) |
|
137 { |
|
138 MakeNwModeUiItemL(); |
|
139 } |
|
140 } |
|
141 |
|
142 MakeNwItemL(); |
|
143 MakeMcnItemL(); |
|
144 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::CreateListBoxItemsL"); |
|
145 } |
|
146 |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 // Updates changed list box item |
|
150 // |
|
151 // --------------------------------------------------------------------------- |
|
152 void CGSNetworkPluginContainer::UpdateListBoxL( TInt aFeatureId, TInt aValue ) |
|
153 { |
|
154 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::UpdateListBoxL"); |
|
155 switch ( aFeatureId ) |
|
156 { |
|
157 case EGSNetworkModeItemId: |
|
158 if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) ) |
|
159 { |
|
160 if ( iModel->IsNetworkModeVisible() ) |
|
161 { |
|
162 MakeNwModeUiItemL(); |
|
163 } |
|
164 } |
|
165 break; |
|
166 case EGSNetworkModeSelectionItemId: |
|
167 MakeNwItemL( aValue ); |
|
168 break; |
|
169 case EGSMCNItemId: |
|
170 MakeMcnItemL(); |
|
171 break; |
|
172 default: |
|
173 Panic( KNameOfClass, EInvalidIndex ); |
|
174 break; |
|
175 } |
|
176 iListBox->HandleItemAdditionL(); |
|
177 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::UpdateListBoxL"); |
|
178 } |
|
179 |
|
180 // --------------------------------------------------------------------------- |
|
181 // |
|
182 // Creates new Network list box item |
|
183 // |
|
184 // --------------------------------------------------------------------------- |
|
185 void CGSNetworkPluginContainer::MakeNwItemL( TInt aValue ) |
|
186 { |
|
187 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeNwItemL"); |
|
188 HBufC* dynamicText = NULL; |
|
189 TInt currentValue = KErrNone; |
|
190 |
|
191 if ( aValue != KErrNotFound ) |
|
192 { |
|
193 currentValue = aValue; |
|
194 } |
|
195 else |
|
196 { |
|
197 //use bogus values for WINS to avoid jamming the emulator |
|
198 #ifdef __WINS__ |
|
199 currentValue = EGSManualSelectMode; |
|
200 #else |
|
201 currentValue = GetSelectionMode(); |
|
202 #endif // __WINS__ |
|
203 } |
|
204 |
|
205 TUint32 resourceId = R_NETSL_NETSELECTMODE_LBX; |
|
206 TInt featureId = EGSAutomaticSelectMode; |
|
207 |
|
208 if ( currentValue == EGSManualSelectMode ) |
|
209 { |
|
210 featureId = EGSManualSelectMode; |
|
211 } |
|
212 |
|
213 dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( |
|
214 resourceId, |
|
215 featureId, |
|
216 *iCoeEnv ); |
|
217 |
|
218 #ifndef __WINS__ |
|
219 //Create network mode setting item |
|
220 if ( iModel->IsSettingSupported( EGSCSPManualNetworkSelection ) ) |
|
221 { |
|
222 #endif |
|
223 // Finally, set the dynamic text |
|
224 iListboxItemArray->SetDynamicTextL( EGSNetworkModeSelectionItemId, |
|
225 *dynamicText ); |
|
226 |
|
227 // And add to listbox |
|
228 iListboxItemArray->SetItemVisibilityL( EGSNetworkModeSelectionItemId, |
|
229 CGSListBoxItemTextArray::EVisible ); |
|
230 |
|
231 #ifndef __WINS__ |
|
232 } |
|
233 else |
|
234 { |
|
235 // Set the item to invisible if manual network |
|
236 // selection is not supported. |
|
237 iListboxItemArray->SetItemVisibilityL( EGSNetworkModeSelectionItemId, |
|
238 CGSListBoxItemTextArray::EInvisible ); |
|
239 } |
|
240 #endif |
|
241 |
|
242 CleanupStack::PopAndDestroy( dynamicText ); |
|
243 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeNwItemL"); |
|
244 } |
|
245 |
|
246 // --------------------------------------------------------------------------- |
|
247 // |
|
248 // Gets the currently active selection mode. |
|
249 // |
|
250 // --------------------------------------------------------------------------- |
|
251 TInt CGSNetworkPluginContainer::GetSelectionMode() |
|
252 { |
|
253 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::GetSelectionMode"); |
|
254 MPsetNetworkSelect::TSelectMode mode = |
|
255 iModel->GetNetworkSelectionMode(); |
|
256 |
|
257 if ( mode == MPsetNetworkSelect::ENetSelectModeManual ) |
|
258 { |
|
259 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::GetSelectionMode"); |
|
260 return EGSManualSelectMode; |
|
261 } |
|
262 else |
|
263 { |
|
264 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::GetSelectionMode"); |
|
265 return EGSAutomaticSelectMode; |
|
266 } |
|
267 } |
|
268 |
|
269 // --------------------------------------------------------------------------- |
|
270 // |
|
271 // Creates new MCN list box item |
|
272 // |
|
273 // --------------------------------------------------------------------------- |
|
274 void CGSNetworkPluginContainer::MakeMcnItemL() |
|
275 { |
|
276 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeMcnItemL"); |
|
277 HBufC* dynamicText = NULL; |
|
278 TInt readValue = 0; |
|
279 |
|
280 GetMcnValue( readValue ); |
|
281 TUint32 resourceId = R_MCN_CELL_INFO_DISP_MODE_LBX; |
|
282 TInt featureId = EGSMcnSetOn; |
|
283 |
|
284 switch ( readValue ) //resource manipulation |
|
285 { |
|
286 case 0: // Off should be displayed in UI |
|
287 featureId = EGSMcnSetOff; |
|
288 break; |
|
289 case 1: // On should be displayed in UI |
|
290 featureId = EGSMcnSetOn; |
|
291 break; |
|
292 default: |
|
293 break; |
|
294 } |
|
295 |
|
296 dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( |
|
297 resourceId, |
|
298 featureId, |
|
299 *iCoeEnv ); |
|
300 |
|
301 // Finally, set the dynamic text |
|
302 iListboxItemArray->SetDynamicTextL( EGSMCNItemId, *dynamicText ); |
|
303 |
|
304 // And add to listbox |
|
305 iListboxItemArray->SetItemVisibilityL( EGSMCNItemId, |
|
306 CGSListBoxItemTextArray::EVisible ); |
|
307 |
|
308 CleanupStack::PopAndDestroy( dynamicText ); |
|
309 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeMcnItemL"); |
|
310 } |
|
311 |
|
312 // --------------------------------------------------------------------------- |
|
313 // |
|
314 // Gets MCN value from model. |
|
315 // |
|
316 // --------------------------------------------------------------------------- |
|
317 // |
|
318 void CGSNetworkPluginContainer::GetMcnValue( TInt &aMcnValue ) |
|
319 { |
|
320 iModel->GetMCNSettingValue( aMcnValue ); |
|
321 } |
|
322 |
|
323 // --------------------------------------------------------------------------- |
|
324 // |
|
325 // Sets MCN value from model. |
|
326 // |
|
327 // --------------------------------------------------------------------------- |
|
328 // |
|
329 void CGSNetworkPluginContainer::SetMcnValue( TInt &aMcnValue ) |
|
330 { |
|
331 iModel->SetMCNSettingValue( aMcnValue ); |
|
332 } |
|
333 |
|
334 |
|
335 // --------------------------------------------------------------------------- |
|
336 // |
|
337 // Creates network mode ui list box item |
|
338 // |
|
339 // --------------------------------------------------------------------------- |
|
340 void CGSNetworkPluginContainer::MakeNwModeUiItemL() |
|
341 { |
|
342 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::MakeNwModeUiItemL"); |
|
343 HBufC* dynamicText = NULL; |
|
344 |
|
345 // In here KGSNetworkModeCapsNotUpdated means mode is not updated yet |
|
346 if( iModel->GetNetworkMode() != KGSNetworkModeCapsNotUpdated ) |
|
347 { |
|
348 // Allocate value to dynamicText from the resource item |
|
349 TUint32 resourceId= R_NET_NETWORK_MODE_LBX; |
|
350 dynamicText = CGSItemTextArray::GetItemCaptionFromFeatureIdLC( |
|
351 resourceId, GetCurrentNetworkModeSelectionL(), *iCoeEnv ); |
|
352 } |
|
353 else |
|
354 { |
|
355 _LIT( KEmpty, " "); |
|
356 dynamicText = KEmpty().AllocLC ( ); |
|
357 } |
|
358 |
|
359 // Finally, set the dynamic text |
|
360 iListboxItemArray->SetDynamicTextL( EGSNetworkModeItemId, *dynamicText ); |
|
361 |
|
362 // And add to listbox |
|
363 iListboxItemArray->SetItemVisibilityL( EGSNetworkModeItemId, |
|
364 CGSListBoxItemTextArray::EVisible ); |
|
365 |
|
366 // this variable needs to be removed from cleanup stack |
|
367 CleanupStack::PopAndDestroy( dynamicText ); |
|
368 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::MakeNwModeUiItemL"); |
|
369 } |
|
370 |
|
371 |
|
372 // --------------------------------------------------------------------------- |
|
373 // CGSNetworkPluginContainer::CheckAndAlterContentsL |
|
374 // |
|
375 // Trims non-supported variable options from the array. |
|
376 // This array items are displayed as radio button setting page items |
|
377 // --------------------------------------------------------------------------- |
|
378 // |
|
379 void CGSNetworkPluginContainer::CheckAndAlterContentsL( |
|
380 CGSRadioButtonSettingPageItemTextArray& aItemArray ) |
|
381 { |
|
382 __GSLOGSTRING("[GS]--> CGSNetworkPluginContainer::CheckAndAlterContentsL"); |
|
383 TInt value = 0; |
|
384 TInt supportedNetworks = iModel->GetSupportedNetworksL(); |
|
385 __GSLOGSTRING1("[GS] CheckAndAlterContentsL: supportedNetworks: %d", supportedNetworks); |
|
386 |
|
387 // The 0th item corresponds to DualMode. This is always available in the |
|
388 // setting page, so no actions required, just make it visible. |
|
389 aItemArray.SetItemVisibilityL( EGSNetworkModeDualmode, |
|
390 CGSListBoxItemTextArray::EVisible ); |
|
391 |
|
392 // the first bit corresponds to UMTS |
|
393 value = supportedNetworks & ENetFirstBit; |
|
394 __GSLOGSTRING1("[GS] CheckAndAlterContentsL: (UMTS)value: %d", value); |
|
395 |
|
396 if ( value == EGSNetworkModeUMTS ) |
|
397 { |
|
398 aItemArray.SetItemVisibilityL( EGSNetworkModeUMTS, |
|
399 CGSListBoxItemTextArray::EVisible ); |
|
400 } |
|
401 else |
|
402 { |
|
403 aItemArray.SetItemVisibilityL( EGSNetworkModeUMTS, |
|
404 CGSListBoxItemTextArray::EInvisible ); |
|
405 } |
|
406 |
|
407 // Get the zeroeth value (GSM) from the list |
|
408 value = supportedNetworks & ENetSecondBit; |
|
409 __GSLOGSTRING1("[GS] CheckAndAlterContentsL: (GSM)value: %d", value); |
|
410 |
|
411 if ( value == EGSNetworkModeGSM ) |
|
412 { |
|
413 aItemArray.SetItemVisibilityL( EGSNetworkModeGSM, |
|
414 CGSListBoxItemTextArray::EVisible ); |
|
415 } |
|
416 else |
|
417 { |
|
418 aItemArray.SetItemVisibilityL( EGSNetworkModeGSM, |
|
419 CGSListBoxItemTextArray::EInvisible ); |
|
420 } |
|
421 |
|
422 __GSLOGSTRING("[GS] <--CGSNetworkPluginContainer::CheckAndAlterContentsL"); |
|
423 } |
|
424 |
|
425 // --------------------------------------------------------------------------- |
|
426 // CGSNetworkPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const |
|
427 // Gets Help |
|
428 // |
|
429 // --------------------------------------------------------------------------- |
|
430 // |
|
431 void CGSNetworkPluginContainer::GetHelpContext(TCoeHelpContext& aContext) const |
|
432 { |
|
433 aContext.iMajor = KUidGS; |
|
434 aContext.iContext = KCP_HLP_NETWORK; |
|
435 } |
|
436 |
|
437 // --------------------------------------------------------------------------- |
|
438 // CGSSettListCallContainer::CurrentFeatureId() |
|
439 // |
|
440 // --------------------------------------------------------------------------- |
|
441 // |
|
442 TInt CGSNetworkPluginContainer::CurrentFeatureId( ) const |
|
443 { |
|
444 return iListboxItemArray->CurrentFeature( ); |
|
445 } |
|
446 |
|
447 |
|
448 void CGSNetworkPluginContainer::HandleNetworkModeChangeL() |
|
449 { |
|
450 UpdateListBoxL( EGSNetworkModeItemId, GetCurrentNetworkModeSelectionL() ); |
|
451 |
|
452 //updating value |
|
453 CGSRadioButtonSettingPageItemTextArray* nwModeArray = |
|
454 CGSRadioButtonSettingPageItemTextArray::NewL( |
|
455 R_NET_NETWORK_MODE_LBX, |
|
456 *iCoeEnv, |
|
457 NULL ); |
|
458 // For showing updated network mode value??? |
|
459 CleanupStack::PushL( nwModeArray ); |
|
460 CheckAndAlterContentsL( *nwModeArray ); |
|
461 TInt currentIndex = nwModeArray->IndexForFeatureIdL( |
|
462 GetCurrentNetworkModeSelectionL() ); |
|
463 HBufC* buf = StringLoader::LoadL( |
|
464 R_CONFIRM_NOTE_NWMODE_STRING, |
|
465 nwModeArray->MdcaPoint( currentIndex ), |
|
466 iEikonEnv ); |
|
467 CleanupStack::PushL( buf ); |
|
468 CAknConfirmationNote* note = new( ELeave ) CAknConfirmationNote( ETrue ); |
|
469 note->ExecuteLD( *buf ); |
|
470 CleanupStack::PopAndDestroy( buf ); |
|
471 CleanupStack::PopAndDestroy( nwModeArray ); |
|
472 } |
|
473 |
|
474 |
|
475 // --------------------------------------------------------------------------- |
|
476 // CGSNetworkPluginContainer::TelPluginModel |
|
477 // |
|
478 // Return the model pointer for use in view class |
|
479 // --------------------------------------------------------------------------- |
|
480 // |
|
481 CGSNetworkPluginModel* CGSNetworkPluginContainer::NetPluginModel() |
|
482 { |
|
483 return iModel; |
|
484 } |
|
485 |
|
486 // --------------------------------------------------------------------------- |
|
487 // Sets observer for MSK label updations. |
|
488 // --------------------------------------------------------------------------- |
|
489 // |
|
490 void CGSNetworkPluginContainer::SetMiddleSoftkeyObserver( |
|
491 MGsFWMSKObserver* aObserver ) |
|
492 { |
|
493 if ( !iMSKObserver && aObserver ) |
|
494 { |
|
495 iMSKObserver = aObserver; |
|
496 } |
|
497 } |
|
498 |
|
499 // --------------------------------------------------------------------------- |
|
500 // CGSNetworkPluginContainer::OfferKeyEventL |
|
501 // Called when a key is pressed. |
|
502 // --------------------------------------------------------------------------- |
|
503 TKeyResponse CGSNetworkPluginContainer::OfferKeyEventL( |
|
504 const TKeyEvent& aKeyEvent, |
|
505 TEventCode aType ) |
|
506 { |
|
507 switch ( aKeyEvent.iCode ) |
|
508 { |
|
509 case EKeyUpArrow: |
|
510 case EKeyDownArrow: |
|
511 { |
|
512 TKeyResponse listboxResp = |
|
513 iListBox->OfferKeyEventL( aKeyEvent, aType ); |
|
514 if ( iMSKObserver ) |
|
515 { |
|
516 iMSKObserver->CheckMiddleSoftkeyLabelL(); |
|
517 } |
|
518 return listboxResp; |
|
519 } |
|
520 case EKeyLeftArrow: |
|
521 case EKeyRightArrow: |
|
522 // Listbox takes all events even if it doesn't use them |
|
523 return EKeyWasNotConsumed; |
|
524 default: |
|
525 break; |
|
526 } |
|
527 |
|
528 return iListBox->OfferKeyEventL( aKeyEvent, aType ); |
|
529 } |
|
530 |
|
531 |
|
532 // --------------------------------------------------------------------------- |
|
533 // CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL |
|
534 // |
|
535 // Returns the current listbox selection of network mode. |
|
536 // --------------------------------------------------------------------------- |
|
537 // |
|
538 TGSNetworkModeItems CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL() |
|
539 { |
|
540 TGSNetworkModeItems featureId = EGSNetworkModeDualmode; |
|
541 |
|
542 switch( iModel->GetNetworkMode() ) |
|
543 { |
|
544 case RMmCustomAPI::KCapsNetworkModeGsm: |
|
545 featureId = EGSNetworkModeGSM; |
|
546 break; |
|
547 |
|
548 case RMmCustomAPI::KCapsNetworkModeUmts: |
|
549 featureId = EGSNetworkModeUMTS; |
|
550 break; |
|
551 |
|
552 case RMmCustomAPI::KCapsNetworkModeDual: |
|
553 featureId = EGSNetworkModeDualmode; |
|
554 break; |
|
555 default: |
|
556 // Mode might not be updated yet, in which case default is dual. |
|
557 // Not a perfect solution but have to have an item selected in |
|
558 // options box |
|
559 featureId = EGSNetworkModeDualmode; |
|
560 break; |
|
561 } |
|
562 |
|
563 #ifdef _DEBUG |
|
564 TBuf<KGSNetworkModeDebugStrLen> selectedModeBuf; |
|
565 GSNetworkDebugHelper::NwToDes( featureId, selectedModeBuf ); |
|
566 __GSLOGSTRING1( "[CGSNetworkPluginContainer::GetCurrentNetworkModeSelectionL] %S ", |
|
567 &selectedModeBuf ); |
|
568 #endif // _DEBUG |
|
569 |
|
570 iModel->CheckState( featureId ); |
|
571 return featureId; |
|
572 } |
|
573 |
|
574 |
|
575 // --------------------------------------------------------------------------- |
|
576 // CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL |
|
577 // |
|
578 // |
|
579 // --------------------------------------------------------------------------- |
|
580 // |
|
581 void CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL( |
|
582 TGSNetworkModeItems aNetworkModeLbxItem ) |
|
583 { |
|
584 __GSLOGSTRING1( "[CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL] Mode:%d", aNetworkModeLbxItem ); |
|
585 TUint32 networkMode; |
|
586 switch ( aNetworkModeLbxItem ) |
|
587 { |
|
588 case EGSNetworkModeGSM: //just using the index |
|
589 networkMode = RMmCustomAPI::KCapsNetworkModeGsm; |
|
590 break; |
|
591 case EGSNetworkModeUMTS: |
|
592 networkMode = RMmCustomAPI::KCapsNetworkModeUmts; |
|
593 break; |
|
594 case EGSNetworkModeDualmode: |
|
595 default: |
|
596 networkMode = RMmCustomAPI::KCapsNetworkModeDual; |
|
597 break; |
|
598 } |
|
599 // Don't change the network mode if there is ongoing phone call |
|
600 // since this will disconnect it |
|
601 if ( !iModel->IsCallActive() ) |
|
602 { |
|
603 iModel->SetNetworkModeL( networkMode ); |
|
604 iSelectedNetworkModeLbxItem = aNetworkModeLbxItem; |
|
605 } |
|
606 __GSLOGSTRING( "[CGSNetworkPluginContainer::SetCurrentNetworkModeSelectionL] End]" ); |
|
607 } |
|
608 |
|
609 |
|
610 |
|
611 //End of File |