X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FCallEndCallForm.cpp;h=deabc22c650ac5bdad47157a085f11689aee6829;hb=f94bb5a5a48a453368b9941e9bf373f0fbe2e797;hp=ae7ada82f9b2bad0da847ca2f68286375e3442ae;hpb=968ce47ae7a353e2ad110ef3b64be43d5c9b0b36;p=apps%2Fosp%2FCall.git diff --git a/src/CallEndCallForm.cpp b/src/CallEndCallForm.cpp index ae7ada8..deabc22 100644 --- a/src/CallEndCallForm.cpp +++ b/src/CallEndCallForm.cpp @@ -1,7 +1,7 @@ // // Copyright (c) 2012 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Flora License, Version 1.1 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // @@ -53,6 +53,10 @@ static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL"; static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL"; static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL"; static const wchar_t* IDB_END_CALL_DEFAULT_ICON = L"C01-1_call_default_caller ID_720x720.png"; +static const wchar_t* IDC_VOICECALL_BUTTON = L"IDC_VOICECALL_BUTTON"; +static const wchar_t* IDC_VIDEOCALL_BUTTON = L"IDC_VIDEOCALL_BUTTON"; +static const wchar_t* IDC_ADD_TO_CONTACT_BUTTON = L"IDC_ADD_TO_CONTACT_BUTTON"; +static const wchar_t* IDC_MSG_BUTTON = L"IDC_MSG_BUTTON"; EndCallForm::EndCallForm(void) @@ -115,7 +119,7 @@ EndCallForm::InitializeCallButtonsPanel(void) __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel(); __pCallButtonsPanel->ConstructPanel(this, FORMTYPE_ENDCALL); __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds()); - AddControl(*__pCallButtonsPanel); + AddControl(__pCallButtonsPanel); } RelativeLayout* pRelativeLayout = dynamic_cast(GetPortraitLayoutN()); @@ -164,6 +168,11 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId) { case IDA_VOICE_CALL: { + if (__isMsgAppControlLaunched == true) + { + //AppControl already launched. + return; + } //check if EndCallTimer is running, then cancel it if(__pEndCallEventTimer != null) { @@ -180,6 +189,22 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId) bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted(); if (isSimInitialized) { + //Disable all buttons + Button* pButton = static_cast(GetControl(IDC_VIDEOCALL_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_VOICECALL_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true)); + if(pButton->GetShowState() == true) + { + pButton->SetEnabled(false); + pButton->Invalidate(true); + } + pButton = static_cast(GetControl(IDC_MSG_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); //Check if dialing an emergency call bool isEmergencyCall = __pCallPresentor->IsEmergencyNumber(*contactTxt, true); if (isEmergencyCall) @@ -216,6 +241,19 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId) { //cancel EndCallTimer, if AppControl request was successful. __pEndCallEventTimer->Cancel(); + //Disable the call buttons + Button* pButton = static_cast(GetControl(IDC_VIDEOCALL_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_VOICECALL_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true)); + if(pButton->GetShowState() == true) + { + pButton->SetEnabled(false); + pButton->Invalidate(true); + } } } break; @@ -229,6 +267,21 @@ EndCallForm::OnActionPerformed(const Control& source, int actionId) return; } HandleAddToContacts(); + Button* pButton = static_cast(GetControl(IDC_VIDEOCALL_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_VOICECALL_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true)); + if(pButton->GetShowState() == true) + { + pButton->SetEnabled(false); + pButton->Invalidate(true); + } + pButton = static_cast(GetControl(IDC_MSG_BUTTON,true)); + pButton->SetEnabled(false); + pButton->Invalidate(true); } break; @@ -340,7 +393,10 @@ EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cu } else if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING) { - __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true); + if(pEndCall->GetContactNumber().IsEmpty() == false) + { + __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true); + } } } @@ -362,6 +418,8 @@ EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cu delete pArgs; pArgs = null; } + CallApp* pCallApp = static_cast(CallApp::GetInstance()); + pCallApp->SetTopMostWindow(false); AddOrientationEventListener(*this); } @@ -526,7 +584,7 @@ EndCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId) { if (__pSmallPhotoLabel != null) { - RemoveControl(*__pSmallPhotoLabel); + RemoveControl(__pSmallPhotoLabel); __pSmallPhotoLabel = null; } //Draw Small Photo and show on small photo label @@ -535,7 +593,7 @@ EndCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId) __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0)); __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId); // Add a Label to the Form - AddControl(*__pSmallPhotoLabel); + AddControl(__pSmallPhotoLabel); __pSmallPhotoLabel->Invalidate(true); } @@ -633,6 +691,22 @@ EndCallForm::OnForeground(void) } __pCallPresentor->AppControlRequestCompleted(); } + //Enable all buttons + Button* pButton = static_cast(GetControl(IDC_VIDEOCALL_BUTTON,true)); + pButton->SetEnabled(true); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_VOICECALL_BUTTON,true)); + pButton->SetEnabled(true); + pButton->Invalidate(true); + pButton = static_cast(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true)); + if(pButton->GetShowState() == true) + { + pButton->SetEnabled(true); + pButton->Invalidate(true); + } + pButton = static_cast(GetControl(IDC_MSG_BUTTON,true)); + pButton->SetEnabled(true); + pButton->Invalidate(true); AppLogDebug("Exit"); }