X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FCallActiveCallForm.cpp;h=13720a7685ed4fbbdad2e90671047d80e050f1c6;hb=ad7d6e62039a82ed49165dea1f78f00ee4217ff7;hp=5e40ede828e4d312dc856efe27e43dda8322eec2;hpb=1e992b05445971bc6b374f1f35e1ef0402dfd26b;p=apps%2Fosp%2FCall.git diff --git a/src/CallActiveCallForm.cpp b/src/CallActiveCallForm.cpp index 5e40ede..13720a7 100644 --- a/src/CallActiveCallForm.cpp +++ b/src/CallActiveCallForm.cpp @@ -110,6 +110,7 @@ ActiveCallForm::ActiveCallForm(FormType formType) __pActiveCallInfo = null; __pHeldCallInfo = null; __isSwapInProgress = false; + __pAddressbook == null; } ActiveCallForm::~ActiveCallForm(void) @@ -895,6 +896,14 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& //Initialize keypad and buttons InitializeCallButtonsPanel(); + AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance(); + __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID); + if(__pAddressbook != null) + { + __pAddressbook->SetAddressbookChangeEventListener(this); + } + + if (__pActiveCallInfo != null) { delete __pActiveCallInfo; @@ -1104,6 +1113,10 @@ ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& __DtmfString.Clear(); CallApp* pCallApp = static_cast(CallApp::GetInstance()); pCallApp->RemoveAppStateChangeListener(*this); + if(__pAddressbook != null) + { + __pAddressbook->SetAddressbookChangeEventListener(null); + } } void @@ -1177,6 +1190,135 @@ ActiveCallForm::HandleConfCallChanged(void) } void +ActiveCallForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList) +{ + AppLog("Enter"); + switch (__formType) + { + + case FORMTYPE_EMERGENCYOUTGOINGCALL: + { + } + break; + + case FORMTYPE_OUTGOINGCALL: + case FORMTYPE_ACTIVECALL: + { + String pContactNumber; + pContactNumber.Append(__pActiveCallInfo->GetContactNumber()); + Contact* pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber()); + if(pContact == null) + { + __pActiveCallInfo->ResetContactNumber(null); + __pActiveCallInfo->ResetContactInfo(null); + + } + else + { + __pActiveCallInfo->SetContactNumber(pContactNumber); + __pActiveCallInfo->SetContactInfo(*pContact); + } + if(pContact != null) + { + delete pContact; + pContact = null; + } + ShowPersonDetails(pContactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo); + } + break; + + case FORMTYPE_EMERGENCYACTIVECALL: + { + } + break; + + case FORMTYPE_MULTIPLECALLS: + { + + IListT* pCallsList = __pCallPresentor->GetCallListN(); + int listCount = pCallsList->GetCount(); + for(int index = 0; index < listCount; index++) + { + AppCallInfo callInfo; + Contact* pContact; + pCallsList->GetAt(index, callInfo); + if(__pActiveCallInfo == null) + { + __pActiveCallInfo = new (std::nothrow) AppCallInfo(); + } + *__pActiveCallInfo = callInfo; + String contactNumber; + contactNumber.Append(__pActiveCallInfo->GetContactNumber()); + pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber()); + if(pContact == null) + { + __pActiveCallInfo->ResetContactNumber(null); + __pActiveCallInfo->ResetContactInfo(null); + + } + else + { + __pActiveCallInfo->SetContactNumber(contactNumber); + __pActiveCallInfo->SetContactInfo(*pContact); + } + if(pContact != null) + { + delete pContact; + pContact = null; + } + if(callInfo.IsOnHold() == false) + { + ShowPersonDetails(contactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo); + } + else + { + ShowPersonDetails(contactNumber, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pActiveCallInfo); + } + + } + if(pCallsList != null) + { + delete pCallsList; + pCallsList = null; + } + //pCallsList = __pCallPresentor->GetCallListN(); + //update calls state + //UpdateMultipleCallScreen(*pCallsList); + //delete pCallsList; + //pCallsList = null; + } + break; + + case FORMTYPE_ACTIVECONFCALL: + { + int participantsCount = __pActiveCallInfo->GetCallerListCount(); + IListT* pParticipantListCallHandles = __pActiveCallInfo->GetCallerList(); + for(int listCount = 0; listCount < participantsCount; listCount++) + { + + } + + } + break; + + default: + break; + } + + + + + AppLog("Exit"); +} + +void +ActiveCallForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList) +{ + //No implementation +} + + +void ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT& activeCallsList) { AppLog("ENTER"); @@ -1332,14 +1474,16 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListTFetchCallerNameN(); + String* pDisplayName = pCallInfo->FetchLatestCallerNameN(phoneNumber); ShowCallerName(*pDisplayName, nameLblName); - Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN(); + Bitmap* pPhotoBitmap = pCallInfo->FetchLatestCallerPhotoN(phoneNumber); ShowCallerPhoto(pPhotoBitmap, isSecondCaller); //free resources @@ -1517,6 +1661,7 @@ ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller) if (pPhotoLbl) { pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto); + pPhotoLbl->Invalidate(true); } delete pDefaultPhoto; }