//
// 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
//
* @brief Conference caller list form
*/
#include <FSystem.h>
+#include "CallApp.h"
#include "CallConfCallerListForm.h"
#include "CallAppUtility.h"
#include "CallPresentationModel.h"
static const wchar_t* IDC__LINE_LABEL4 = L"IDC__LINE_LABEL4";
static const wchar_t* IDC_CALLER5_PANEL = L"IDC_CALLER5_PANEL";
static const wchar_t* IDC__LINE_LABEL5 = L"IDC__LINE_LABEL5";
-static const wchar_t* IDC_END_CALLER1 = L"IDC_END_CALLER1";
-static const wchar_t* IDC_SPLIT_CALLER1 = L"IDC_SPLIT_CALLER1";
-static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
-static const wchar_t* IDC_END_CALLER2 = L"IDC_END_CALLER2";
-static const wchar_t* IDC_SPLIT_CALLER2 = L"IDC_SPLIT_CALLER2";
-static const wchar_t* IDC_CALLER2_LABEL = L"IDC_CALLER2_LABEL";
-static const wchar_t* IDC_END_CALLER3 = L"IDC_END_CALLER3";
-static const wchar_t* IDC_SPLIT_CALLER3 = L"IDC_SPLIT_CALLER3";
-static const wchar_t* IDC_CALLER3_LABEL = L"IDC_CALLER3_LABEL";
-static const wchar_t* IDC_END_CALLER4 = L"IDC_END_CALLER4";
-static const wchar_t* IDC_SPLIT_CALLER4 = L"IDC_SPLIT_CALLER4";
-static const wchar_t* IDC_CALLER4_LABEL = L"IDC_CALLER4_LABEL";
-static const wchar_t* IDC_END_CALLER5 = L"IDC_END_CALLER5";
-static const wchar_t* IDC_SPLIT_CALLER5 = L"IDC_SPLIT_CALLER5";
-static const wchar_t* IDC_CALLER5_LABEL = L"IDC_CALLER5_LABEL";
static const wchar_t* IDC_CONF_CALL_LIST_TABLEVIEW = L"IDC_CONF_CALL_LIST_TABLEVIEW";
//color
{
__pConfCallInfo = null;
__pConfCallTimer = null;
+ __isCallSplit = false;
+ __pAddressbook = null;
}
ConfCallerListForm::~ConfCallerListForm(void)
if(pFooter != null)
{
SetFormBackEventListener(this);
- pFooter->SetBackButton();
}
+ Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
+ SetControlAlwaysOnTop(*pTimerLbl,true);
CreateTableView();
__pCallPresentor = CallPresentationModel::GetInstance();
{
__pList = static_cast <TableView*> (GetControl(IDC_CONF_CALL_LIST_TABLEVIEW));
__pList->SetItemProvider(this);
- AddControl(*__pList);
+ AddControl(__pList);
}
void
__pConfCallInfo = null;
}
- RemoveAllControls();
+ //RemoveAllControls();
return r;
}
//If success, then invert the Hold status in conference call
isCallOnHold = !(isCallOnHold);
__pConfCallInfo->SetOnHold(isCallOnHold);
- //update panels and Hold button status
- ActivatePanels();
+ //update tableview
+ __pList->UpdateTableView();
SetHoldButtonStatus(isCallOnHold);
}
}
case IDA_BACK_EVENT:
{
- ArrayListT<CallInfo>* pCallList = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
+ ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
int noOfCalls = pCallList->GetCount();
//Ownership - To be deleted in 'OnSceneActivatedN' of next form
for (int index = 0; index < noOfCalls; index++)
{
//fetch call info and add to list
- CallInfo callInfo;
+ AppCallInfo callInfo;
result r = pCallList->GetAt(index, callInfo);
if (r == E_SUCCESS)
{
//copy call information to new instance
- CallInfo* pCaller = new (std::nothrow) CallInfo();
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
*pCaller = callInfo;
pCallInfoList->Add(pCaller);
}
if (noOfCalls == 1)
{
//single active call - goto active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
else
{
//goto multiple active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
pCallList->RemoveAll();
delete pCallList;
{
break;
}
- __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
+ __isCallSplit = __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
+ if(__isCallSplit == true)
+ {
+ __pList->UpdateTableView();
+ }
}
break;
case IDA_END_CALLER4:
case IDA_END_CALLER5:
{
+ __pList->SetEnabled(false);
// User has pressed end conference call and we are waiting for TAPI response
if(__pConfCallInfo == null)
{
{
//set itself as listener
__pCallPresentor->SetTelEventListener(this);
+ __isCallSplit = false;
- AddOrientationEventListener(*this);
+ AppLogDebug("Enter");
//DisableAllControls();
if (__pConfCallInfo != null)
//show 1st caller's info.
//Fetch Conference call info from telephony manager
__pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
+ AppLogDebug("Enter %x",__pConfCallInfo);
+
+ AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
+ __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
+ if(__pAddressbook != null)
+ {
+ __pAddressbook->SetAddressbookChangeEventListener(this);
+ }
//show active call timer
- ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
+// ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
+ ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetDurationTime());
//Set the correct bitmap to the "hold" button based on the current state of the call
SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
}
__pList->UpdateTableView();
- //ActivatePanels();
+ __pList->SetEnabled(true);
+ AddOrientationEventListener(*this);
}
void
ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
{
RemoveOrientationEventListener(*this);
- if (__pConfCallInfo != null)
- {
- delete __pConfCallInfo;
- __pConfCallInfo = null;
- }
if (__pConfCallTimer != null)
{
__pConfCallTimer->Cancel();
delete __pConfCallTimer;
__pConfCallTimer = null;
}
+ if(__pAddressbook != null)
+ {
+ __pAddressbook->SetAddressbookChangeEventListener(null);
+ }
}
result
void
ConfCallerListForm::HandleParticipantsChanged(void)
{
- CallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
+ AppLogDebug("Enter");
+ AppCallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
if (pCallInfo == null)
{
return;
delete __pConfCallInfo;
__pConfCallInfo = null;
}
- __pConfCallInfo = new (std::nothrow) CallInfo();
+ __pConfCallInfo = new (std::nothrow) AppCallInfo();
*__pConfCallInfo = *pCallInfo;
- //Disable all key panels and redraw with new caller list
- //DisableAllControls();
- //ActivatePanels();
__pList->UpdateTableView();
+ __pList->SetEnabled(true);
}
void
}
void
-ConfCallerListForm::ActivatePanels(void)
-{
- IListT<CallInfo>* pCallList = __pConfCallInfo->GetCallerList();
- int confCallCount = pCallList->GetCount();
-
- for (int index = 0; index < confCallCount; index++)
- {
- CallInfo callInfo;
- String pContactNo;
- result r = pCallList->GetAt(index, callInfo);
- if(callInfo.GetContactNumber().IsEmpty() == false)
- {
- pContactNo.Append(callInfo.GetContactNumber());
- }
- else
- {
- pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
- }
-
- //fetch contact details based on phone number
- String* pDisplayName = callInfo.FetchCallerNameN();
-
- if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
- {
- pDisplayName->Append(pContactNo);
- }
-
- switch (index)
- {
- case 0:
- {
- ActivatePanelAndAddActionListener(IDC_CALLER1_PANEL,IDC__LINE_LABEL1,IDC_SPLIT_CALLER1,IDC_END_CALLER1
- ,IDC_CALLER1_LABEL,IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
- }
- break;
-
- case 1:
- {
- ActivatePanelAndAddActionListener(IDC_CALLER2_PANEL,IDC__LINE_LABEL2,IDC_SPLIT_CALLER2,IDC_END_CALLER2
- ,IDC_CALLER2_LABEL,IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
- }
- break;
-
- case 2:
- {
- ActivatePanelAndAddActionListener(IDC_CALLER3_PANEL,IDC__LINE_LABEL3,IDC_SPLIT_CALLER3,IDC_END_CALLER3
- ,IDC_CALLER3_LABEL,IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
- }
- break;
-
- case 3:
- {
- ActivatePanelAndAddActionListener(IDC_CALLER4_PANEL,IDC__LINE_LABEL4,IDC_SPLIT_CALLER4,IDC_END_CALLER4
- ,IDC_CALLER4_LABEL,IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
- }
- break;
-
- case 4:
- {
- ActivatePanelAndAddActionListener(IDC_CALLER5_PANEL,IDC__LINE_LABEL5,IDC_SPLIT_CALLER5,IDC_END_CALLER5
- ,IDC_CALLER5_LABEL,IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
- }
- break;
-
- default:
- break;
- }
-
- delete pDisplayName;
- pDisplayName = null;
- }
-}
-
-void
-ConfCallerListForm::ActivatePanelAndAddActionListener( const String& panelName, const String& lineLabelName, const String& splitButtonName,
- const String& endButtonName, const String& callerLabelName, SplitConfCallerCmdIds splitCmdId,
- EndConfCallerCmdIds EndCmdId, const String& displayName)
-{
- Bitmap* pNormalSplitBitmap = null;
- Bitmap* pPressSplitBitmap = null;
-
-
- Bitmap* pNormalEndBitmap = null;
- Bitmap* pPressEndBitmap = null;
-
-
-
- pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
- W_SPLIT_BITMAP, H_SPLIT_BITMAP);
- pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
- W_SPLIT_BITMAP, H_SPLIT_BITMAP);
- pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
- W_END_BITMAP, H_END_BITMAP);
- pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
- W_END_BITMAP, H_END_BITMAP);
-
- bool isSplitAllowed = true;
- if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true))
- {
- isSplitAllowed = false;
- }
-
- Panel* pKeysPanel = static_cast<Panel*>(GetControl(panelName));
- if (pKeysPanel != null)
- {
- Button* pButtonSplit = static_cast<Button*>(pKeysPanel->GetControl(splitButtonName));
- if (pButtonSplit != null)
- {
- pButtonSplit->SetActionId(splitCmdId);
- pButtonSplit->AddActionEventListener(*this);
- pButtonSplit->SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
- pButtonSplit->SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
- }
- Button* pButtonEnd = static_cast<Button*>(pKeysPanel->GetControl(endButtonName));
- if (pButtonEnd != null)
- {
- pButtonEnd->SetActionId(EndCmdId);
- pButtonEnd->AddActionEventListener(*this);
- pButtonEnd->SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
- pButtonEnd->SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
- }
- Label* pNameLabel = static_cast<Label*>(pKeysPanel->GetControl(callerLabelName));
- if (pButtonSplit != null)
- {
- if (isSplitAllowed == false)
- {
- pButtonSplit->SetShowState(false);
- pNameLabel->SetBounds(pButtonSplit->GetBounds().x, pNameLabel->GetBounds().y,
- pNameLabel->GetBounds().width, pNameLabel->GetBounds().height);
- }
- else
- {
- pButtonSplit->SetShowState(true);
- pNameLabel->SetBounds((pButtonSplit->GetBounds().x + pButtonSplit->GetBounds().width), pNameLabel->GetBounds().y,
- pNameLabel->GetBounds().width, pNameLabel->GetBounds().height);
- }
- }
- pNameLabel->SetText(displayName);
-
- pKeysPanel->SetShowState(true);
- Label* pLineLabel1 = static_cast<Label*>(GetControl(lineLabelName));
- pLineLabel1->SetShowState(true);
-
- pKeysPanel->Draw(true);
- pKeysPanel->Show();
- }
-
- delete pNormalEndBitmap;
- pNormalEndBitmap = null;
- delete pPressEndBitmap;
- pPressEndBitmap = null;
- delete pNormalSplitBitmap;
- pNormalSplitBitmap = null;
- delete pPressSplitBitmap;
- pPressSplitBitmap = null;
-}
-
-void
ConfCallerListForm::ShowTimerInfo(const String& timerLblName, long long startTime)
{
Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
{
//current system time
long long currTime = 0;
- SystemTime::GetTicks(currTime);
+ //SystemTime::GetTicks(currTime);
+ CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+ currTime = pPhoneApp->GetCallAppTicks();
//Set call duration
TimeSpan diffSpan(abs(startTime - currTime));
void
ConfCallerListForm::OnFormBackRequested(Form& source)
{
+ //If the call is split then wait for it to automatically go back once it split is success
+ if(__isCallSplit == true)
+ {
+ return;
+ }
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
- ArrayListT<CallInfo>* pCallList = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
+
+ ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
int noOfCalls = pCallList->GetCount();
//Ownership - To be deleted in 'OnSceneActivatedN' of next form
for (int index = 0; index < noOfCalls; index++)
{
//fetch call info and add to list
- CallInfo callInfo;
+ AppCallInfo callInfo;
result r = pCallList->GetAt(index, callInfo);
if (r == E_SUCCESS)
{
//copy call information to new instance
- CallInfo* pCaller = new (std::nothrow) CallInfo();
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
*pCaller = callInfo;
pCallInfoList->Add(pCaller);
}
if (noOfCalls == 1)
{
//single active call - goto active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
else
{
//goto multiple active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
}
pCallList->RemoveAll();
delete pCallList;
}
void
+ConfCallerListForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList)
+{
+ __pList->UpdateTableView();
+}
+
+void
+ConfCallerListForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList)
+{
+ //No implementation
+}
+
+void
ConfCallerListForm::CreateItemAndAddActionListener( Button& splitButton,
Button& endButton, Label& callerLabel, SplitConfCallerCmdIds splitCmdId,
EndConfCallerCmdIds EndCmdId, const String& displayName)
W_END_BITMAP, H_END_BITMAP);
bool isSplitAllowed = true;
- if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true))
+ if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true) || (__isCallSplit == true))
{
isSplitAllowed = false;
}
splitButton.SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
-
+ bool isEnableEndButton = (__isCallSplit == false);
+ endButton.SetEnabled(isEnableEndButton);
endButton.SetActionId(EndCmdId);
endButton.AddActionEventListener(*this);
endButton.SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
int
ConfCallerListForm::GetItemCount(void)
{
- IListT<CallInfo>* pCallList = __pConfCallInfo->GetCallerList();
+ IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
return pCallList->GetCount();
}
TableViewItem*
ConfCallerListForm::CreateItem(int itemIndex, int itemWidth)
{
- IListT<CallInfo>* pCallList = __pConfCallInfo->GetCallerList();
+ AppLogDebug("%d %x",itemWidth,__pConfCallInfo);
+ IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
TableViewItem* pItem = new (std::nothrow) TableViewItem();
pEndCallButton->Construct(Rectangle(GetBounds().width-X_END_BUTTON_PADDING-W_SPLIT_BITMAP,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
- CallInfo callInfo;
+ AppCallInfo callInfo;
String pContactNo;
result r = pCallList->GetAt(itemIndex, callInfo);
pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
}
//fetch contact details based on phone number
- String* pDisplayName = callInfo.FetchCallerNameN();
+ String* pDisplayName = callInfo.FetchLatestCallerNameN(pContactNo);
- if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
+ if(pDisplayName != null)
{
- pDisplayName->Append(pContactNo);
- }
- switch (itemIndex)
- {
- case 0:
- {
- CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
- IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
- }
- break;
- case 1:
- {
- CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
- IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
- }
- break;
- case 2:
- {
- CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
- IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
- }
- break;
- case 3:
+ if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
{
- CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
- IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
+ pDisplayName->Append(pContactNo);
}
- break;
- case 4:
+ switch (itemIndex)
{
- CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
- IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
- }
- break;
- default:
+ case 0:
+ {
+ CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
+ IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
+ }
+ break;
+ case 1:
+ {
+ CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
+ IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
+ }
+ break;
+ case 2:
+ {
+ CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
+ IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
+ }
+ break;
+ case 3:
+ {
+ CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
+ IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
+ }
+ break;
+ case 4:
+ {
+ CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
+ IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
+ }
break;
+ default:
+ break;
+ }
+ }
+ pItem->AddControl(pSplitCallButton);
+ pItem->AddControl(pCallLabel);
+ pItem->AddControl(pEndCallButton);
+ if(pDisplayName != null)
+ {
+ delete pDisplayName;
+ pDisplayName = null;
}
- pItem->AddControl(*pSplitCallButton);
- pItem->AddControl(*pCallLabel);
- pItem->AddControl(*pEndCallButton);
return pItem;
bool
ConfCallerListForm::DeleteItem(int itemIndex, TableViewItem* pItem)
{
- return false;
+ delete pItem;
+ pItem = null;
+ return true;
}
void