27 #include <MPbk2ApplicationServices.h> |
27 #include <MPbk2ApplicationServices.h> |
28 #include <MPbk2ApplicationServices2.h> |
28 #include <MPbk2ApplicationServices2.h> |
29 #include <CPbk2ServiceManager.h> |
29 #include <CPbk2ServiceManager.h> |
30 #include <MPbk2AppUi.h> |
30 #include <MPbk2AppUi.h> |
31 #include <Pbk2UIControls.rsg> |
31 #include <Pbk2UIControls.rsg> |
|
32 #include <Pbk2Commands.rsg> |
32 #include <CPbk2ApplicationServices.h> |
33 #include <CPbk2ApplicationServices.h> |
33 #include <TPbk2StoreContactAnalyzer.h> |
34 #include <TPbk2StoreContactAnalyzer.h> |
34 |
35 |
35 // Virtual Phonebook |
36 // Virtual Phonebook |
36 #include <CVPbkFieldFilter.h> |
37 #include <CVPbkFieldFilter.h> |
689 } |
691 } |
690 } |
692 } |
691 } |
693 } |
692 |
694 |
693 // -------------------------------------------------------------------------- |
695 // -------------------------------------------------------------------------- |
|
696 // CPbk2AddressSelect::IsVoiceCallExistL |
|
697 // -------------------------------------------------------------------------- |
|
698 // |
|
699 inline TBool CPbk2AddressSelect::IsVoiceCallExistL() |
|
700 { |
|
701 TInt countFields = iParams.iContact.Fields().FieldCount(); |
|
702 TPbk2StoreContactAnalyzer analyzer( iParams.iContactManager, NULL ); |
|
703 |
|
704 for ( TInt i = 0; i < countFields; i++ ) |
|
705 { |
|
706 const MVPbkStoreContactField& field = |
|
707 iParams.iContact.Fields().FieldAt( i ); |
|
708 |
|
709 // If the field is voice call, then return ETrue. |
|
710 if ( analyzer.IsFieldTypeIncludedL( field, R_PHONEBOOK2_PHONENUMBER_SELECTOR ) ) |
|
711 { |
|
712 return ETrue; |
|
713 } |
|
714 } |
|
715 |
|
716 // No voice call filed, return EFalse. |
|
717 return EFalse; |
|
718 } |
|
719 |
|
720 // -------------------------------------------------------------------------- |
|
721 // CPbk2AddressSelect::GetVoiceAndVOIPCallDialogTitleL |
|
722 // -------------------------------------------------------------------------- |
|
723 // |
|
724 inline HBufC* CPbk2AddressSelect::GetVoiceAndVOIPCallDialogTitleL() |
|
725 { |
|
726 HBufC* title (NULL); |
|
727 |
|
728 // If the popped up dialog is started in namelist view. |
|
729 // Then, the title of the dialog should obey such rules: |
|
730 // 1. When there are only VoIP addresses for contact or if VoIP is preferred. |
|
731 // Then show "Internet call:" |
|
732 // 2. In other cases show "Call:". This would be shown when: |
|
733 // 2.1 VoIP is not preferred and there's at least one Voice call number for the contact |
|
734 // 2.2 So even in case when there's only voice call numbers. |
|
735 // The title should be "Call:" instead of "Voice call:" |
|
736 if ( iParams.iTitleResId == R_QTN_PHOB_QTL_CALL_TO_NAME ) |
|
737 { |
|
738 // Check whether VoIP is preferred. |
|
739 CSPSettingsVoIPUtils* sPSettings = CSPSettingsVoIPUtils::NewLC(); |
|
740 if ( sPSettings->IsPreferredTelephonyVoIP() || |
|
741 !IsVoiceCallExistL() ) |
|
742 { |
|
743 title = GetVOIPDialogTitleL(); |
|
744 } |
|
745 else |
|
746 { |
|
747 title = StringLoader::LoadL( R_QTN_PHOB_TITLE_POPUP_CALL ); |
|
748 } |
|
749 CleanupStack::PopAndDestroy( sPSettings ); |
|
750 } |
|
751 else if ( iParams.iCommMethod == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ) |
|
752 { |
|
753 title = StringLoader::LoadL( R_QTN_CCA_POPUP_VOICE_CALL ); |
|
754 } |
|
755 else if ( iParams.iCommMethod == VPbkFieldTypeSelectorFactory::EVOIPCallSelector ) |
|
756 { |
|
757 title = GetVOIPDialogTitleL(); |
|
758 } |
|
759 return title; |
|
760 } |
|
761 |
|
762 // -------------------------------------------------------------------------- |
694 // CPbk2AddressSelect::LoadDialogTitleL |
763 // CPbk2AddressSelect::LoadDialogTitleL |
695 // -------------------------------------------------------------------------- |
764 // -------------------------------------------------------------------------- |
696 // |
765 // |
697 inline HBufC* CPbk2AddressSelect::LoadDialogTitleL() |
766 inline HBufC* CPbk2AddressSelect::LoadDialogTitleL() |
698 { |
767 { |
699 HBufC* title = NULL; |
768 HBufC* title = NULL; |
700 switch( iParams.iCommMethod ) |
769 switch( iParams.iCommMethod ) |
701 { |
770 { |
702 case VPbkFieldTypeSelectorFactory::EVoiceCallSelector: |
771 case VPbkFieldTypeSelectorFactory::EVoiceCallSelector: |
703 { |
772 case VPbkFieldTypeSelectorFactory::EVOIPCallSelector: |
704 title = StringLoader::LoadL( R_QTN_PHOB_TITLE_POPUP_CALL ); |
773 { |
|
774 title = GetVoiceAndVOIPCallDialogTitleL(); |
705 break; |
775 break; |
706 } |
776 } |
|
777 |
707 case VPbkFieldTypeSelectorFactory::EUniEditorSelector: |
778 case VPbkFieldTypeSelectorFactory::EUniEditorSelector: |
708 { |
779 { |
709 title = StringLoader::LoadL( R_QTN_PHOB_TITLE_POPUP_MESSAGE ); |
780 title = StringLoader::LoadL( R_QTN_PHOB_TITLE_POPUP_MESSAGE ); |
710 break; |
781 break; |
711 } |
782 } |