2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (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 static const wchar_t* IDL_END_CALL_FORM = L"IDL_END_CALL_FORM";
51 static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
52 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
53 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
54 static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL";
55 static const wchar_t* IDB_END_CALL_DEFAULT_ICON = L"C01-1_call_default_caller ID_720x720.png";
56 static const wchar_t* IDC_VOICECALL_BUTTON = L"IDC_VOICECALL_BUTTON";
57 static const wchar_t* IDC_VIDEOCALL_BUTTON = L"IDC_VIDEOCALL_BUTTON";
58 static const wchar_t* IDC_ADD_TO_CONTACT_BUTTON = L"IDC_ADD_TO_CONTACT_BUTTON";
59 static const wchar_t* IDC_MSG_BUTTON = L"IDC_MSG_BUTTON";
62 EndCallForm::EndCallForm(void)
63 : BaseForm(FORMTYPE_ENDCALL)
65 __pCallButtonsPanel = null;
66 __pContactNumber = null;
67 __pEndCallEventTimer = null;
68 __pSmallPhotoLabel = null;
69 __isMsgAppControlLaunched = false;
70 __isContactAppControlLaunched = false;
73 EndCallForm::~EndCallForm(void)
75 if (__pEndCallEventTimer != null)
77 __pEndCallEventTimer->Cancel();
78 delete __pEndCallEventTimer;
79 __pEndCallEventTimer = null;
81 if (__pSmallPhotoLabel != null)
83 __pSmallPhotoLabel = null;
88 EndCallForm::Initialize(void)
90 Construct(IDL_END_CALL_FORM);
94 EndCallForm::OnInitializing(void)
98 //initialize keypad and buttons
99 InitializeCallButtonsPanel();
101 __pEndCallEventTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
102 r = __pEndCallEventTimer->Construct(*this);
104 __pCallPresentor = CallPresentationModel::GetInstance();
109 EndCallForm::InitializeCallButtonsPanel(void)
111 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
112 Bitmap* pBgBitmap = AppUtility::GetBitmapFromResourcesN(IDB_BACKGROUND_BITMAP, pKeysBgLbl->GetWidth(), pKeysBgLbl->GetHeight());
113 if (pBgBitmap != null)
115 pKeysBgLbl->SetBackgroundBitmap(*pBgBitmap);
117 if (__pCallButtonsPanel == null)
119 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
120 __pCallButtonsPanel->ConstructPanel(this, FORMTYPE_ENDCALL);
121 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
122 AddControl(*__pCallButtonsPanel);
125 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
126 if (pRelativeLayout != null)
128 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
130 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
131 if (pRelativeLayout != null)
133 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
134 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
139 EndCallForm::AddKeyPadActionListener(const String& keyName, CommandIds cmdId)
141 Button* pButton = static_cast<Button*>(GetControl(keyName));
144 pButton->SetActionId(cmdId);
145 pButton->AddActionEventListener(*this);
150 EndCallForm::OnTerminating(void)
152 result r = E_SUCCESS;
154 if (__pCallPresentor)
156 __pCallPresentor = null;
162 EndCallForm::OnActionPerformed(const Control& source, int actionId)
164 SceneManager* pSceneManager = SceneManager::GetInstance();
165 AppAssert(pSceneManager);
171 if (__isMsgAppControlLaunched == true)
173 //AppControl already launched.
176 //check if EndCallTimer is running, then cancel it
177 if(__pEndCallEventTimer != null)
179 __pEndCallEventTimer->Cancel();
181 //make an outgoing call with given number
182 String* contactTxt = new (std::nothrow) String(*__pContactNumber);
183 //switch to dialing outgoing call form
184 ArrayList* pContact = new (std::nothrow) ArrayList(SingleObjectDeleter);
185 pContact->Construct();
186 pContact->Add(contactTxt);
188 //Check if dialing a call is possible
189 bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted();
190 if (isSimInitialized)
192 //Disable all buttons
193 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
194 pButton->SetEnabled(false);
195 pButton->Invalidate(true);
196 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
197 pButton->SetEnabled(false);
198 pButton->Invalidate(true);
199 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
200 if(pButton->GetShowState() == true)
202 pButton->SetEnabled(false);
203 pButton->Invalidate(true);
205 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
206 pButton->SetEnabled(false);
207 pButton->Invalidate(true);
208 //Check if dialing an emergency call
209 bool isEmergencyCall = __pCallPresentor->IsEmergencyNumber(*contactTxt, true);
212 pSceneManager->GoForward( ForwardSceneTransition( IDSCN_SCENE_OUT_EMERGENCYCALL), pContact);
216 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_SCENE_OUTCALL), pContact);
221 //Show error message Popup
222 HandleTelephonyError(ERROR_CODE_SIM_INITIALIZATION_FAILED);
233 if (__isMsgAppControlLaunched == true)
235 //AppControl already launched.
238 //launch message AppControl
239 __isMsgAppControlLaunched = __pCallPresentor->LaunchComposeMessageAppControl(*__pContactNumber, this);
240 if (__isMsgAppControlLaunched == true && __pEndCallEventTimer != null)
242 //cancel EndCallTimer, if AppControl request was successful.
243 __pEndCallEventTimer->Cancel();
244 //Disable the call buttons
245 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
246 pButton->SetEnabled(false);
247 pButton->Invalidate(true);
248 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
249 pButton->SetEnabled(false);
250 pButton->Invalidate(true);
251 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
252 if(pButton->GetShowState() == true)
254 pButton->SetEnabled(false);
255 pButton->Invalidate(true);
261 case IDA_ADD_TO_CONTACTS:
263 if(__isContactAppControlLaunched == true)
265 //AppControl already launched.
266 AppLogDebug("__isContactAppControlLaunched == true");
269 HandleAddToContacts();
270 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
271 pButton->SetEnabled(false);
272 pButton->Invalidate(true);
273 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
274 pButton->SetEnabled(false);
275 pButton->Invalidate(true);
276 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
277 if(pButton->GetShowState() == true)
279 pButton->SetEnabled(false);
280 pButton->Invalidate(true);
282 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
283 pButton->SetEnabled(false);
284 pButton->Invalidate(true);
294 EndCallForm::HandleAddToContacts(void)
296 AppLogDebug("Enter");
298 Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
299 //Launch Contact AppControl
300 String requestParameter;
301 if (pContact != null)
304 requestParameter.Append(pContact->GetRecordId());
305 __isContactAppControlLaunched = __pCallPresentor->LaunchViewContactAppControl(requestParameter, this);
312 requestParameter.Append(*__pContactNumber);
313 __isContactAppControlLaunched = __pCallPresentor->LaunchAddContactAppControl(requestParameter, this);
316 if (__isContactAppControlLaunched == true && __pEndCallEventTimer != null)
318 //cancel EndCallTimer, if AppControl request was success.
319 __pEndCallEventTimer->Cancel();
324 EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
326 //set itself as listener
327 __pCallPresentor->SetTelEventListener(this);
328 //listen to Foreground events
329 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
330 pPhoneApp->AddAppStateChangeListener(*this);
331 __isMsgAppControlLaunched = false;
332 __isContactAppControlLaunched = false;
336 case FORMTYPE_ENDCALL:
338 //fetch ended call details
339 AppCallInfo* pEndCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
342 __pContactNumber = new (std::nothrow) String();
343 if(pEndCall->GetContactNumber().IsEmpty() == false)
345 __pContactNumber->Append(pEndCall->GetContactNumber());
349 __pContactNumber->Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
352 //Fetch & show contact person details
353 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,pEndCall);
354 //If call is hidden means contact number is empty,
355 //or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button.
356 if (pEndCall->GetContactInfo() != null)
358 //Check if contact is deleted in mean time.
359 Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber());
360 //before setting check if the contact is deleted
363 ShowViewContactButton();
369 ShowAddContactButton();
375 ShowAddContactButton();
378 //Check if call is Emergency call or Hidden call,
379 //then disable all button in Call button panel.
380 if (pEndCall->IsEmergency() == true || pEndCall->GetContactNumber().IsEmpty() == true)
382 __pCallButtonsPanel->SetEndCallPanelState(false);
386 __pCallButtonsPanel->SetEndCallPanelState(true);
389 //check if we reached the end call form of an outgoing call then don't show add to contacts
390 if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_OUTGOING)
392 __pCallButtonsPanel->ShowOrHideAddtoContactsButton(false);
394 else if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
396 if(pEndCall->GetContactNumber().IsEmpty() == false)
398 __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true);
409 //Before starting end call timer check if messaging appcontrol was launched during incoming call
410 if (__pEndCallEventTimer && __pCallPresentor->IsAppControlRunning() == false)
412 __pEndCallEventTimer->Start(IDI_APP_END_TIMER);
421 CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
422 pCallApp->SetTopMostWindow(false);
423 AddOrientationEventListener(*this);
427 EndCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
429 if (__pEndCallEventTimer != null)
431 __pEndCallEventTimer->Cancel();
433 if (__pContactNumber)
435 delete __pContactNumber;
436 __pContactNumber = null;
438 if (__pSmallPhotoLabel != null)
440 __pSmallPhotoLabel->SetShowState(false);
442 //remove itself as listener
443 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
444 pPhoneApp->RemoveAppStateChangeListener(*this);
445 RemoveOrientationEventListener(*this);
449 EndCallForm::OnDraw(void)
455 EndCallForm::ShowViewContactButton(void)
457 __pCallButtonsPanel->ShowViewContactButton();
461 EndCallForm::ShowAddContactButton(void)
463 __pCallButtonsPanel->ShowAddContactButton();
467 EndCallForm::ShowPhoneNumber(const String& phoneNumber, const String& lblName)
469 String formattedNumber = phoneNumber;
470 Label* pContactLbl = static_cast<Label*>(GetControl(lblName));
471 pContactLbl->SetText(formattedNumber);
475 EndCallForm::ShowPersonDetails(const String& phoneNumber, const String& nameLblName, const String& photoLblName, AppCallInfo* pCallInfo)
478 ShowPhoneNumber(phoneNumber, IDC_NUMBER1_LABEL);
480 Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
481 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLblName));
483 //fetch contact details based on phone number
484 String* pDisplayName = pCallInfo->FetchCallerNameN();
485 Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
487 //passing an empty string to SetText fails in label,
488 //if previously valid text has been set
489 if (pDisplayName != null && pDisplayName->IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
491 pDisplayName->Append(L" ");
494 // show display name on name Label
495 if (pDisplayName != null)
497 pNameLbl->SetText(*pDisplayName);
500 // If record not found or no photo id present for user,
501 //fetch default bitmap.
502 if (pPhotoBitmap != null)
504 if(pPhotoBitmap->GetHeight() <= H_SMALL_PHOTO
505 && pPhotoBitmap->GetWidth() <= W_SMALL_PHOTO)
507 ShowThumbnailImage(pPhotoBitmap,photoLblName);
511 Canvas* pCanvas = new (std::nothrow) Canvas;
512 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
513 pCanvas->Construct(canvasRect);
514 //draw the contact bitmap
515 pCanvas->DrawBitmap(canvasRect,*pPhotoBitmap);
516 Bitmap* pNewPhotoId = new Bitmap();
517 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
520 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
521 pPhotoLbl->Invalidate(true);
528 Bitmap* pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_END_CALL_DEFAULT_ICON,W_PHOTO_LABEL,H_PHOTO_LABEL);
529 if (pDefaultPhoto != null)
531 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
532 pPhotoLbl->Invalidate(true);
533 delete pDefaultPhoto;
551 EndCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,const String& photoLabel)
553 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
555 if (pPhotoLbl != null && pPhotoId != null)
557 Canvas* pCanvas = new (std::nothrow) Canvas;
558 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
559 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
560 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
561 pCanvas->Construct(canvasRect);
562 //draw the back ground
563 pCanvas->DrawBitmap(canvasRect,*pBackground);
564 //draw shadow (to be enabled after correct shadow image is provided )
565 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
566 // (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
567 //draw the contact bitmap
568 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
569 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
570 Bitmap* pNewPhotoId = new Bitmap();
571 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
574 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
575 pPhotoLbl->Invalidate(true);
583 EndCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
585 if (__pSmallPhotoLabel != null)
587 RemoveControl(*__pSmallPhotoLabel);
588 __pSmallPhotoLabel = null;
590 //Draw Small Photo and show on small photo label
591 __pSmallPhotoLabel = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
592 __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
593 __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
594 __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
595 // Add a Label to the Form
596 AddControl(*__pSmallPhotoLabel);
597 __pSmallPhotoLabel->Invalidate(true);
601 EndCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
603 //goto initial scene or close application, since this was last active call.
604 HandleLastCallCompletion();
608 EndCallForm::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData)
610 AppLogDebug("Enter");
611 if (__isMsgAppControlLaunched == true)
613 //Message AppControl request completed.
614 __isMsgAppControlLaunched = false;
615 __pCallPresentor->AppControlRequestCompleted();
617 if(__isContactAppControlLaunched == true)
619 //notify app control completed
620 __isContactAppControlLaunched = false;
621 __pCallPresentor->AppControlRequestCompleted();
623 //AppControl completed, goto initial scene if present
625 HandleLastCallCompletion();
629 EndCallForm::HandleLastCallCompletion(void)
631 CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
632 pPhoneApp->Terminate();
636 EndCallForm::OnForeground(void)
638 AppLogDebug("Enter");
639 //If Contact app control was launched
640 //as we do not know if it success or failed.
641 if(__isContactAppControlLaunched == true)
643 if(__pEndCallEventTimer != null)
645 __pEndCallEventTimer->Start(2000);
647 if (__pContactNumber != null && __pContactNumber->IsEmpty() == false)
649 AppCallInfo* ActiveCallInfo = new (std::nothrow) AppCallInfo();
650 ActiveCallInfo->SetContactNumber(*__pContactNumber);
651 Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
652 if (pContact != null)
654 ActiveCallInfo->SetContactInfo(*pContact);
656 //before setting check if the contact is deleted
660 ShowViewContactButton();
666 ShowAddContactButton();
668 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,ActiveCallInfo);
669 delete ActiveCallInfo;
672 //notify app control completed
673 __isContactAppControlLaunched = false;
674 __pCallPresentor->AppControlRequestCompleted();
676 else if (__isMsgAppControlLaunched == true)
678 //Message AppControl request completed.
679 if(__pEndCallEventTimer != null)
681 __pEndCallEventTimer->Start(2000);
683 __isMsgAppControlLaunched = false;
684 __pCallPresentor->AppControlRequestCompleted();
686 else if(__pCallPresentor->IsAppControlRunning() == true)
688 if(__pEndCallEventTimer != null)
690 __pEndCallEventTimer->Start(2000);
692 __pCallPresentor->AppControlRequestCompleted();
695 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
696 pButton->SetEnabled(true);
697 pButton->Invalidate(true);
698 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
699 pButton->SetEnabled(true);
700 pButton->Invalidate(true);
701 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
702 if(pButton->GetShowState() == true)
704 pButton->SetEnabled(true);
705 pButton->Invalidate(true);
707 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
708 pButton->SetEnabled(true);
709 pButton->Invalidate(true);
714 EndCallForm::OnBackground(void)
716 AppLogDebug("Enter");
720 EndCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
722 AppLogDebug("Enter");
723 if (__pCallButtonsPanel != null)
725 //update position of call buttons panel
726 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
727 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
728 //bring button on top
729 __pCallButtonsPanel->SetButtonPosition();
730 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
731 if (pRelativeLayout != null)
733 //pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
735 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
736 if (pRelativeLayout != null)
738 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
739 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *this, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);