81 #include "FreestyleEmailUiCLSItem.h" |
81 #include "FreestyleEmailUiCLSItem.h" |
82 #include "FreestyleEmailUiAppui.h" |
82 #include "FreestyleEmailUiAppui.h" |
83 |
83 |
84 //Constants |
84 //Constants |
85 const TInt KInternetCallPreferred = 1; |
85 const TInt KInternetCallPreferred = 1; |
86 |
86 /** UID of the CCA details view plugin implementation |
|
87 * ( from ccappdetailsviewpluginuids.hrh ) */ |
|
88 const TInt KCCADetailsViewPluginImplmentationUid = 0x200159E7; |
|
89 /** CCA Application |
|
90 * ( from ccauids.h )*/ |
|
91 const TInt KCCAAppUID = 0x2000B609; |
|
92 /** Phonebook2 App UID */ |
|
93 const TInt KPbkUID3 = 0x101f4cce; |
87 |
94 |
88 CFSEmailUiContactHandler* CFSEmailUiContactHandler::NewL( RFs& aSession ) |
95 CFSEmailUiContactHandler* CFSEmailUiContactHandler::NewL( RFs& aSession ) |
89 { |
96 { |
90 FUNC_LOG; |
97 FUNC_LOG; |
91 CFSEmailUiContactHandler* self = CFSEmailUiContactHandler::NewLC( aSession ); |
98 CFSEmailUiContactHandler* self = CFSEmailUiContactHandler::NewLC( aSession ); |
334 } |
341 } |
335 if ( aVoipOverride || SelectBetweenCsAndVoip() == EAiwVoIPCall ) |
342 if ( aVoipOverride || SelectBetweenCsAndVoip() == EAiwVoIPCall ) |
336 { |
343 { |
337 dialData->SetCallType( CAiwDialData::EAIWVoiP ); |
344 dialData->SetCallType( CAiwDialData::EAIWVoiP ); |
338 } |
345 } |
339 // <cmail> video call |
|
340 else if ( iVideoCall ) |
346 else if ( iVideoCall ) |
341 { |
347 { |
342 iVideoCall = EFalse; |
348 iVideoCall = EFalse; |
343 dialData->SetCallType( CAiwDialData::EAIWForcedVideo ); |
349 dialData->SetCallType( CAiwDialData::EAIWForcedVideo ); |
344 } |
350 } |
345 // </cmail> |
|
346 else |
351 else |
347 { |
352 { |
348 dialData->SetCallType( CAiwDialData::EAIWVoice ); |
353 dialData->SetCallType( CAiwDialData::EAIWVoice ); |
349 } |
354 } |
350 } |
355 } |
499 0, |
502 0, |
500 this); |
503 this); |
501 } |
504 } |
502 } |
505 } |
503 |
506 |
504 // <cmail> video call |
|
505 // --------------------------------------------------------------------------- |
507 // --------------------------------------------------------------------------- |
506 // Enables/disables video call. |
508 // Enables/disables video call. |
507 // --------------------------------------------------------------------------- |
509 // --------------------------------------------------------------------------- |
508 // |
510 // |
509 void CFSEmailUiContactHandler::SetVideoCall( TBool aState ) |
511 void CFSEmailUiContactHandler::SetVideoCall( TBool aState ) |
510 { |
512 { |
|
513 FUNC_LOG; |
511 iVideoCall = aState; |
514 iVideoCall = aState; |
512 } |
515 } |
513 // </cmail> |
516 |
514 |
517 // --------------------------------------------------------------------------- |
515 ///////////////////////////////////////////////////////////////////////////// |
|
516 // CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL |
518 // CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL |
517 // |
519 // --------------------------------------------------------------------------- |
518 ///////////////////////////////////////////////////////////////////////////// |
520 // |
519 void CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink ) |
521 void CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL( |
|
522 MVPbkContactLink* aContactLink ) |
520 { |
523 { |
521 FUNC_LOG; |
524 FUNC_LOG; |
522 if ( iState == EContactHandlerIdle ) |
525 if ( iState == EContactHandlerIdle ) |
523 { |
526 { |
524 iState = EContactHandlerGetSmsAddressFromPhonebook; |
527 iState = EContactHandlerGetSmsAddressFromPhonebook; |
548 0, |
551 0, |
549 this); |
552 this); |
550 } |
553 } |
551 } |
554 } |
552 |
555 |
553 ///////////////////////////////////////////////////////////////////////////// |
556 // --------------------------------------------------------------------------- |
554 // CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL |
557 // CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL |
555 // |
558 // --------------------------------------------------------------------------- |
556 ///////////////////////////////////////////////////////////////////////////// |
559 // |
557 void CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink, |
560 void CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL( |
558 TBool aIsVoiceMessage ) |
561 MVPbkContactLink* aContactLink, TBool aIsVoiceMessage ) |
559 { |
562 { |
560 FUNC_LOG; |
563 FUNC_LOG; |
561 if ( iState == EContactHandlerIdle ) |
564 if ( iState == EContactHandlerIdle ) |
562 { |
565 { |
563 if ( aIsVoiceMessage ) |
566 if ( aIsVoiceMessage ) |
594 0, |
597 0, |
595 this); |
598 this); |
596 } |
599 } |
597 } |
600 } |
598 |
601 |
599 ///////////////////////////////////////////////////////////////////////////// |
602 // --------------------------------------------------------------------------- |
|
603 // Retrieves the first contact in contact link set. |
|
604 // --------------------------------------------------------------------------- |
|
605 // |
|
606 void CFSEmailUiContactHandler::RetrieveContactsL() |
|
607 { |
|
608 FUNC_LOG; |
|
609 if ( iLinksSet->Count() ) |
|
610 { |
|
611 delete iCurrentLink; |
|
612 iCurrentLink = NULL; |
|
613 |
|
614 iCurrentLink = iLinksSet->At(0).CloneLC(); |
|
615 CleanupStack::Pop(); |
|
616 |
|
617 delete iLinkOperationFetch; |
|
618 iLinkOperationFetch = NULL; |
|
619 |
|
620 //Async operation, callback VPbkSingleContactOperationCompleteL |
|
621 //Error situations: VPbkSingleContactOperationFailed |
|
622 iLinkOperationFetch = iContactManager->RetrieveContactL( |
|
623 *iCurrentLink, *this ); |
|
624 } |
|
625 } |
|
626 |
|
627 // --------------------------------------------------------------------------- |
600 // CFSEmailUiContactHandler::ArrayUpdatedL |
628 // CFSEmailUiContactHandler::ArrayUpdatedL |
601 // |
629 // --------------------------------------------------------------------------- |
602 ///////////////////////////////////////////////////////////////////////////// |
630 // |
603 void CFSEmailUiContactHandler::ArrayUpdatedL( |
631 void CFSEmailUiContactHandler::ArrayUpdatedL( |
604 const RPointerArray<CFSEmailUiClsItem>& aMatchingItems ) |
632 const RPointerArray<CFSEmailUiClsItem>& aMatchingItems ) |
605 { |
633 { |
606 FUNC_LOG; |
634 FUNC_LOG; |
607 |
635 |
669 // handle only if caching was in progress |
697 // handle only if caching was in progress |
670 if ( iCachingInProgressError ) |
698 if ( iCachingInProgressError ) |
671 { |
699 { |
672 iCachingInProgressError = EFalse; |
700 iCachingInProgressError = EFalse; |
673 iState = EContactHandlerIdle; |
701 iState = EContactHandlerIdle; |
674 iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); |
702 iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); |
675 } |
703 } |
676 } |
704 } |
677 else |
705 else |
678 { |
706 { |
679 iState = EContactHandlerIdle; |
707 iState = EContactHandlerIdle; |
680 iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); |
708 iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); |
681 } |
709 } |
690 void CFSEmailUiContactHandler::VPbkSingleContactOperationComplete( |
718 void CFSEmailUiContactHandler::VPbkSingleContactOperationComplete( |
691 MVPbkContactOperationBase& aOperation, |
719 MVPbkContactOperationBase& aOperation, |
692 MVPbkStoreContact* aContact ) |
720 MVPbkStoreContact* aContact ) |
693 { |
721 { |
694 FUNC_LOG; |
722 FUNC_LOG; |
695 //inform also client in case of error to enable client's actions (i.e. return search priority) |
723 //inform also client in case of error to enable client's actions (i.e. return search priority) |
696 // TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) ); |
|
697 TRAPD(error, VPbkSingleContactOperationCompleteL( aOperation, aContact) ); |
724 TRAPD(error, VPbkSingleContactOperationCompleteL( aOperation, aContact) ); |
698 if ( error != KErrNone ) |
725 if ( error != KErrNone ) |
699 { |
726 { |
700 TRAP_IGNORE(ObserverOperationErrorL( CurrentCommand(), error )); |
727 TRAP_IGNORE(ObserverOperationErrorL( CurrentCommand(), error )); |
701 } |
728 } |
702 // |
|
703 } |
729 } |
704 |
730 |
705 void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL( |
731 void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL( |
706 MVPbkContactOperationBase& aOperation, |
732 MVPbkContactOperationBase& aOperation, |
707 MVPbkStoreContact* aContact ) |
733 MVPbkStoreContact* aContact ) |
718 CleanupResetAndDestroyClosePushL( lastname ); |
744 CleanupResetAndDestroyClosePushL( lastname ); |
719 RPointerArray<HBufC> emailAddresses; |
745 RPointerArray<HBufC> emailAddresses; |
720 CleanupResetAndDestroyClosePushL( emailAddresses ); |
746 CleanupResetAndDestroyClosePushL( emailAddresses ); |
721 GetContactFieldsL( iFirstnameFields, firstname, aContact ); |
747 GetContactFieldsL( iFirstnameFields, firstname, aContact ); |
722 GetContactFieldsL( iLastnameFields, lastname, aContact ); |
748 GetContactFieldsL( iLastnameFields, lastname, aContact ); |
723 |
749 |
724 // Create display name, this will be used in UI. |
750 // Create display name, this will be used in UI. |
725 TInt dispNameLength = 1; |
751 TInt dispNameLength = 1; |
726 if ( firstname.Count() ) dispNameLength += firstname[0]->Length(); |
752 if ( firstname.Count() ) dispNameLength += firstname[0]->Length(); |
727 if ( lastname.Count() ) dispNameLength += lastname[0]->Length(); |
753 if ( lastname.Count() ) dispNameLength += lastname[0]->Length(); |
728 HBufC* displayname = HBufC::NewLC( dispNameLength ); |
754 HBufC* displayname = HBufC::NewLC( dispNameLength ); |
729 |
755 TPtr displaynamePtr = displayname->Des(); |
730 if ( firstname.Count() ) |
756 if ( firstname.Count() && firstname[0]->Length() ) |
731 { |
757 { |
732 displayname->Des().Copy( *firstname[0] ); |
758 displaynamePtr.Copy( *firstname[0] ); |
733 displayname->Des().Append( KSpace ); |
759 |
|
760 // Append space only when both firstname and lastname are present. |
|
761 if ( lastname.Count() && lastname[0]->Length() ) |
|
762 { |
|
763 displaynamePtr.Append( KSpace ); |
|
764 } |
734 } |
765 } |
735 if ( lastname.Count() ) |
766 if ( lastname.Count() ) |
736 { |
767 { |
737 displayname->Des().Append( *lastname[0] ); |
768 displaynamePtr.Append( *lastname[0] ); |
738 } |
769 } |
739 |
770 |
740 // retrieve selected email address |
771 // retrieve selected email address |
741 MVPbkStoreContactFieldCollection& fields = aContact->Fields(); |
772 MVPbkStoreContactFieldCollection& fields = aContact->Fields(); |
742 MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink ); |
773 MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink ); |
743 HBufC* selectedEmailAddress = MVPbkContactFieldTextData::Cast( |
774 HBufC* selectedEmailAddress = MVPbkContactFieldTextData::Cast( |
744 selectedField->FieldData() ).Text().AllocLC(); |
775 selectedField->FieldData() ).Text().AllocLC(); |
808 } |
839 } |
809 } |
840 } |
810 } |
841 } |
811 |
842 |
812 else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) ) |
843 else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) ) |
813 { |
844 { |
814 CleanupDeletePushL( aContact ); |
845 CleanupDeletePushL( aContact ); |
815 |
846 |
816 RPointerArray<HBufC> phonenumbers; |
847 RPointerArray<HBufC> phonenumbers; |
817 CleanupResetAndDestroyClosePushL( phonenumbers ); |
848 CleanupResetAndDestroyClosePushL( phonenumbers ); |
818 GetContactFieldsL( iPhoneNumberFields, phonenumbers, aContact ); |
849 GetContactFieldsL( iPhoneNumberFields, phonenumbers, aContact ); |
838 { |
869 { |
839 RemoteContactQueryL(); |
870 RemoteContactQueryL(); |
840 } |
871 } |
841 else |
872 else |
842 { |
873 { |
843 TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); |
874 TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); |
844 //no phone number found - inform client to enable its actions (i.e. return search priority) |
875 //no phone number found - inform client to enable its actions (i.e. return search priority) |
845 ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrNotFound ); |
876 ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrNotFound ); |
846 } |
877 } |
847 iState = EContactHandlerIdle; |
878 iState = EContactHandlerIdle; |
848 } |
879 } |
849 |
880 |
850 CleanupStack::PopAndDestroy( aContact ); |
881 CleanupStack::PopAndDestroy( aContact ); |
851 } |
882 } |
852 // Addition to get contact for message creation. |
883 // Addition to get contact for message creation. |
853 else if ( (iLinkOperationFetch == &aOperation) && ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || |
884 else if ( (iLinkOperationFetch == &aOperation) && |
854 iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) ) |
885 ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || |
|
886 iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || |
|
887 iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) ) |
855 { |
888 { |
856 if ( iContactForMsgCreation ) |
889 if ( iContactForMsgCreation ) |
857 { |
890 { |
858 delete iContactForMsgCreation; |
891 delete iContactForMsgCreation; |
859 iContactForMsgCreation = NULL; |
892 iContactForMsgCreation = NULL; |
914 iHandlerObserver->OperationErrorL( EFindAndCallToContactByEmailL, aError ); |
947 iHandlerObserver->OperationErrorL( EFindAndCallToContactByEmailL, aError ); |
915 iHandlerObserver = NULL; |
948 iHandlerObserver = NULL; |
916 } |
949 } |
917 } |
950 } |
918 |
951 |
919 |
952 // --------------------------------------------------------------------------- |
|
953 // From MVPbkContactStoreListObserver. |
|
954 // Called when the opening process is complete. |
|
955 // --------------------------------------------------------------------------- |
|
956 // |
920 void CFSEmailUiContactHandler::OpenComplete() |
957 void CFSEmailUiContactHandler::OpenComplete() |
921 { |
958 { |
922 FUNC_LOG; |
959 FUNC_LOG; |
923 if ( iStoreReady ) |
960 if ( iStoreReady ) |
924 { |
961 { |
925 iOpenComplete = ETrue; |
962 iOpenComplete = ETrue; |
|
963 } |
|
964 |
|
965 if ( iState == EContactHandlerGetAddressesFromPhonebook ) |
|
966 { |
|
967 // Start retrieving contacts when stores are opened. |
|
968 TRAP_IGNORE( RetrieveContactsL() ); |
926 } |
969 } |
927 } |
970 } |
928 |
971 |
929 void CFSEmailUiContactHandler::StoreReady(MVPbkContactStore& /*aContactStore*/) |
972 void CFSEmailUiContactHandler::StoreReady(MVPbkContactStore& /*aContactStore*/) |
930 { |
973 { |
966 RPointerArray<CFSEmailUiClsItem> emptyItems; |
1009 RPointerArray<CFSEmailUiClsItem> emptyItems; |
967 iHandlerObserver->OperationCompleteL( EAddToContactL, emptyItems ); |
1010 iHandlerObserver->OperationCompleteL( EAddToContactL, emptyItems ); |
968 emptyItems.Close(); |
1011 emptyItems.Close(); |
969 iHandlerObserver = NULL; |
1012 iHandlerObserver = NULL; |
970 } |
1013 } |
971 |
|
972 } |
1014 } |
973 else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) && |
1015 else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) && |
974 (aEventId == KAiwEventCompleted)) |
1016 (aEventId == KAiwEventCompleted)) |
975 { |
1017 { |
976 |
|
977 TInt index = 0; |
1018 TInt index = 0; |
978 const TAiwGenericParam* param = |
1019 const TAiwGenericParam* param = |
979 aEventParamList.FindFirst(index, EGenericParamContactLinkArray); |
1020 aEventParamList.FindFirst( index, EGenericParamContactLinkArray ); |
980 if (param) |
1021 if ( param ) |
981 { |
1022 { |
982 TPtrC8 contactLinks = param->Value().AsData(); |
1023 TPtrC8 contactLinks = param->Value().AsData(); |
983 |
1024 iLinksSet = iContactManager->CreateLinksLC( contactLinks ); |
984 iLinksSet = iContactManager->CreateLinksLC(contactLinks); |
|
985 CleanupStack::Pop(); |
1025 CleanupStack::Pop(); |
986 if ( iLinksSet->Count() ) |
1026 |
987 { |
1027 // Open all stores before retrieving contact details. |
988 delete iCurrentLink; |
1028 // Async operation, calls OpenComplete when all stores are opened. |
989 iCurrentLink = NULL; |
|
990 |
|
991 iCurrentLink = iLinksSet->At(0).CloneLC(); |
|
992 CleanupStack::Pop(); |
|
993 //Async operation, callback VPbkSingleContactOperationCompleteL |
|
994 //Error situations: VPbkSingleContactOperationFailed |
|
995 iLinkOperationFetch = iContactManager->RetrieveContactL( |
|
996 iLinksSet->At(0), *this ); |
|
997 } |
|
998 |
|
999 iContactManager->ContactStoresL().OpenAllL( *this ); |
1029 iContactManager->ContactStoresL().OpenAllL( *this ); |
1000 } |
1030 } |
1001 |
|
1002 } |
1031 } |
1003 else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) && |
1032 else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) && |
1004 (aEventId == KAiwEventCompleted)) |
1033 (aEventId == KAiwEventCompleted)) |
1005 { |
1034 { |
1006 iState = EContactHandlerIdle; |
1035 iState = EContactHandlerIdle; |
1064 iOpenComplete(EFalse), |
1093 iOpenComplete(EFalse), |
1065 iStoreReady(EFalse), |
1094 iStoreReady(EFalse), |
1066 iUseSenderText(EFalse), |
1095 iUseSenderText(EFalse), |
1067 iFs( aSession ), |
1096 iFs( aSession ), |
1068 iCachingInProgressError(EFalse), |
1097 iCachingInProgressError(EFalse), |
1069 // <cmail> video call |
|
1070 iVideoCall( EFalse ) |
1098 iVideoCall( EFalse ) |
1071 // </cmail> |
|
1072 { |
1099 { |
1073 FUNC_LOG; |
1100 FUNC_LOG; |
1074 } |
1101 } |
1075 |
1102 |
1076 void CFSEmailUiContactHandler::ConstructL( RFs& aSession ) |
1103 void CFSEmailUiContactHandler::ConstructL( RFs& aSession ) |
1110 { |
1137 { |
1111 RemoteContactQueryL(); |
1138 RemoteContactQueryL(); |
1112 } |
1139 } |
1113 else |
1140 else |
1114 { |
1141 { |
1115 TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); |
1142 TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); |
1116 } |
1143 } |
1117 // <cmail> video call flag needs to be cleared |
|
1118 iVideoCall = EFalse; |
1144 iVideoCall = EFalse; |
1119 // </cmail> |
|
1120 iState = EContactHandlerIdle; |
1145 iState = EContactHandlerIdle; |
1121 } |
1146 } |
1122 else if ( aMatchingItems.Count() > 0 ) // Call to one directly |
1147 else if ( aMatchingItems.Count() > 0 ) // Call to one directly |
1123 { |
1148 { |
1124 // Create contact item in which to copy number or address, async operation. |
1149 // Create contact item in which to copy number or address, async operation. |
1125 delete iCurrentLink; |
1150 delete iCurrentLink; |
1126 iCurrentLink = NULL; |
1151 iCurrentLink = NULL; |
1134 } |
1159 } |
1135 |
1160 |
1136 //Async operation, callback VPbkSingleContactOperationCompleteL |
1161 //Async operation, callback VPbkSingleContactOperationCompleteL |
1137 //Error situations: VPbkSingleContactOperationFailed |
1162 //Error situations: VPbkSingleContactOperationFailed |
1138 iLinkOperationFetch = iContactManager->RetrieveContactL( |
1163 iLinkOperationFetch = iContactManager->RetrieveContactL( |
1139 *iCurrentLink, *this); |
1164 *iCurrentLink, *this ); |
1140 } |
1165 } |
1141 } |
1166 } |
1142 |
1167 |
1143 void CFSEmailUiContactHandler::CreateMessageL( const RPointerArray<CFSEmailUiClsItem>& aMatchingItems ) |
1168 void CFSEmailUiContactHandler::CreateMessageL( const RPointerArray<CFSEmailUiClsItem>& aMatchingItems ) |
1144 { |
1169 { |
1410 param->SetConnectionFlag(MCCAParameter::ENormal); |
1435 param->SetConnectionFlag(MCCAParameter::ENormal); |
1411 param->SetContactDataFlag(MCCAParameter::EContactLink); |
1436 param->SetContactDataFlag(MCCAParameter::EContactLink); |
1412 param->SetContactDataL( link16->Des() ); |
1437 param->SetContactDataL( link16->Des() ); |
1413 |
1438 |
1414 // switch to details view |
1439 // switch to details view |
1415 const TUid uid = TUid::Uid( 0x200159E7 ); |
1440 const TUid uid = TUid::Uid( KCCADetailsViewPluginImplmentationUid ); |
1416 param->SetLaunchedViewUid( uid); |
1441 param->SetLaunchedViewUid( uid ); |
1417 |
1442 |
1418 // Launching the CCA application |
1443 // Launching the CCA application |
1419 iConnection->LaunchAppL( *param, this ); |
1444 iConnection->LaunchAppL( *param, this ); |
1420 |
1445 |
1421 CleanupStack::Pop( param ); // parameter is taken care by MCCAConnection |
1446 CleanupStack::Pop( param ); // parameter is taken care by MCCAConnection |
1430 |
1455 |
1431 iState = EContactHandlerIdle; |
1456 iState = EContactHandlerIdle; |
1432 } |
1457 } |
1433 |
1458 |
1434 // --------------------------------------------------------------------------- |
1459 // --------------------------------------------------------------------------- |
|
1460 // Return contact details view Id |
|
1461 // --------------------------------------------------------------------------- |
|
1462 // |
|
1463 TUid CFSEmailUiContactHandler::GetDetailsViewUid() |
|
1464 { |
|
1465 return TUid::Uid( KCCADetailsViewPluginImplmentationUid ); |
|
1466 } |
|
1467 |
|
1468 // --------------------------------------------------------------------------- |
|
1469 // Return contact detail App Id (CCAPP) |
|
1470 // --------------------------------------------------------------------------- |
|
1471 // |
|
1472 TUid CFSEmailUiContactHandler::GetDetailsAppUid() |
|
1473 { |
|
1474 return TUid::Uid( KCCAAppUID ); |
|
1475 } |
|
1476 |
|
1477 // --------------------------------------------------------------------------- |
|
1478 // Close Details view using CCApplication |
|
1479 // --------------------------------------------------------------------------- |
|
1480 // |
|
1481 void CFSEmailUiContactHandler::CloseContactDetailsL() |
|
1482 { |
|
1483 CCASimpleNotifyL( MCCAObserver::EExitEvent,0 ); |
|
1484 iContactDetailsClosed = ETrue; |
|
1485 } |
|
1486 |
|
1487 // --------------------------------------------------------------------------- |
|
1488 // Check if Contact Details view was closed using CloseContactDetailsL method |
|
1489 // --------------------------------------------------------------------------- |
|
1490 // |
|
1491 TBool CFSEmailUiContactHandler::WasDetailsClosed() |
|
1492 { |
|
1493 return iContactDetailsClosed; |
|
1494 } |
|
1495 |
|
1496 // --------------------------------------------------------------------------- |
|
1497 // Reopen Details view for last addres or bring contacts app to foreground |
|
1498 // --------------------------------------------------------------------------- |
|
1499 // |
|
1500 void CFSEmailUiContactHandler::ReopenContactDetailsL(RWsSession& session ) |
|
1501 { |
|
1502 if( iPreviousEmailAddress ) |
|
1503 { |
|
1504 HBufC* emailAddress = iPreviousEmailAddress->AllocLC(); |
|
1505 ShowContactDetailsL( *emailAddress, EContactUpdateEmail, NULL ); |
|
1506 CleanupStack::PopAndDestroy( emailAddress ); |
|
1507 iContactDetailsClosed = EFalse; |
|
1508 } |
|
1509 else // if contact wasn't open from email |
|
1510 { |
|
1511 // Try to bring calling external app into foreground if found |
|
1512 TApaTaskList taskList( session ); |
|
1513 TApaTask contAppTask = taskList.FindApp( TUid::Uid( KPbkUID3 ) ); |
|
1514 if ( contAppTask.Exists() ) |
|
1515 { |
|
1516 contAppTask.BringToForeground(); |
|
1517 iContactDetailsClosed = EFalse; |
|
1518 } |
|
1519 } |
|
1520 } |
|
1521 |
|
1522 |
|
1523 // --------------------------------------------------------------------------- |
1435 // CFSEmailUiContactHandler::FindContactLinkL |
1524 // CFSEmailUiContactHandler::FindContactLinkL |
1436 // Searches contacts matching with the given email address |
1525 // Searches contacts matching with the given email address |
1437 // --------------------------------------------------------------------------- |
1526 // --------------------------------------------------------------------------- |
1438 // |
1527 // |
1439 void CFSEmailUiContactHandler::FindContactLinkL( const TDesC& aDes ) |
1528 void CFSEmailUiContactHandler::FindContactLinkL( const TDesC& aDes ) |
1452 { |
1541 { |
1453 FUNC_LOG; |
1542 FUNC_LOG; |
1454 iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); |
1543 iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); |
1455 iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK ); |
1544 iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK ); |
1456 iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME ); |
1545 iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME ); |
1457 |
1546 |
1458 iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
1547 iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
1459 iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); |
1548 iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); |
1460 |
1549 |
1461 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME ); |
1550 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME ); |
1462 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ); |
1551 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ); |
1463 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ); |
1552 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ); |
1464 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK ); |
1553 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK ); |
1465 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN ); |
1554 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN ); |
1466 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); |
1555 iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); |
1467 |
|
1468 } |
1556 } |
1469 |
1557 |
1470 void CFSEmailUiContactHandler::ResetFieldIds() |
1558 void CFSEmailUiContactHandler::ResetFieldIds() |
1471 { |
1559 { |
1472 FUNC_LOG; |
1560 FUNC_LOG; |
1476 iPhoneNumberFields.Reset(); |
1564 iPhoneNumberFields.Reset(); |
1477 } |
1565 } |
1478 |
1566 |
1479 |
1567 |
1480 // ----------------------------------------------------------------------------- |
1568 // ----------------------------------------------------------------------------- |
1481 // CFSEmailUiContactHandler::LaunchRemoteLookupL |
1569 // CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL |
1482 // ----------------------------------------------------------------------------- |
1570 // ----------------------------------------------------------------------------- |
1483 TBool CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL( CFSMailBox& aMailBox, |
1571 TBool CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL( CFSMailBox& aMailBox, |
1484 const TDesC& aQueryString, TDes& aDisplayname, TDes& aEmailAddress ) |
1572 const TDesC& aQueryString, TDes& aDisplayname, TDes& aEmailAddress ) |
1485 { |
1573 { |
1486 FUNC_LOG; |
1574 FUNC_LOG; |
1511 CPbkxRemoteContactLookupServiceUiContext::EModeNormal ); |
1600 CPbkxRemoteContactLookupServiceUiContext::EModeNormal ); |
1512 |
1601 |
1513 } |
1602 } |
1514 |
1603 |
1515 // ----------------------------------------------------------------------------- |
1604 // ----------------------------------------------------------------------------- |
1516 // CFSEmailUiContactHandler::LaunchRemoteLookupL |
1605 // CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL |
1517 // ----------------------------------------------------------------------------- |
1606 // ----------------------------------------------------------------------------- |
1518 HBufC* CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL( |
1607 HBufC* CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL( |
1519 CFSMailBox& aMailBox, const TDesC& aQuery, RBuf& aPhoneNumber ) |
1608 CFSMailBox& aMailBox, const TDesC& aQuery, RBuf& aPhoneNumber ) |
1520 { |
1609 { |
1521 FUNC_LOG; |
1610 FUNC_LOG; |
1562 void CFSEmailUiContactHandler::Reset() |
1651 void CFSEmailUiContactHandler::Reset() |
1563 { |
1652 { |
1564 FUNC_LOG; |
1653 FUNC_LOG; |
1565 iContactObjects.ResetAndDestroy(); |
1654 iContactObjects.ResetAndDestroy(); |
1566 iState = EContactHandlerIdle; |
1655 iState = EContactHandlerIdle; |
|
1656 delete iCurrentLink; |
|
1657 iCurrentLink = NULL; |
1567 delete iLinksSet; |
1658 delete iLinksSet; |
1568 iLinksSet = NULL; |
1659 iLinksSet = NULL; |
1569 delete iLinkOperation; |
1660 delete iLinkOperation; |
1570 iLinkOperation = NULL; |
1661 iLinkOperation = NULL; |
1571 delete iLinkOperationFetch; |
1662 delete iLinkOperationFetch; |
1874 void CFSEmailUiContactHandler::ClearObservers() |
1965 void CFSEmailUiContactHandler::ClearObservers() |
1875 { |
1966 { |
1876 iHandlerObserver = NULL; |
1967 iHandlerObserver = NULL; |
1877 } |
1968 } |
1878 |
1969 |
1879 // <cmail> call observer's MFSEmailUiContactHandlerObserver::OperationErrorL( TContactHandlerCmd aCmd, TInt aError ) |
1970 // Call observer's MFSEmailUiContactHandlerObserver::OperationErrorL( TContactHandlerCmd aCmd, TInt aError ) |
1880 void CFSEmailUiContactHandler::ObserverOperationErrorL( TContactHandlerCmd aCmd, TInt aErrorCode ) |
1971 void CFSEmailUiContactHandler::ObserverOperationErrorL( TContactHandlerCmd aCmd, TInt aErrorCode ) |
1881 { |
1972 { |
1882 if( ( iHandlerObserver ) && ( KErrNone != aErrorCode ) ) |
1973 if( ( iHandlerObserver ) && ( KErrNone != aErrorCode ) ) |
1883 { |
1974 { |
1884 iHandlerObserver->OperationErrorL( aCmd, aErrorCode ); |
1975 iHandlerObserver->OperationErrorL( aCmd, aErrorCode ); |