tizen2.1 code merge
[apps/osp/Call.git] / src / CallIncomingCallForm.cpp
index f68fba0..103136a 100644 (file)
@@ -19,7 +19,6 @@
  * @brief      Incoming Call form implementation
  */
 #include <FBaseColIList.h>
-#include <FMessaging.h>
 #include "CallIncomingCallForm.h"
 #include "CallAppUtility.h"
 #include "CallSettingsManager.h"
@@ -32,7 +31,6 @@ using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Graphics;
-using namespace Tizen::Messaging;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
 using namespace Tizen::Ui::Controls;
@@ -138,16 +136,6 @@ const wchar_t* IDI_REJECT_ARROW_VISUAL_ELE_NAME = L"RejectArrowVisEle";
 const wchar_t* IDI_REJECT_FINAL_VISUAL_ELE_NAME = L"RejectFinalVisEle";
 const wchar_t* IDI_ACCEPT_FINAL_VISUAL_ELE_NAME = L"AcceptFinalVisEle";
 
-class SmsListener
-       : public Object
-       , public ISmsListener
-{
-public:
-               void  OnSmsMessageSent(result r)
-               {
-               }
-};
-
 IncomingCallForm::IncomingCallForm(void)
        : BaseForm(FORMTYPE_INCOMINGCALL)
 {
@@ -595,7 +583,7 @@ IncomingCallForm::ShowRejectMessagePanel(void)
                        pButtonReject->SetActionId(IDA_CANCEL_REJECT_CALL_MESSAGE_PANEL);
                        pButtonReject->AddActionEventListener(*this);
                        pButtonReject->SetEnabled(true);
-                       pButtonReject->SetFocus();
+                       //pButtonReject->SetFocus();
 
                        ShowRejectMessageFooter();
 
@@ -666,42 +654,12 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
        case IDA_SEND_REJECT_MSG6:
        {
                __pCallPresentor->RejectCall(__incomingCallHandle, false,*__pActiveContactNo);
-               SmsListener* pSmsListener = new (std::nothrow) SmsListener();
-               SmsManager* pSmsManager = new (std::nothrow) SmsManager();
-               result r = pSmsManager->Construct(*pSmsListener);
-               if (IsFailed(r) == false)
-               {
-                       RecipientList recipient;
-                       recipient.Add(RECIPIENT_TYPE_TO,*__pActiveContactNo);
-                       SmsMessage smsMessage;
-                       String textToBeSent;
-                       //calculate msgIndex
-                       int msgIndex = IDA_SEND_REJECT_MSG1;
-                       msgIndex = actionId - msgIndex;
-                       __pRejectMessageList->GetAt(msgIndex, textToBeSent);
-                       r = smsMessage.SetText(textToBeSent);
-                       if (IsFailed(r) == false)
-                       {
-                               r = pSmsManager->Send(smsMessage,recipient,true);
-                               if (IsFailed(r) == true)
-                               {
-                                       //todo: error message
-                               }
-                       }
-                       else
-                       {
-                               //todo: error message
-                       }
-               }
-               else
-               {
-                       //todo: error message
-               }
-               delete pSmsListener;
-               delete pSmsManager;
-               /*ArrayListT<CallInfo>* pCallList  = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
-               __pCallPresentor->HandleCallConnected(*pCallList);
-               pCallList = null;*/
+               String textToBeSent;
+               //calculate msgIndex
+               int msgIndex = IDA_SEND_REJECT_MSG1;
+               msgIndex = actionId - msgIndex;
+               __pRejectMessageList->GetAt(msgIndex, textToBeSent);
+               __pCallPresentor->SendMessage(textToBeSent,*__pActiveContactNo);
        }
        break;
 
@@ -840,9 +798,10 @@ IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,        const SceneI
                pButtonRejectMessage->SetActionId(IDA_SHOW_REJECT_CALL_MESSAGE_PANEL);
                pButtonRejectMessage->AddActionEventListener(*this);
        }
+
        //This called here to handle the case when incoming call comes when
        // add call is in foreground.
-       __pCallPresentor->OnAppForeground();
+       //__pCallPresentor->OnAppForeground();
 
 }
 
@@ -1612,7 +1571,7 @@ void
 IncomingCallForm::OnForeground(void)
 {
        AppLogDebug("Enter");
-       __pCallPresentor->OnAppForeground();
+//     __pCallPresentor->OnAppForeground();
 }
 
 void