2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CallEndCallForm.cpp
19 * @brief End Call form implementation
25 #include "CallAppUtility.h"
26 #include "CallEndCallForm.h"
27 #include "CallButtonsPanel.h"
28 #include "CallPresentationModel.h"
29 #include "CallSceneRegister.h"
30 #include "CallTypes.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Media;
37 using namespace Tizen::Ui;
38 using namespace Tizen::Ui::Controls;
39 using namespace Tizen::Ui::Scenes;
40 using namespace Tizen::Social;
43 const int IDI_APP_END_TIMER = 3000;
44 const int W_PHOTO_LABEL = 720;
45 const int H_PHOTO_LABEL = 720;
46 const int X_PHOTO_LBL = 166;
47 const int Y_PHOTO_LBL = 232;
48 const int W_PHOTO_LBL = 388;
49 const int H_PHOTO_LBL = 388;
50 const int END_CALL_TIMER_VAL = 2000;
51 const int END_CALL_WAIT_TIMER_VAL = 500;
52 static const wchar_t* IDL_END_CALL_FORM = L"IDL_END_CALL_FORM";
53 static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
54 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
55 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
56 static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL";
57 static const wchar_t* IDB_END_CALL_DEFAULT_ICON = L"C01-1_call_default_caller ID_720x720.png";
58 static const wchar_t* IDC_VOICECALL_BUTTON = L"IDC_VOICECALL_BUTTON";
59 static const wchar_t* IDC_VIDEOCALL_BUTTON = L"IDC_VIDEOCALL_BUTTON";
60 static const wchar_t* IDC_ADD_TO_CONTACT_BUTTON = L"IDC_ADD_TO_CONTACT_BUTTON";
61 static const wchar_t* IDC_MSG_BUTTON = L"IDC_MSG_BUTTON";
65 EndCallForm::EndCallForm(void)
66 : BaseForm(FORMTYPE_ENDCALL)
68 __pCallButtonsPanel = null;
69 __pContactNumber = null;
70 __pEndCallEventTimer = null;
71 __pSmallPhotoLabel = null;
72 __isMsgAppControlLaunched = false;
73 __isContactAppControlLaunched = false;
76 EndCallForm::~EndCallForm(void)
78 if (__pEndCallEventTimer != null)
80 __pEndCallEventTimer->Cancel();
81 delete __pEndCallEventTimer;
82 __pEndCallEventTimer = null;
84 if (__pSmallPhotoLabel != null)
86 __pSmallPhotoLabel = null;
91 EndCallForm::Initialize(void)
93 Construct(IDL_END_CALL_FORM);
97 EndCallForm::OnInitializing(void)
101 //initialize keypad and buttons
102 InitializeCallButtonsPanel();
104 __pEndCallEventTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
105 r = __pEndCallEventTimer->Construct(*this);
107 __pCallPresentor = CallPresentationModel::GetInstance();
112 EndCallForm::InitializeCallButtonsPanel(void)
114 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
115 Bitmap* pBgBitmap = AppUtility::GetBitmapFromResourcesN(IDB_BACKGROUND_BITMAP, pKeysBgLbl->GetWidth(), pKeysBgLbl->GetHeight());
116 if (pBgBitmap != null)
118 pKeysBgLbl->SetBackgroundBitmap(*pBgBitmap);
120 if (__pCallButtonsPanel == null)
122 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
123 __pCallButtonsPanel->ConstructPanel(this, FORMTYPE_ENDCALL);
124 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
125 AddControl(__pCallButtonsPanel);
128 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
129 if (pRelativeLayout != null)
131 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
133 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
134 if (pRelativeLayout != null)
136 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
137 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
142 EndCallForm::AddKeyPadActionListener(const String& keyName, CommandIds cmdId)
144 Button* pButton = static_cast<Button*>(GetControl(keyName));
147 pButton->SetActionId(cmdId);
148 pButton->AddActionEventListener(*this);
153 EndCallForm::OnTerminating(void)
155 result r = E_SUCCESS;
157 if (__pCallPresentor)
159 __pCallPresentor = null;
165 EndCallForm::OnActionPerformed(const Control& source, int actionId)
167 SceneManager* pSceneManager = SceneManager::GetInstance();
168 AppAssert(pSceneManager);
174 if (__isMsgAppControlLaunched == true)
176 //AppControl already launched.
179 //check if EndCallTimer is running, then cancel it
180 if(__pEndCallEventTimer != null)
182 __pEndCallEventTimer->Cancel();
184 //make an outgoing call with given number
185 String* contactTxt = new (std::nothrow) String(*__pContactNumber);
186 //switch to dialing outgoing call form
187 ArrayList* pContact = new (std::nothrow) ArrayList(SingleObjectDeleter);
188 pContact->Construct();
189 pContact->Add(contactTxt);
191 //Check if dialing a call is possible
192 bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted();
193 if (isSimInitialized)
195 //Disable all buttons
196 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
197 pButton->SetEnabled(false);
198 pButton->Invalidate(true);
199 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
200 pButton->SetEnabled(false);
201 pButton->Invalidate(true);
202 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
203 if(pButton->GetShowState() == true)
205 pButton->SetEnabled(false);
206 pButton->Invalidate(true);
208 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
209 pButton->SetEnabled(false);
210 pButton->Invalidate(true);
211 //Check if dialing an emergency call
212 bool isEmergencyCall = __pCallPresentor->IsEmergencyNumber(*contactTxt, true);
215 pSceneManager->GoForward( ForwardSceneTransition( IDSCN_SCENE_OUT_EMERGENCYCALL), pContact);
219 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_SCENE_OUTCALL), pContact);
224 //Show error message Popup
225 HandleTelephonyError(ERROR_CODE_SIM_INITIALIZATION_FAILED);
236 if (__isMsgAppControlLaunched == true)
238 //AppControl already launched.
241 //launch message AppControl
242 __isMsgAppControlLaunched = __pCallPresentor->LaunchComposeMessageAppControl(*__pContactNumber, this);
243 if (__isMsgAppControlLaunched == true && __pEndCallEventTimer != null)
245 //cancel EndCallTimer, if AppControl request was successful.
246 __pEndCallEventTimer->Cancel();
247 //Disable the call buttons
248 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
249 pButton->SetEnabled(false);
250 pButton->Invalidate(true);
251 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
252 pButton->SetEnabled(false);
253 pButton->Invalidate(true);
254 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
255 if(pButton->GetShowState() == true)
257 pButton->SetEnabled(false);
258 pButton->Invalidate(true);
264 case IDA_ADD_TO_CONTACTS:
266 if(__isContactAppControlLaunched == true)
268 //AppControl already launched.
269 AppLogDebug("__isContactAppControlLaunched == true");
272 HandleAddToContacts();
273 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
274 pButton->SetEnabled(false);
275 pButton->Invalidate(true);
276 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
277 pButton->SetEnabled(false);
278 pButton->Invalidate(true);
279 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
280 if(pButton->GetShowState() == true)
282 pButton->SetEnabled(false);
283 pButton->Invalidate(true);
285 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
286 pButton->SetEnabled(false);
287 pButton->Invalidate(true);
297 EndCallForm::HandleAddToContacts(void)
299 AppLogDebug("Enter");
301 Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
302 //Launch Contact AppControl
303 String requestParameter;
304 if (pContact != null)
307 requestParameter.Append(pContact->GetRecordId());
308 __isContactAppControlLaunched = __pCallPresentor->LaunchViewContactAppControl(requestParameter, this);
315 requestParameter.Append(*__pContactNumber);
316 __isContactAppControlLaunched = __pCallPresentor->LaunchAddContactAppControl(requestParameter, this);
319 if (__isContactAppControlLaunched == true && __pEndCallEventTimer != null)
321 //cancel EndCallTimer, if AppControl request was success.
322 __pEndCallEventTimer->Cancel();
327 EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
329 //set itself as listener
330 __pCallPresentor->SetTelEventListener(this);
331 //listen to Foreground events
332 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
333 pPhoneApp->AddAppStateChangeListener(*this);
334 __isMsgAppControlLaunched = false;
335 __isContactAppControlLaunched = false;
339 case FORMTYPE_ENDCALL:
341 //fetch ended call details
342 AppCallInfo* pEndCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
345 __pContactNumber = new (std::nothrow) String();
346 if(pEndCall->GetContactNumber().IsEmpty() == false)
348 __pContactNumber->Append(pEndCall->GetContactNumber());
352 __pContactNumber->Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
355 //Fetch & show contact person details
356 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,pEndCall);
357 //If call is hidden means contact number is empty,
358 //or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button.
359 if (pEndCall->GetContactInfo() != null)
361 //Check if contact is deleted in mean time.
362 Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber());
363 //before setting check if the contact is deleted
366 ShowViewContactButton();
372 ShowAddContactButton();
378 ShowAddContactButton();
381 //Check if call is Emergency call or Hidden call,
382 //then disable all button in Call button panel.
383 if (pEndCall->IsEmergency() == true || pEndCall->GetContactNumber().IsEmpty() == true)
385 __pCallButtonsPanel->SetEndCallPanelState(false);
389 __pCallButtonsPanel->SetEndCallPanelState(true);
392 //check if we reached the end call form of an outgoing call then don't show add to contacts
393 if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_OUTGOING)
395 __pCallButtonsPanel->ShowOrHideAddtoContactsButton(false);
397 else if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
399 if(pEndCall->GetContactNumber().IsEmpty() == false)
401 __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true);
412 //Before starting end call timer check if messaging appcontrol was launched during incoming call
413 if (__pEndCallEventTimer && __pCallPresentor->IsAppControlRunning() == false)
415 __pEndCallEventTimer->Start(IDI_APP_END_TIMER);
424 CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
425 pCallApp->SetTopMostWindow(false);
426 AddOrientationEventListener(*this);
430 EndCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
432 if (__pEndCallEventTimer != null)
434 __pEndCallEventTimer->Cancel();
436 if (__pContactNumber)
438 delete __pContactNumber;
439 __pContactNumber = null;
441 if (__pSmallPhotoLabel != null)
443 __pSmallPhotoLabel->SetShowState(false);
445 //remove itself as listener
446 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
447 pPhoneApp->RemoveAppStateChangeListener(*this);
448 RemoveOrientationEventListener(*this);
452 EndCallForm::OnDraw(void)
458 EndCallForm::ShowViewContactButton(void)
460 __pCallButtonsPanel->ShowViewContactButton();
464 EndCallForm::ShowAddContactButton(void)
466 __pCallButtonsPanel->ShowAddContactButton();
470 EndCallForm::ShowPhoneNumber(const String& phoneNumber, const String& lblName)
472 String formattedNumber = phoneNumber;
473 Label* pContactLbl = static_cast<Label*>(GetControl(lblName));
474 pContactLbl->SetText(formattedNumber);
478 EndCallForm::ShowPersonDetails(const String& phoneNumber, const String& nameLblName, const String& photoLblName, AppCallInfo* pCallInfo)
481 ShowPhoneNumber(phoneNumber, IDC_NUMBER1_LABEL);
483 Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
484 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLblName));
486 //fetch contact details based on phone number
487 String* pDisplayName = pCallInfo->FetchCallerNameN();
488 Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
490 //passing an empty string to SetText fails in label,
491 //if previously valid text has been set
492 if (pDisplayName != null && pDisplayName->IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
494 pDisplayName->Append(L" ");
497 // show display name on name Label
498 if (pDisplayName != null)
500 pNameLbl->SetText(*pDisplayName);
503 // If record not found or no photo id present for user,
504 //fetch default bitmap.
505 if (pPhotoBitmap != null)
507 if(pPhotoBitmap->GetHeight() <= H_SMALL_PHOTO
508 && pPhotoBitmap->GetWidth() <= W_SMALL_PHOTO)
510 ShowThumbnailImage(pPhotoBitmap,photoLblName);
514 Canvas* pCanvas = new (std::nothrow) Canvas;
515 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
516 pCanvas->Construct(canvasRect);
517 //draw the contact bitmap
518 pCanvas->DrawBitmap(canvasRect,*pPhotoBitmap);
519 Bitmap* pNewPhotoId = new Bitmap();
520 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
523 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
524 pPhotoLbl->Invalidate(true);
531 Bitmap* pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_END_CALL_DEFAULT_ICON,W_PHOTO_LABEL,H_PHOTO_LABEL);
532 if (pDefaultPhoto != null)
534 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
535 pPhotoLbl->Invalidate(true);
536 delete pDefaultPhoto;
554 EndCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,const String& photoLabel)
556 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
558 if (pPhotoLbl != null && pPhotoId != null)
560 Canvas* pCanvas = new (std::nothrow) Canvas;
561 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
562 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
563 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
564 pCanvas->Construct(canvasRect);
565 //draw the back ground
566 pCanvas->DrawBitmap(canvasRect,*pBackground);
567 //draw shadow (to be enabled after correct shadow image is provided )
568 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
569 // (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
570 //draw the contact bitmap
571 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
572 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
573 Bitmap* pNewPhotoId = new Bitmap();
574 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
577 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
578 pPhotoLbl->Invalidate(true);
586 EndCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
588 if (__pSmallPhotoLabel != null)
590 RemoveControl(__pSmallPhotoLabel);
591 __pSmallPhotoLabel = null;
593 //Draw Small Photo and show on small photo label
594 __pSmallPhotoLabel = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
595 __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
596 __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
597 __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
598 // Add a Label to the Form
599 AddControl(__pSmallPhotoLabel);
600 __pSmallPhotoLabel->Invalidate(true);
604 EndCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
606 //goto initial scene or close application, since this was last active call.
607 HandleLastCallCompletion();
611 EndCallForm::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData)
613 AppLogDebug("Enter");
614 if (__isMsgAppControlLaunched == true)
616 //Message AppControl request completed.
617 __isMsgAppControlLaunched = false;
618 __pCallPresentor->AppControlRequestCompleted();
620 if(__isContactAppControlLaunched == true)
622 //notify app control completed
623 __isContactAppControlLaunched = false;
624 __pCallPresentor->AppControlRequestCompleted();
626 //AppControl completed, goto initial scene if present
628 HandleLastCallCompletion();
632 EndCallForm::HandleLastCallCompletion(void)
634 //Check if message sending is in progress if yes
635 //wait for it to complete by restarting the timer
636 AppLogDebug("Enter");
637 if(__pCallPresentor->IsMessageSendingInProgress() == true)
639 __pEndCallEventTimer->Start(END_CALL_WAIT_TIMER_VAL);
643 CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
644 pPhoneApp->Terminate();
649 EndCallForm::OnForeground(void)
651 AppLogDebug("Enter");
652 //If Contact app control was launched
653 //as we do not know if it success or failed.
654 if(__isContactAppControlLaunched == true)
656 if(__pEndCallEventTimer != null)
658 __pEndCallEventTimer->Start(END_CALL_TIMER_VAL);
660 if (__pContactNumber != null && __pContactNumber->IsEmpty() == false)
662 AppCallInfo* ActiveCallInfo = new (std::nothrow) AppCallInfo();
663 ActiveCallInfo->SetContactNumber(*__pContactNumber);
664 Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
665 if (pContact != null)
667 ActiveCallInfo->SetContactInfo(*pContact);
669 //before setting check if the contact is deleted
673 ShowViewContactButton();
679 ShowAddContactButton();
681 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,ActiveCallInfo);
682 delete ActiveCallInfo;
685 //notify app control completed
686 __isContactAppControlLaunched = false;
687 __pCallPresentor->AppControlRequestCompleted();
689 else if (__isMsgAppControlLaunched == true)
691 //Message AppControl request completed.
692 if(__pEndCallEventTimer != null)
694 __pEndCallEventTimer->Start(2000);
696 __isMsgAppControlLaunched = false;
697 __pCallPresentor->AppControlRequestCompleted();
699 else if(__pCallPresentor->IsAppControlRunning() == true)
701 if(__pEndCallEventTimer != null)
703 __pEndCallEventTimer->Start(2000);
705 __pCallPresentor->AppControlRequestCompleted();
708 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
709 pButton->SetEnabled(true);
710 pButton->Invalidate(true);
711 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
712 pButton->SetEnabled(true);
713 pButton->Invalidate(true);
714 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
715 if(pButton->GetShowState() == true)
717 pButton->SetEnabled(true);
718 pButton->Invalidate(true);
720 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
721 pButton->SetEnabled(true);
722 pButton->Invalidate(true);
727 EndCallForm::OnBackground(void)
729 AppLogDebug("Enter");
733 EndCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
735 AppLogDebug("Enter");
736 if (__pCallButtonsPanel != null)
738 //update position of call buttons panel
739 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
740 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
741 //bring button on top
742 __pCallButtonsPanel->SetButtonPosition();
743 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
744 if (pRelativeLayout != null)
746 //pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
748 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
749 if (pRelativeLayout != null)
751 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
752 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *this, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);