//
// 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
//
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)
__pSmallPhotoLabel = null;
__isMsgAppControlLaunched = false;
__isContactAppControlLaunched = false;
- __isContactPresent = false;
}
EndCallForm::~EndCallForm(void)
__pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
__pCallButtonsPanel->ConstructPanel(this, FORMTYPE_ENDCALL);
__pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
- AddControl(*__pCallButtonsPanel);
+ AddControl(__pCallButtonsPanel);
}
RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
{
case IDA_VOICE_CALL:
{
+ if (__isMsgAppControlLaunched == true)
+ {
+ //AppControl already launched.
+ return;
+ }
//check if EndCallTimer is running, then cancel it
if(__pEndCallEventTimer != null)
{
bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted();
if (isSimInitialized)
{
+ //Disable all buttons
+ Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+ if(pButton->GetShowState() == true)
+ {
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ }
+ pButton = static_cast<Button*>(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)
{
//cancel EndCallTimer, if AppControl request was successful.
__pEndCallEventTimer->Cancel();
+ //Disable the call buttons
+ Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+ if(pButton->GetShowState() == true)
+ {
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ }
}
}
break;
return;
}
HandleAddToContacts();
+ Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+ if(pButton->GetShowState() == true)
+ {
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
+ }
+ pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
+ pButton->SetEnabled(false);
+ pButton->Invalidate(true);
}
break;
ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,pEndCall);
//If call is hidden means contact number is empty,
//or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button.
- if (pEndCall->GetContactInfo() != null || pEndCall->GetContactNumber().IsEmpty() == true)
+ if (pEndCall->GetContactInfo() != null)
{
+ //Check if contact is deleted in mean time.
Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber());
//before setting check if the contact is deleted
if(pContact != null)
{
- SetContactButtonState(false);
+ ShowViewContactButton();
delete pContact;
pContact = null;
}
else
{
- SetContactButtonState(true);
+ ShowAddContactButton();
}
}
else
{
- SetContactButtonState(true);
+ //Show AddToContact
+ ShowAddContactButton();
}
//Check if call is Emergency call or Hidden call,
{
__pCallButtonsPanel->SetEndCallPanelState(true);
}
+
+ //check if we reached the end call form of an outgoing call then don't show add to contacts
+ if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_OUTGOING)
+ {
+ __pCallButtonsPanel->ShowOrHideAddtoContactsButton(false);
+ }
+ else if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
+ {
+ if(pEndCall->GetContactNumber().IsEmpty() == false)
+ {
+ __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true);
+ }
+ }
+
}
break;
break;
}
- if (__pEndCallEventTimer)
+ //Before starting end call timer check if messaging appcontrol was launched during incoming call
+ if (__pEndCallEventTimer && __pCallPresentor->IsAppControlRunning() == false)
{
__pEndCallEventTimer->Start(IDI_APP_END_TIMER);
}
delete pArgs;
pArgs = null;
}
+ CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
+ pCallApp->SetTopMostWindow(false);
AddOrientationEventListener(*this);
}
}
void
-EndCallForm::SetContactButtonState(bool showState)
+EndCallForm::ShowViewContactButton(void)
{
- __pCallButtonsPanel->SetViewContactButtonStatus(showState);
- __isContactPresent = !showState;
+ __pCallButtonsPanel->ShowViewContactButton();
}
-bool
-EndCallForm::IsContactPresent(void)
+void
+EndCallForm::ShowAddContactButton(void)
{
- return __isContactPresent;
+ __pCallButtonsPanel->ShowAddContactButton();
}
-
void
EndCallForm::ShowPhoneNumber(const String& phoneNumber, const String& lblName)
{
{
if (__pSmallPhotoLabel != null)
{
- RemoveControl(*__pSmallPhotoLabel);
+ RemoveControl(__pSmallPhotoLabel);
__pSmallPhotoLabel = null;
}
//Draw Small Photo and show on small photo label
__pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
__pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
// Add a Label to the Form
- AddControl(*__pSmallPhotoLabel);
+ AddControl(__pSmallPhotoLabel);
__pSmallPhotoLabel->Invalidate(true);
}
__isMsgAppControlLaunched = false;
__pCallPresentor->AppControlRequestCompleted();
}
+ if(__isContactAppControlLaunched == true)
+ {
+ //notify app control completed
+ __isContactAppControlLaunched = false;
+ __pCallPresentor->AppControlRequestCompleted();
+ }
//AppControl completed, goto initial scene if present
//else exit.
HandleLastCallCompletion();
}
if (__pContactNumber != null && __pContactNumber->IsEmpty() == false)
{
+ AppCallInfo* ActiveCallInfo = new (std::nothrow) AppCallInfo();
+ ActiveCallInfo->SetContactNumber(*__pContactNumber);
Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
+ if (pContact != null)
+ {
+ ActiveCallInfo->SetContactInfo(*pContact);
+ }
//before setting check if the contact is deleted
if(pContact != null)
{
- SetContactButtonState(false);
+
+ ShowViewContactButton();
delete pContact;
pContact = null;
}
else
{
- SetContactButtonState(true);
+ ShowAddContactButton();
}
+ ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,ActiveCallInfo);
+ delete ActiveCallInfo;
}
//notify app control completed
__isContactAppControlLaunched = false;
__pCallPresentor->AppControlRequestCompleted();
}
-
- if (__isMsgAppControlLaunched == true)
+ else if (__isMsgAppControlLaunched == true)
{
//Message AppControl request completed.
if(__pEndCallEventTimer != null)
__isMsgAppControlLaunched = false;
__pCallPresentor->AppControlRequestCompleted();
}
+ else if(__pCallPresentor->IsAppControlRunning() == true)
+ {
+ if(__pEndCallEventTimer != null)
+ {
+ __pEndCallEventTimer->Start(2000);
+ }
+ __pCallPresentor->AppControlRequestCompleted();
+ }
+ //Enable all buttons
+ Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
+ pButton->SetEnabled(true);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
+ pButton->SetEnabled(true);
+ pButton->Invalidate(true);
+ pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
+ if(pButton->GetShowState() == true)
+ {
+ pButton->SetEnabled(true);
+ pButton->Invalidate(true);
+ }
+ pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
+ pButton->SetEnabled(true);
+ pButton->Invalidate(true);
AppLogDebug("Exit");
}