1.Changed appcontrol parameters of contacts 2.GUI changes 3.Changes to alert tone...
[apps/osp/Call.git] / src / CallIncomingCallForm.cpp
index f4ec54e..85b0e36 100644 (file)
@@ -732,6 +732,9 @@ void
 IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,    const SceneId& currentSceneId, IList* pArgs)
 {
        AddOrientationEventListener(*this);
+       //listen to Foreground events
+       CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+       pPhoneApp->AddAppStateChangeListener(*this);
        if(__pCallPresentor == null)
        {
                __pCallPresentor = CallPresentationModel::GetInstance();
@@ -868,6 +871,7 @@ IncomingCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneI
        }
        CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
        pCallApp->SetTopMostWindow(false);
+       pCallApp->RemoveAppStateChangeListener(*this);
 }
 
 result
@@ -1311,9 +1315,10 @@ IncomingCallForm::OnTouchPressed(const Control& source, const Point& currentPosi
 void
 IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo)
 {
+       AppLogDebug("%d",currentPosition.x);
        if (__isAnswerCallStarted == true)
        {
-               if (currentPosition.x > REJECT_LABEL_X_OFFSET)
+               if (currentPosition.x > __pRejectLabel->GetBounds().x)
                {
                        //Right reject icon
                        if(__pRejectFinalVisElem == null)
@@ -1388,7 +1393,7 @@ IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPos
        }
        else if (__isRejectCallStarted == true)
        {
-               if (currentPosition.x < ACCEPT_LABEL_RELATIVE_POS)
+               if (currentPosition.x < ((__pAcceptLabel->GetBounds().x + __pAcceptLabel->GetWidth())- __pRejectLabel->GetBounds().x))
                {
                        //left dial icon
                        if(__pAcceptFinalVisElem == null)
@@ -1581,3 +1586,9 @@ IncomingCallForm::OnOrientationChanged(const Control& source, OrientationStatus
        }
 
 }
+
+void
+IncomingCallForm::OnForeground(void)
+{
+       __pCallPresentor->OnAppForeground();
+}