24 #include <spdefinitions.h> |
24 #include <spdefinitions.h> |
25 #include <cscsettingsui.rsg> |
25 #include <cscsettingsui.rsg> |
26 #include <aknlistquerydialog.h> |
26 #include <aknlistquerydialog.h> |
27 #include <cvimpstsettingsstore.h> |
27 #include <cvimpstsettingsstore.h> |
28 #include <csxhelp/voip.hlp.hrh> |
28 #include <csxhelp/voip.hlp.hrh> |
|
29 #include <csc.rsg> |
|
30 #include <aknnotedialog.h> |
29 |
31 |
30 #include "cscconstants.h" |
32 #include "cscconstants.h" |
31 #include "cscsettingsui.hrh" |
33 #include "cscsettingsui.hrh" |
32 #include "cscsettingsuimodel.h" |
34 #include "cscsettingsuimodel.h" |
33 #include "cscsettingsuilogger.h" |
35 #include "cscsettingsuilogger.h" |
34 #include "cscengservicehandler.h" |
36 #include "cscengservicehandler.h" |
35 #include "cscsettingsuiconstants.h" |
37 #include "cscsettingsuiconstants.h" |
36 #include "cscengdestinationshandler.h" |
38 #include "cscengdestinationshandler.h" |
37 #include "cipapputilsaddressresolver.h" |
39 #include "cipapputilsaddressresolver.h" |
38 #include "cscsettingsuimaincontainer.h" |
40 #include "cscsettingsuimaincontainer.h" |
|
41 #include "cscengservicepluginhandler.h" |
|
42 #include "cscnoteutilities.h" |
|
43 #include "cscengsettingscleanupplugininterface.h" |
39 |
44 |
40 // Format of the setting item. |
45 // Format of the setting item. |
41 _LIT( KCSCSettingsUiListItemTextFormat, "\t%S\t\t%S" ); |
46 _LIT( KCSCSettingsUiListItemTextFormat, "\t%S\t\t%S" ); |
42 |
47 |
43 _LIT( KDoubleBackSlash, "\\" ); |
48 _LIT( KDoubleBackSlash, "\\" ); |
101 // --------------------------------------------------------------------------- |
106 // --------------------------------------------------------------------------- |
102 // |
107 // |
103 void CCSCSettingsUiMainContainer::UpdateContainerL() |
108 void CCSCSettingsUiMainContainer::UpdateContainerL() |
104 { |
109 { |
105 CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::UpdateContainerL - begin" ); |
110 CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::UpdateContainerL - begin" ); |
106 |
111 |
107 // Get listbox items from model. |
112 // Get listbox items from model. |
108 CTextListBoxModel* model = iListBox->Model(); |
113 CTextListBoxModel* model = iListBox->Model(); |
109 MDesCArray* textArray = model->ItemTextArray(); |
114 MDesCArray* textArray = model->ItemTextArray(); |
110 CDesCArray* listBoxItems = static_cast<CDesCArray*>( textArray ); |
115 CDesCArray* listBoxItems = static_cast<CDesCArray*>( textArray ); |
111 listBoxItems->Reset(); |
116 listBoxItems->Reset(); |
112 iListBoxItemArray.Reset(); |
117 iListBoxItemArray.Reset(); |
113 |
118 |
114 // Initialize setting items. |
119 // Initialize setting items. |
115 InitializeSettingItemsL(); |
120 InitializeSettingItemsL(); |
116 |
121 |
117 CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::UpdateContainerL - end" ); |
122 CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::UpdateContainerL - end" ); |
118 } |
123 } |
119 |
124 |
120 // --------------------------------------------------------------------------- |
125 // --------------------------------------------------------------------------- |
121 // CCSCSettingsUiMainContainer::HandoverNotificationToneQueryL |
126 // CCSCSettingsUiMainContainer::HandoverNotificationToneQueryL |
124 // |
129 // |
125 void CCSCSettingsUiMainContainer::HandoverNotificationToneQueryL() |
130 void CCSCSettingsUiMainContainer::HandoverNotificationToneQueryL() |
126 { |
131 { |
127 CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( 2 ); |
132 CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( 2 ); |
128 CleanupStack::PushL( items ); |
133 CleanupStack::PushL( items ); |
129 |
134 |
130 HBufC* onItem = StringLoader::LoadLC( |
135 HBufC* onItem = StringLoader::LoadLC( |
131 R_CSCSETTINGSUI_SETTING_HANDOVER_NOTIF_TONE_ON ); |
136 R_CSCSETTINGSUI_SETTING_HANDOVER_NOTIF_TONE_ON ); |
132 items->AppendL( *onItem ); |
137 items->AppendL( *onItem ); |
133 CleanupStack::PopAndDestroy( onItem ); |
138 CleanupStack::PopAndDestroy( onItem ); |
134 |
139 |
135 HBufC* offItem = StringLoader::LoadLC( |
140 HBufC* offItem = StringLoader::LoadLC( |
136 R_CSCSETTINGSUI_SETTING_HANDOVER_NOTIF_TONE_OFF ); |
141 R_CSCSETTINGSUI_SETTING_HANDOVER_NOTIF_TONE_OFF ); |
137 items->AppendL( *offItem ); |
142 items->AppendL( *offItem ); |
138 CleanupStack::PopAndDestroy( offItem ); |
143 CleanupStack::PopAndDestroy( offItem ); |
139 |
144 |
140 TInt index( 0 ); |
145 TInt index( 0 ); |
141 CAknListQueryDialog* dialog = |
146 CAknListQueryDialog* dialog = |
142 new ( ELeave ) CAknListQueryDialog( &index ); |
147 new ( ELeave ) CAknListQueryDialog( &index ); |
143 |
148 |
144 dialog->PrepareLC( R_CSCSETTINGSUI_HANDOVER_NOTIFICATION_TONE_QUERY ); |
149 dialog->PrepareLC( R_CSCSETTINGSUI_HANDOVER_NOTIFICATION_TONE_QUERY ); |
145 dialog->SetItemTextArray( items ); |
150 dialog->SetItemTextArray( items ); |
146 dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
151 dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
147 |
152 |
148 if ( dialog->RunLD() ) |
153 if ( dialog->RunLD() ) |
149 { |
154 { |
150 // Update setting according user selection |
155 // Update setting according user selection |
151 if ( 0 == index ) |
156 if ( 0 == index ) |
152 { |
157 { |
182 // |
187 // |
183 void CCSCSettingsUiMainContainer::PresenceReqPrefQueryL() |
188 void CCSCSettingsUiMainContainer::PresenceReqPrefQueryL() |
184 { |
189 { |
185 CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( 2 ); |
190 CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( 2 ); |
186 CleanupStack::PushL( items ); |
191 CleanupStack::PushL( items ); |
187 |
192 |
188 HBufC* alwaysAskItem = StringLoader::LoadLC( |
193 HBufC* alwaysAskItem = StringLoader::LoadLC( |
189 R_CSCSETTINGSUI_PRES_PREF_ALWAYS_ASK ); |
194 R_CSCSETTINGSUI_PRES_PREF_ALWAYS_ASK ); |
190 items->AppendL( *alwaysAskItem ); |
195 items->AppendL( *alwaysAskItem ); |
191 CleanupStack::PopAndDestroy( alwaysAskItem ); |
196 CleanupStack::PopAndDestroy( alwaysAskItem ); |
192 |
197 |
193 HBufC* autoAcceptItem = StringLoader::LoadLC( |
198 HBufC* autoAcceptItem = StringLoader::LoadLC( |
194 R_CSCSETTINGSUI_PRES_PREF_ACCEPT_AUTOMATICALLY ); |
199 R_CSCSETTINGSUI_PRES_PREF_ACCEPT_AUTOMATICALLY ); |
195 items->AppendL( *autoAcceptItem ); |
200 items->AppendL( *autoAcceptItem ); |
196 CleanupStack::PopAndDestroy( autoAcceptItem ); |
201 CleanupStack::PopAndDestroy( autoAcceptItem ); |
197 |
202 |
198 TInt index( 0 ); |
203 TInt index( 0 ); |
199 CAknListQueryDialog* dialog = |
204 CAknListQueryDialog* dialog = |
200 new ( ELeave ) CAknListQueryDialog( &index ); |
205 new ( ELeave ) CAknListQueryDialog( &index ); |
201 |
206 |
202 dialog->PrepareLC( R_CSCSETTINGSUI_PRESENCE_REQUEST_PREF_QUERY ); |
207 dialog->PrepareLC( R_CSCSETTINGSUI_PRESENCE_REQUEST_PREF_QUERY ); |
203 dialog->SetItemTextArray( items ); |
208 dialog->SetItemTextArray( items ); |
204 dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
209 dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
205 |
210 |
206 if ( dialog->RunLD() ) |
211 if ( dialog->RunLD() ) |
207 { |
212 { |
208 // Update setting according user selection |
213 // Update setting according user selection |
209 if ( 0 == index ) |
214 if ( 0 == index ) |
210 { |
215 { |
268 { |
272 { |
269 TInt currentItemIndex( iListBox->CurrentItemIndex() ); |
273 TInt currentItemIndex( iListBox->CurrentItemIndex() ); |
270 return iListBoxItemArray[ currentItemIndex ]; |
274 return iListBoxItemArray[ currentItemIndex ]; |
271 } |
275 } |
272 |
276 |
273 |
|
274 // --------------------------------------------------------------------------- |
277 // --------------------------------------------------------------------------- |
275 // From class CoeControl |
278 // From class CoeControl |
276 // CCSCSettingsUiMainContainer::ComponentControl |
279 // CCSCSettingsUiMainContainer::ComponentControl |
277 // --------------------------------------------------------------------------- |
280 // --------------------------------------------------------------------------- |
278 // |
281 // |
279 CCoeControl* CCSCSettingsUiMainContainer::ComponentControl( |
282 CCoeControl* CCSCSettingsUiMainContainer::ComponentControl( |
280 TInt /*aIndex*/ ) const |
283 TInt /*aIndex*/ ) const |
281 { |
284 { |
282 return iListBox; |
285 return iListBox; |
283 } |
286 } |
284 |
|
285 |
287 |
286 // ----------------------------------------------------------------------------- |
288 // ----------------------------------------------------------------------------- |
287 // From class CoeControl |
289 // From class CoeControl |
288 // For getting help context |
290 // For getting help context |
289 // ----------------------------------------------------------------------------- |
291 // ----------------------------------------------------------------------------- |
372 // |
374 // |
373 void CCSCSettingsUiMainContainer::InitializeSettingItemsL() |
375 void CCSCSettingsUiMainContainer::InitializeSettingItemsL() |
374 { |
376 { |
375 CSCSETUIDEBUG( |
377 CSCSETUIDEBUG( |
376 "CCSCSettingsUiMainContainer::InitializeSettingItemsL - begin" ); |
378 "CCSCSettingsUiMainContainer::InitializeSettingItemsL - begin" ); |
377 |
379 |
378 // Get supported subservices |
380 // Get supported subservices |
379 TSupportedSubServices supSubServices; |
381 TSupportedSubServices supSubServices; |
380 iModel.CCHHandler().SupportedSubServicesL( |
382 iModel.CCHHandler().SupportedSubServicesL( |
381 iModel.CurrentSPEntryId(), supSubServices ); |
383 iModel.CurrentSPEntryId(), supSubServices ); |
382 |
384 |
383 // Make username setting |
385 // Make username setting |
384 MakeSettingItemL ( TMainListBoxItem::EUsername ); |
386 MakeSettingItemL ( TMainListBoxItem::EUsername ); |
385 |
387 |
386 // Make password setting |
388 // Make password setting |
387 MakeSettingItemL ( TMainListBoxItem::EPassword ); |
389 MakeSettingItemL ( TMainListBoxItem::EPassword ); |
388 |
390 |
389 // Make preferred service setting item if voip subservice is supported |
391 // Make preferred service setting item if voip subservice is supported |
390 if ( supSubServices.iVoIP ) |
392 if ( supSubServices.iVoIP ) |
408 // If VCC is not supported make just preferred service setting |
410 // If VCC is not supported make just preferred service setting |
409 MakeSettingItemL ( TMainListBoxItem::EPreferredService ); |
411 MakeSettingItemL ( TMainListBoxItem::EPreferredService ); |
410 } |
412 } |
411 } |
413 } |
412 } |
414 } |
413 |
415 |
414 // Make setting item if IM is supported by service |
416 // Make setting item if IM is supported by service |
415 if ( supSubServices.iIm ) |
417 if ( supSubServices.iIm ) |
416 { |
418 { |
417 // IM tone setting. |
419 // IM tone setting. |
418 MakeSettingItemL( TMainListBoxItem::EImTone ); |
420 MakeSettingItemL( TMainListBoxItem::EImTone ); |
419 } |
421 } |
420 |
422 |
421 // Make setting item if presence is supported by service |
423 // Make setting item if presence is supported by service |
422 if ( supSubServices.iPresence ) |
424 if ( supSubServices.iPresence ) |
423 { |
425 { |
424 // Presence request preference |
426 // Presence request preference |
425 MakeSettingItemL( TMainListBoxItem::EAutoacceptInv ); |
427 MakeSettingItemL( TMainListBoxItem::EAutoacceptInv ); |
426 } |
428 } |
427 |
429 |
428 // Connectivity setting (cannot be changed) |
430 // Connectivity setting (cannot be changed) |
429 MakeSettingItemL( TMainListBoxItem::EServiceConn ); |
431 MakeSettingItemL( TMainListBoxItem::EServiceConn ); |
430 |
432 |
431 |
|
432 CSCSETUIDEBUG( |
433 CSCSETUIDEBUG( |
433 "CCSCSettingsUiMainContainer::InitializeSettingItemsL - end" ); |
434 "CCSCSettingsUiMainContainer::InitializeSettingItemsL - end" ); |
434 } |
435 } |
435 |
436 |
436 |
|
437 // --------------------------------------------------------------------------- |
437 // --------------------------------------------------------------------------- |
438 // CCSCSettingsUiMainContainer::MakeSettingItemL |
438 // CCSCSettingsUiMainContainer::MakeSettingItemL |
439 // Constructs setting list items. |
439 // Constructs setting list items. |
440 // --------------------------------------------------------------------------- |
440 // --------------------------------------------------------------------------- |
441 // |
441 // |
442 void CCSCSettingsUiMainContainer::MakeSettingItemL( |
442 void CCSCSettingsUiMainContainer::MakeSettingItemL( |
443 TMainListBoxItem::TSettingItems aItem ) |
443 TMainListBoxItem::TSettingItems aItem ) |
444 { |
444 { |
445 CSCSETUIDEBUG( |
445 CSCSETUIDEBUG( |
446 "CCSCSettingsUiMainContainer::MakeSettingItemL - begin" ); |
446 "CCSCSettingsUiMainContainer::MakeSettingItemL - begin" ); |
447 |
447 |
448 // Get listbox items from model. |
448 // Get listbox items from model. |
449 CTextListBoxModel* model = iListBox->Model(); |
449 CTextListBoxModel* model = iListBox->Model(); |
450 MDesCArray* textArray = model->ItemTextArray(); |
450 MDesCArray* textArray = model->ItemTextArray(); |
451 CDesCArray* listBoxItems = static_cast<CDesCArray*>( textArray ); |
451 CDesCArray* listBoxItems = static_cast<CDesCArray*>( textArray ); |
452 |
452 |
453 TBuf<KCSCSettingsUiItemLength> listBoxItemText ( KNullDesC ); |
453 TBuf<KCSCSettingsUiItemLength> listBoxItemText ( KNullDesC ); |
454 |
454 |
455 TMainListBoxItem listBoxItem; |
455 TMainListBoxItem listBoxItem; |
456 listBoxItem.iItem = aItem; |
456 listBoxItem.iItem = aItem; |
457 |
457 |
458 RBuf value; |
458 RBuf value; |
459 CleanupClosePushL( value ); |
459 CleanupClosePushL( value ); |
460 |
460 |
461 value.CreateL( 1 ); |
461 value.CreateL( 1 ); |
462 value.Copy( KNullDesC ); |
462 value.Copy( KNullDesC ); |
463 |
463 |
464 switch ( aItem ) |
464 switch ( aItem ) |
465 { |
465 { |
466 case TMainListBoxItem::EUsername: |
466 case TMainListBoxItem::EUsername: |
467 { |
467 { |
468 GetUsernameL( value ); |
468 GetUsernameL( value ); |
511 |
511 |
512 listBoxItemText.Format( |
512 listBoxItemText.Format( |
513 KCSCSettingsUiListItemTextFormat, |
513 KCSCSettingsUiListItemTextFormat, |
514 GetCaptionL( aItem ), |
514 GetCaptionL( aItem ), |
515 &value ); |
515 &value ); |
516 |
516 |
517 CleanupStack::PopAndDestroy( &value ); |
517 CleanupStack::PopAndDestroy( &value ); |
518 |
518 |
519 // Add to listbox |
519 // Add to listbox |
520 iListBoxItemArray.Append( listBoxItem ); |
520 iListBoxItemArray.Append( listBoxItem ); |
521 listBoxItems->AppendL( listBoxItemText ); |
521 listBoxItems->AppendL( listBoxItemText ); |
522 iListBox->HandleItemAdditionL(); |
522 iListBox->HandleItemAdditionL(); |
523 |
523 |
524 CSCSETUIDEBUG( |
524 CSCSETUIDEBUG( |
525 "CCSCSettingsUiMainContainer::MakeSettingItemL - end" ); |
525 "CCSCSettingsUiMainContainer::MakeSettingItemL - end" ); |
526 } |
526 } |
527 |
527 |
528 |
|
529 // --------------------------------------------------------------------------- |
528 // --------------------------------------------------------------------------- |
530 // CCSCSettingsUiMainContainer::GetCaptionL |
529 // CCSCSettingsUiMainContainer::GetCaptionL |
531 // Constructs setting list items. |
530 // Constructs setting list items. |
532 // --------------------------------------------------------------------------- |
531 // --------------------------------------------------------------------------- |
533 // |
532 // |
534 HBufC* CCSCSettingsUiMainContainer::GetCaptionL( |
533 HBufC* CCSCSettingsUiMainContainer::GetCaptionL( |
535 TMainListBoxItem::TSettingItems aItem ) |
534 TMainListBoxItem::TSettingItems aItem ) |
536 { |
535 { |
537 if( iCaption != NULL ) |
536 if ( iCaption != NULL ) |
538 { |
537 { |
539 delete iCaption; |
538 delete iCaption; |
540 iCaption = NULL; |
539 iCaption = NULL; |
541 } |
540 } |
542 |
541 |
543 switch ( aItem ) |
542 switch ( aItem ) |
544 { |
543 { |
545 case TMainListBoxItem::EUsername: |
544 case TMainListBoxItem::EUsername: |
546 { |
545 { |
547 iCaption = StringLoader::LoadL( |
546 iCaption = StringLoader::LoadL( |
604 // |
603 // |
605 void CCSCSettingsUiMainContainer::GetUsernameL( RBuf& aUsername ) |
604 void CCSCSettingsUiMainContainer::GetUsernameL( RBuf& aUsername ) |
606 { |
605 { |
607 aUsername.ReAllocL( KCCHMaxUsernameLength ); |
606 aUsername.ReAllocL( KCCHMaxUsernameLength ); |
608 User::LeaveIfError( iModel.CCHHandler().GetConnectionParameter( |
607 User::LeaveIfError( iModel.CCHHandler().GetConnectionParameter( |
609 iModel.CurrentSPEntryId(), ECchUsername, aUsername ) ); |
608 iModel.CurrentSPEntryId(), ECchUsername, aUsername ) ); |
610 } |
609 } |
611 |
|
612 |
610 |
613 // --------------------------------------------------------------------------- |
611 // --------------------------------------------------------------------------- |
614 // CCSCSettingsUiMainContainer::GetPresencePrefSettingL |
612 // CCSCSettingsUiMainContainer::GetPresencePrefSettingL |
615 // --------------------------------------------------------------------------- |
613 // --------------------------------------------------------------------------- |
616 // |
614 // |
617 void CCSCSettingsUiMainContainer::GetPreferredServiceSettingL( RBuf& aValue ) |
615 void CCSCSettingsUiMainContainer::GetPreferredServiceSettingL( RBuf& aValue ) |
618 { |
616 { |
619 // Select text resource for the current pref telephony value |
617 // Select text resource for the current pref telephony value |
620 TInt resource = ( iModel.SettingsHandler().IsPreferredTelephonyVoip() && |
618 TInt resource = ( iModel.SettingsHandler().IsPreferredTelephonyVoip() && |
621 iModel.SettingsHandler().IsPreferredService( |
619 iModel.SettingsHandler().IsPreferredService( |
622 iModel.CurrentSPEntryId() ) ) ? |
620 iModel.CurrentSPEntryId() ) ) ? |
623 R_CSCSETTINGSUI_SETTING_PREFERRED_SERVICE_ON : |
621 R_CSCSETTINGSUI_SETTING_PREFERRED_SERVICE_ON : |
624 R_CSCSETTINGSUI_SETTING_PREFERRED_SERVICE_OFF; |
622 R_CSCSETTINGSUI_SETTING_PREFERRED_SERVICE_OFF; |
625 |
623 |
626 HBufC* value = StringLoader::LoadLC( resource ); |
624 HBufC* value = StringLoader::LoadLC( resource ); |
627 aValue.ReAllocL( value->Length() ); |
625 aValue.ReAllocL( value->Length() ); |
628 aValue.Copy( value->Des() ); |
626 aValue.Copy( value->Des() ); |
629 CleanupStack::PopAndDestroy( value ); |
627 CleanupStack::PopAndDestroy( value ); |
630 } |
628 } |
631 |
629 |
632 |
|
633 // --------------------------------------------------------------------------- |
630 // --------------------------------------------------------------------------- |
634 // CCSCSettingsUiMainContainer::GetVccPreferredServiceSettingL |
631 // CCSCSettingsUiMainContainer::GetVccPreferredServiceSettingL |
635 // --------------------------------------------------------------------------- |
632 // --------------------------------------------------------------------------- |
636 // |
633 // |
637 void CCSCSettingsUiMainContainer::GetVccPreferredServiceSettingL( RBuf& aValue ) |
634 void CCSCSettingsUiMainContainer::GetVccPreferredServiceSettingL( RBuf& aValue ) |
638 { |
635 { |
639 // Select text resource for the current pref telephony value |
636 // Select text resource for the current pref telephony value |
640 TInt resource = ( iModel.SettingsHandler().IsPreferredTelephonyVoip() && |
637 TInt resource = ( iModel.SettingsHandler().IsPreferredTelephonyVoip() && |
641 iModel.SettingsHandler().IsPreferredService( |
638 iModel.SettingsHandler().IsPreferredService( |
642 iModel.CurrentSPEntryId() ) ) ? |
639 iModel.CurrentSPEntryId() ) ) ? |
643 R_CSCSETTINGSUI_SETTING_VCC_PREFERRED_SERVICE_ON : |
640 R_CSCSETTINGSUI_SETTING_VCC_PREFERRED_SERVICE_ON : |
644 R_CSCSETTINGSUI_SETTING_VCC_PREFERRED_SERVICE_OFF; |
641 R_CSCSETTINGSUI_SETTING_VCC_PREFERRED_SERVICE_OFF; |
645 |
642 |
646 HBufC* value = StringLoader::LoadLC( resource ); |
643 HBufC* value = StringLoader::LoadLC( resource ); |
647 aValue.ReAllocL( value->Length() ); |
644 aValue.ReAllocL( value->Length() ); |
648 aValue.Copy( value->Des() ); |
645 aValue.Copy( value->Des() ); |
649 CleanupStack::PopAndDestroy( value ); |
646 CleanupStack::PopAndDestroy( value ); |
650 } |
647 } |
651 |
648 |
652 |
|
653 // --------------------------------------------------------------------------- |
649 // --------------------------------------------------------------------------- |
654 // CCSCSettingsUiMainContainer::GetHandoverNotificationToneL |
650 // CCSCSettingsUiMainContainer::GetHandoverNotificationToneL |
655 // --------------------------------------------------------------------------- |
651 // --------------------------------------------------------------------------- |
656 // |
652 // |
657 void CCSCSettingsUiMainContainer::GetHandoverNotificationTonePrefL( |
653 void CCSCSettingsUiMainContainer::GetHandoverNotificationTonePrefL( |
658 RBuf& aValue ) |
654 RBuf& aValue ) |
659 { |
655 { |
660 HBufC* value = NULL; |
656 HBufC* value = NULL; |
661 TOnOff onOff = EOff; |
657 TOnOff onOff = EOff; |
662 |
658 |
663 TRAPD( err, onOff = iModel.SettingsHandler().HandoverNotifTonePrefL( |
659 TRAPD( err, onOff = iModel.SettingsHandler().HandoverNotifTonePrefL( |
664 iModel.CurrentSPEntryId() ) ); |
660 iModel.CurrentSPEntryId() ) ); |
665 |
661 |
666 if ( KErrNotFound == err ) |
662 if ( KErrNotFound == err ) |
667 { |
663 { |
668 iModel.SettingsHandler().SetHandoverNotifTonePrefL( |
664 iModel.SettingsHandler().SetHandoverNotifTonePrefL( |
669 iModel.CurrentSPEntryId(), EOff ); |
665 iModel.CurrentSPEntryId(), EOff ); |
670 } |
666 } |
697 } |
693 } |
698 else |
694 else |
699 { |
695 { |
700 User::Leave( KErrGeneral ); |
696 User::Leave( KErrGeneral ); |
701 } |
697 } |
702 |
698 |
703 aValue.ReAllocL( value->Length() ); |
699 aValue.ReAllocL( value->Length() ); |
704 aValue.Copy( value->Des() ); |
700 aValue.Copy( value->Des() ); |
705 |
701 |
706 CleanupStack::PopAndDestroy( value ); |
702 CleanupStack::PopAndDestroy( value ); |
707 } |
703 } |
708 |
704 |
709 |
|
710 // --------------------------------------------------------------------------- |
705 // --------------------------------------------------------------------------- |
711 // CCSCSettingsUiMainContainer::GetImToneSettingL |
706 // CCSCSettingsUiMainContainer::GetImToneSettingL |
712 // --------------------------------------------------------------------------- |
707 // --------------------------------------------------------------------------- |
713 // |
708 // |
714 void CCSCSettingsUiMainContainer::GetImToneSettingL( RBuf& aValue ) |
709 void CCSCSettingsUiMainContainer::GetImToneSettingL( RBuf& aValue ) |
715 { |
710 { |
716 aValue.ReAllocL( KCSCMaxImToneLength ); |
711 aValue.ReAllocL( KCSCMaxImToneLength ); |
717 |
712 |
718 MVIMPSTSettingsStore* settings = CVIMPSTSettingsStore::NewLC(); |
713 MVIMPSTSettingsStore* settings = CVIMPSTSettingsStore::NewLC(); |
719 |
714 |
720 TInt err = settings->GetL( |
715 TInt err = settings->GetL( |
721 iModel.CurrentSPEntryId(), EServiceToneFileName, aValue ); |
716 iModel.CurrentSPEntryId(), EServiceToneFileName, aValue ); |
722 |
717 |
723 // If tone path is not found from settings, set Off text |
718 // If tone path is not found from settings, set Off text |
724 if ( KErrNotFound == err || aValue.Length() < 2 ) |
719 if ( KErrNotFound == err || aValue.Length() < 2 ) |
725 { |
720 { |
726 HBufC* noToneSelected = StringLoader::LoadLC( |
721 HBufC* noToneSelected = StringLoader::LoadLC( |
727 R_CSCSETTINGSUI_IM_TONE_OFF ); |
722 R_CSCSETTINGSUI_IM_TONE_OFF ); |
728 |
723 |
729 User::LeaveIfError( settings->SetL( |
724 User::LeaveIfError( settings->SetL( |
730 iModel.CurrentSPEntryId(), EServiceToneFileName, *noToneSelected ) ); |
725 iModel.CurrentSPEntryId(), EServiceToneFileName, *noToneSelected ) ); |
731 |
726 |
732 // Get tone. |
727 // Get tone. |
733 User::LeaveIfError( settings->GetL( |
728 User::LeaveIfError( settings->GetL( |
734 iModel.CurrentSPEntryId(), EServiceToneFileName, aValue ) ); |
729 iModel.CurrentSPEntryId(), EServiceToneFileName, aValue ) ); |
735 |
730 |
736 CleanupStack::PopAndDestroy( noToneSelected ); |
731 CleanupStack::PopAndDestroy( noToneSelected ); |
737 } |
732 } |
738 else if ( err ) |
733 else if ( err ) |
739 { |
734 { |
740 User::Leave( err ); |
735 User::Leave( err ); |
741 } |
736 } |
742 else |
737 else |
743 { |
738 { |
744 // KErrNone -> do nothing |
739 // KErrNone -> do nothing |
745 } |
740 } |
746 |
741 |
747 TInt pos( 0 ); |
742 TInt pos( 0 ); |
748 while ( KErrNotFound != pos ) |
743 while ( KErrNotFound != pos ) |
749 { |
744 { |
750 pos = aValue.Find( KDoubleBackSlash ); |
745 pos = aValue.Find( KDoubleBackSlash ); |
751 aValue.Delete( 0, pos+1 ); |
746 aValue.Delete( 0, pos+1 ); |
752 } |
747 } |
753 |
748 |
754 CleanupStack::PopAndDestroy(); |
749 CleanupStack::PopAndDestroy(); |
755 } |
750 } |
756 |
|
757 |
751 |
758 // --------------------------------------------------------------------------- |
752 // --------------------------------------------------------------------------- |
759 // CCSCSettingsUiMainContainer::GetPresencePrefSettingL |
753 // CCSCSettingsUiMainContainer::GetPresencePrefSettingL |
760 // --------------------------------------------------------------------------- |
754 // --------------------------------------------------------------------------- |
761 // |
755 // |
762 void CCSCSettingsUiMainContainer::GetPresencePrefSettingL( RBuf& aValue ) |
756 void CCSCSettingsUiMainContainer::GetPresencePrefSettingL( RBuf& aValue ) |
763 { |
757 { |
764 HBufC* value = NULL; |
758 HBufC* value = NULL; |
765 TOnOff onOff = EOff; |
759 TOnOff onOff = EOff; |
766 |
760 |
767 TRAPD( err, onOff = iModel.SettingsHandler().PresenceReqPrefL( |
761 TRAPD( err, onOff = iModel.SettingsHandler().PresenceReqPrefL( |
768 iModel.CurrentSPEntryId() ) ); |
762 iModel.CurrentSPEntryId() ) ); |
769 |
763 |
770 if ( KErrNotFound == err ) |
764 if ( KErrNotFound == err ) |
771 { |
765 { |
772 iModel.SettingsHandler().SetPresenceReqPrefL( |
766 iModel.SettingsHandler().SetPresenceReqPrefL( |
773 iModel.CurrentSPEntryId(), EOff ); |
767 iModel.CurrentSPEntryId(), EOff ); |
774 } |
768 } |
837 CleanupStack::PopAndDestroy( snapName ); |
830 CleanupStack::PopAndDestroy( snapName ); |
838 } |
831 } |
839 } |
832 } |
840 } |
833 } |
841 |
834 |
842 |
|
843 // --------------------------------------------------------------------------- |
835 // --------------------------------------------------------------------------- |
844 // From class CoeControl |
836 // From class CoeControl |
845 // CCSCSettingsUiMainContainer::CountComponentControls |
837 // CCSCSettingsUiMainContainer::CountComponentControls |
846 // --------------------------------------------------------------------------- |
838 // --------------------------------------------------------------------------- |
847 // |
839 // |
848 TInt CCSCSettingsUiMainContainer::CountComponentControls() const |
840 TInt CCSCSettingsUiMainContainer::CountComponentControls() const |
849 { |
841 { |
850 return 1; |
842 return 1; |
851 } |
843 } |
852 |
844 |
853 |
|
854 // --------------------------------------------------------------------------- |
845 // --------------------------------------------------------------------------- |
855 // From class CoeControl |
846 // From class CoeControl |
856 // CCSCSettingsUiMainContainer::SizeChanged |
847 // CCSCSettingsUiMainContainer::SizeChanged |
857 // --------------------------------------------------------------------------- |
848 // --------------------------------------------------------------------------- |
858 // |
849 // |
859 void CCSCSettingsUiMainContainer::SizeChanged() |
850 void CCSCSettingsUiMainContainer::SizeChanged() |
860 { |
851 { |
861 iListBox->SetRect( Rect() ); |
852 iListBox->SetRect( Rect() ); |
862 } |
853 } |
863 |
854 |
864 |
|
865 // --------------------------------------------------------------------------- |
855 // --------------------------------------------------------------------------- |
866 // From class CoeControl |
856 // From class CoeControl |
867 // CCSCSettingsUiMainContainer::FocusChanged |
857 // CCSCSettingsUiMainContainer::FocusChanged |
868 // --------------------------------------------------------------------------- |
858 // --------------------------------------------------------------------------- |
869 // |
859 // |
870 void CCSCSettingsUiMainContainer::FocusChanged( |
860 void CCSCSettingsUiMainContainer::FocusChanged( |
871 TDrawNow aDrawNow ) |
861 TDrawNow aDrawNow ) |
872 { |
862 { |
873 CCoeControl::FocusChanged( aDrawNow ); |
863 CCoeControl::FocusChanged( aDrawNow ); |
874 |
864 |
875 if( iListBox ) |
865 if ( iListBox ) |
876 { |
866 { |
877 iListBox->SetFocus( IsFocused() ); |
867 iListBox->SetFocus( IsFocused() ); |
878 } |
868 } |
879 } |
869 } |
|
870 |
|
871 // --------------------------------------------------------------------------- |
|
872 // Deletes service. |
|
873 // --------------------------------------------------------------------------- |
|
874 // |
|
875 void CCSCSettingsUiMainContainer::DeleteServiceL() |
|
876 { |
|
877 CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::DeleteServiceL - begin" ); |
|
878 |
|
879 // Show confirmation query for service deletion. |
|
880 // Create confirmation query dialog. |
|
881 HBufC* string = NULL; |
|
882 CAknQueryDialog* query = |
|
883 new( ELeave ) CAknQueryDialog( CAknQueryDialog::ENoTone ); |
|
884 |
|
885 CleanupStack::PushL( query ); |
|
886 query->PrepareLC( R_CSC_DELETE_SERVICE_QUERY ); |
|
887 string = StringLoader::LoadLC( |
|
888 R_QTN_CSC_DELETE_SERVICE_QUERY, |
|
889 iModel.SettingsHandler().ServiceNameL( iModel.CurrentSPEntryId() ) ); |
|
890 query->SetPromptL( *string ); |
|
891 CleanupStack::PopAndDestroy( string ); |
|
892 CleanupStack::Pop( query ); |
|
893 if ( query->RunLD() ) |
|
894 { |
|
895 // First check if there is a service plugin UID. |
|
896 TInt count = iModel.ServicePluginHandler().PluginCount( |
|
897 CCSCEngServicePluginHandler::EInitialized ); |
|
898 |
|
899 TRAPD( err, LaunchCleanupPluginL( iModel.CurrentSPEntryId() ) ); |
|
900 if ( KErrNone != err ) |
|
901 { |
|
902 iModel.SettingsHandler().DeleteServiceL( |
|
903 iModel.CurrentSPEntryId() ); |
|
904 } |
|
905 } |
|
906 |
|
907 CSCSETUIDEBUG( "CCSCSettingsUiMainContainer::DeleteServiceL - end" ); |
|
908 } |
|
909 |
|
910 // --------------------------------------------------------------------------- |
|
911 // Launches cleanup plugin to remove settings. |
|
912 // --------------------------------------------------------------------------- |
|
913 // |
|
914 void CCSCSettingsUiMainContainer::LaunchCleanupPluginL( |
|
915 TUint aServiceId ) const |
|
916 { |
|
917 CSCSETUIDEBUG( |
|
918 "CCSCSettingsUiMainContainer::LaunchCleanupPluginL - begin" ); |
|
919 |
|
920 RImplInfoPtrArray implInfoArray; |
|
921 CleanupStack::PushL( TCleanupItem( |
|
922 ResetAndDestroy, &implInfoArray ) ); |
|
923 |
|
924 REComSession::ListImplementationsL( |
|
925 KCSCSettingsCleanupPluginInterfaceUid, |
|
926 implInfoArray ); |
|
927 |
|
928 for ( TInt i( 0 ) ; i < implInfoArray.Count() ; i++ ) |
|
929 { |
|
930 CCSCEngSettingsCleanupPluginInterface* plugin = |
|
931 CCSCEngSettingsCleanupPluginInterface::NewL( |
|
932 implInfoArray[i]->ImplementationUid() ); |
|
933 |
|
934 CleanupStack::PushL( plugin ); |
|
935 |
|
936 if ( CCSCEngSettingsCleanupPluginInterface::ESipVoIPCleanupPlugin |
|
937 == plugin->PluginType() ) |
|
938 { |
|
939 plugin->RemoveSettingsL( aServiceId ); |
|
940 } |
|
941 |
|
942 CleanupStack::PopAndDestroy( plugin ); |
|
943 } |
|
944 |
|
945 CleanupStack::PopAndDestroy( &implInfoArray ); |
|
946 REComSession::FinalClose(); |
|
947 |
|
948 CSCSETUIDEBUG( |
|
949 "CCSCSettingsUiMainContainer::LaunchCleanupPluginL - end" ); |
|
950 } |
|
951 |
|
952 // --------------------------------------------------------------------------- |
|
953 // CCSCSettingsUiMainContainer::ResetAndDestroy |
|
954 // --------------------------------------------------------------------------- |
|
955 // |
|
956 void CCSCSettingsUiMainContainer::ResetAndDestroy( TAny* aArray ) |
|
957 { |
|
958 if ( aArray ) |
|
959 { |
|
960 RImplInfoPtrArray* array = |
|
961 reinterpret_cast<RImplInfoPtrArray*>( aArray ); |
|
962 array->ResetAndDestroy(); |
|
963 } |
|
964 } |
|
965 |
|
966 // End of file. |
|
967 |