Fixed recursive appcontrol issue. Fixed Call reject from event injector during answer...
[apps/osp/Call.git] / src / CallEndCallForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file    CallEndCallForm.cpp
19  * @brief       End Call form implementation
20  */
21 #include <FApp.h>
22 #include <FUi.h>
23 #include <FMedia.h>
24 #include "CallApp.h"
25 #include "CallAppUtility.h"
26 #include "CallEndCallForm.h"
27 #include "CallButtonsPanel.h"
28 #include "CallPresentationModel.h"
29 #include "CallSceneRegister.h"
30 #include "CallTypes.h"
31
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;
41
42 //constants
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
57
58 EndCallForm::EndCallForm(void)
59 : BaseForm(FORMTYPE_ENDCALL)
60 {
61         __pCallButtonsPanel = null;
62         __pContactNumber = null;
63         __pEndCallEventTimer = null;
64         __pSmallPhotoLabel = null;
65         __isMsgAppControlLaunched = false;
66         __isContactAppControlLaunched = false;
67         __isContactPresent = false;
68 }
69
70 EndCallForm::~EndCallForm(void)
71 {
72         if (__pEndCallEventTimer != null)
73         {
74                 __pEndCallEventTimer->Cancel();
75                 delete __pEndCallEventTimer;
76                 __pEndCallEventTimer = null;
77         }
78         if (__pSmallPhotoLabel != null)
79         {
80                 __pSmallPhotoLabel = null;
81         }
82 }
83
84 void
85 EndCallForm::Initialize(void)
86 {
87         Construct(IDL_END_CALL_FORM);
88 }
89
90 result
91 EndCallForm::OnInitializing(void)
92 {
93         result r = E_SUCCESS;
94
95         //initialize keypad and buttons
96         InitializeCallButtonsPanel();
97
98         __pEndCallEventTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
99         r = __pEndCallEventTimer->Construct(*this);
100
101         __pCallPresentor = CallPresentationModel::GetInstance();
102         return r;
103 }
104
105 void
106 EndCallForm::InitializeCallButtonsPanel(void)
107 {
108         Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
109         Bitmap* pBgBitmap = AppUtility::GetBitmapFromResourcesN(IDB_BACKGROUND_BITMAP, pKeysBgLbl->GetWidth(), pKeysBgLbl->GetHeight());
110         if (pBgBitmap != null)
111         {
112                 pKeysBgLbl->SetBackgroundBitmap(*pBgBitmap);
113         }
114         if (__pCallButtonsPanel == null)
115         {
116                 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
117                 __pCallButtonsPanel->ConstructPanel(this, FORMTYPE_ENDCALL);
118                 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
119                 AddControl(*__pCallButtonsPanel);
120         }
121
122         RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
123         if (pRelativeLayout != null)
124         {
125                 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
126         }
127         pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
128         if (pRelativeLayout != null)
129         {
130                 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
131                 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
132         }
133 }
134
135 void
136 EndCallForm::AddKeyPadActionListener(const String& keyName, CommandIds cmdId)
137 {
138         Button* pButton = static_cast<Button*>(GetControl(keyName));
139         if (pButton != null)
140         {
141                 pButton->SetActionId(cmdId);
142                 pButton->AddActionEventListener(*this);
143         }
144 }
145
146 result
147 EndCallForm::OnTerminating(void)
148 {
149         result r = E_SUCCESS;
150
151         if (__pCallPresentor)
152         {
153                 __pCallPresentor = null;
154         }
155         return r;
156 }
157
158 void
159 EndCallForm::OnActionPerformed(const Control& source, int actionId)
160 {
161         SceneManager* pSceneManager = SceneManager::GetInstance();
162         AppAssert(pSceneManager);
163
164         switch (actionId)
165         {
166         case IDA_VOICE_CALL:
167         {
168                 //check if EndCallTimer is running, then cancel it
169                 if(__pEndCallEventTimer != null)
170                 {
171                         __pEndCallEventTimer->Cancel();
172                 }
173                 //make an outgoing call with given number
174                 String* contactTxt = new (std::nothrow) String(*__pContactNumber);
175                 //switch to dialing outgoing call form
176                 ArrayList* pContact = new (std::nothrow) ArrayList(SingleObjectDeleter);
177                 pContact->Construct();
178                 pContact->Add(contactTxt);
179
180                 //Check if dialing a call is possible
181                 bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted();
182                 if (isSimInitialized)
183                 {
184                         //Check if dialing an emergency call
185                         bool isEmergencyCall = __pCallPresentor->IsEmergencyNumber(*contactTxt, true);
186                         if (isEmergencyCall)
187                         {
188                                 pSceneManager->GoForward( ForwardSceneTransition( IDSCN_SCENE_OUT_EMERGENCYCALL), pContact);
189                         }
190                         else
191                         {
192                                 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_SCENE_OUTCALL), pContact);
193                         }
194                 }
195                 else
196                 {
197                         //Show error message Popup
198                         HandleTelephonyError(ERROR_CODE_SIM_INITIALIZATION_FAILED);
199                 }
200         }
201         break;
202
203         case IDA_VIDEO_CALL:
204                 //Make Video Call
205                 break;
206
207         case IDA_MESSAGE:
208         {
209                 if (__isMsgAppControlLaunched == true)
210                 {
211                         //AppControl already launched.
212                         return;
213                 }
214                 //launch message AppControl
215                 __isMsgAppControlLaunched = __pCallPresentor->LaunchComposeMessageAppControl(*__pContactNumber, this);
216                 if (__isMsgAppControlLaunched == true && __pEndCallEventTimer != null)
217                 {
218                         //cancel EndCallTimer, if AppControl request was successful.
219                         __pEndCallEventTimer->Cancel();
220                 }
221         }
222         break;
223
224         case IDA_ADD_TO_CONTACTS:
225         {
226                 if(__isContactAppControlLaunched == true)
227                 {
228                         //AppControl already launched.
229                         AppLogDebug("__isContactAppControlLaunched == true");
230                         return;
231                 }
232                 HandleAddToContacts();
233         }
234         break;
235
236         default:
237                 break;
238         }
239 }
240
241 void
242 EndCallForm::HandleAddToContacts(void)
243 {
244         AppLogDebug("Enter");
245
246         Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
247         //Launch Contact AppControl
248         String requestParameter;
249         if (pContact != null)
250         {
251                 //View Contact
252                 requestParameter.Append(pContact->GetRecordId());
253                 __isContactAppControlLaunched = __pCallPresentor->LaunchViewContactAppControl(requestParameter, this);
254                 delete pContact;
255                 pContact = null;
256         }
257         else
258         {
259                 //Add To Contact
260                 requestParameter.Append(*__pContactNumber);
261                 __isContactAppControlLaunched = __pCallPresentor->LaunchAddContactAppControl(requestParameter, this);
262         }
263
264         if (__isContactAppControlLaunched == true && __pEndCallEventTimer != null)
265         {
266                 //cancel EndCallTimer, if AppControl request was success.
267                 __pEndCallEventTimer->Cancel();
268         }
269 }
270
271 void
272 EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
273 {
274         //set itself as listener
275         __pCallPresentor->SetTelEventListener(this);
276         //listen to Foreground events
277         CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
278         pPhoneApp->AddAppStateChangeListener(*this);
279         __isMsgAppControlLaunched = false;
280         __isContactAppControlLaunched = false;
281
282         switch (__formType)
283         {
284         case FORMTYPE_ENDCALL:
285         {
286                 //fetch ended call details
287                 AppCallInfo* pEndCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
288
289                 //contact number
290                 __pContactNumber = new (std::nothrow) String();
291                 if(pEndCall->GetContactNumber().IsEmpty() == false)
292                 {
293                         __pContactNumber->Append(pEndCall->GetContactNumber());
294                 }
295                 else
296                 {
297                         __pContactNumber->Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
298                 }
299
300                 //Fetch & show contact person details
301                 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,pEndCall);
302                 //If call is hidden means contact number is empty,
303                 //or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button.
304                 if (pEndCall->GetContactInfo() != null || pEndCall->GetContactNumber().IsEmpty() == true)
305                 {
306                         Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber());
307                         //before setting check if the contact is deleted
308                         if(pContact != null)
309                         {
310                                 SetContactButtonState(false);
311                                 delete pContact;
312                                 pContact = null;
313                         }
314                         else
315                         {
316                                 SetContactButtonState(true);
317                         }
318                 }
319                 else
320                 {
321                         SetContactButtonState(true);
322                 }
323
324                 //Check if call is Emergency call or Hidden call,
325                 //then disable all button in Call button panel.
326                 if (pEndCall->IsEmergency() == true || pEndCall->GetContactNumber().IsEmpty() == true)
327                 {
328                         __pCallButtonsPanel->SetEndCallPanelState(false);
329                 }
330                 else
331                 {
332                         __pCallButtonsPanel->SetEndCallPanelState(true);
333                 }
334         }
335         break;
336
337         default:
338                 break;
339         }
340
341         if (__pEndCallEventTimer)
342         {
343                 __pEndCallEventTimer->Start(IDI_APP_END_TIMER);
344         }
345
346         if (pArgs)
347         {
348                 pArgs->RemoveAll();
349                 delete pArgs;
350                 pArgs = null;
351         }
352         AddOrientationEventListener(*this);
353 }
354
355 void
356 EndCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
357 {
358         if (__pEndCallEventTimer != null)
359         {
360                 __pEndCallEventTimer->Cancel();
361         }
362         if (__pContactNumber)
363         {
364                 delete __pContactNumber;
365                 __pContactNumber = null;
366         }
367         if (__pSmallPhotoLabel != null)
368         {
369                 __pSmallPhotoLabel->SetShowState(false);
370         }
371         //remove itself as listener
372         CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
373         pPhoneApp->RemoveAppStateChangeListener(*this);
374         RemoveOrientationEventListener(*this);
375 }
376
377 result
378 EndCallForm::OnDraw(void)
379 {
380         return E_SUCCESS;
381 }
382
383 void
384 EndCallForm::SetContactButtonState(bool showState)
385 {
386         __pCallButtonsPanel->SetViewContactButtonStatus(showState);
387         __isContactPresent = !showState;
388 }
389
390 bool
391 EndCallForm::IsContactPresent(void)
392 {
393         return __isContactPresent;
394 }
395
396
397 void
398 EndCallForm::ShowPhoneNumber(const String& phoneNumber, const String& lblName)
399 {
400         String formattedNumber = phoneNumber;
401         Label* pContactLbl = static_cast<Label*>(GetControl(lblName));
402         pContactLbl->SetText(formattedNumber);
403 }
404
405 void
406 EndCallForm::ShowPersonDetails(const String& phoneNumber, const String& nameLblName, const String& photoLblName, AppCallInfo* pCallInfo)
407 {
408         //show phone number
409         ShowPhoneNumber(phoneNumber, IDC_NUMBER1_LABEL);
410
411         Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
412         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLblName));
413
414         //fetch contact details based on phone number
415         String* pDisplayName = pCallInfo->FetchCallerNameN();
416         Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
417
418         //passing an empty string to SetText fails in label,
419         //if previously valid text has been set
420         if (pDisplayName != null && pDisplayName->IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
421         {
422                 pDisplayName->Append(L" ");
423         }
424
425         // show display name on name Label
426         if (pDisplayName != null)
427         {
428                 pNameLbl->SetText(*pDisplayName);
429         }
430
431         // If record not found or no photo id present for user,
432         //fetch default bitmap.
433         if (pPhotoBitmap != null)
434         {
435                 if(pPhotoBitmap->GetHeight() <= H_SMALL_PHOTO
436                                 && pPhotoBitmap->GetWidth() <= W_SMALL_PHOTO)
437                 {
438                         ShowThumbnailImage(pPhotoBitmap,photoLblName);
439                 }
440                 else
441                 {
442                         Canvas* pCanvas = new (std::nothrow) Canvas;
443                         Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
444                         pCanvas->Construct(canvasRect);
445                         //draw the contact bitmap
446                         pCanvas->DrawBitmap(canvasRect,*pPhotoBitmap);
447                         Bitmap* pNewPhotoId = new Bitmap();
448                         pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
449                         delete pCanvas;
450
451                         pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
452                         pPhotoLbl->Invalidate(true);
453                         delete pNewPhotoId;
454                 }
455         }
456         else
457         {
458                 //Set Default Photo
459                 Bitmap* pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_END_CALL_DEFAULT_ICON,W_PHOTO_LABEL,H_PHOTO_LABEL);
460                 if (pDefaultPhoto != null)
461                 {
462                         pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
463                         pPhotoLbl->Invalidate(true);
464                         delete pDefaultPhoto;
465                 }
466         }
467         RequestRedraw(true);
468         //free resources
469         if (pDisplayName)
470         {
471                 delete pDisplayName;
472                 pDisplayName = null;
473         }
474         if (pPhotoBitmap)
475         {
476                 delete pPhotoBitmap;
477                 pPhotoBitmap = null;
478         }
479 }
480
481 void
482 EndCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,const String& photoLabel)
483 {
484         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
485
486         if (pPhotoLbl != null && pPhotoId != null)
487         {
488                 Canvas* pCanvas = new (std::nothrow) Canvas;
489                 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
490                 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
491                 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
492                 pCanvas->Construct(canvasRect);
493                 //draw the back ground
494                 pCanvas->DrawBitmap(canvasRect,*pBackground);
495                 //draw shadow (to be enabled after correct shadow image is provided )
496                 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
497                         //      (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
498                 //draw the contact bitmap
499                 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
500                                 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
501                 Bitmap* pNewPhotoId = new Bitmap();
502                 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
503                 delete pCanvas;
504
505                 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
506                 pPhotoLbl->Invalidate(true);
507                 delete pNewPhotoId;
508                 delete pBackground;
509                 delete pShadow;
510         }
511 }
512
513 void
514 EndCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
515 {
516         if (__pSmallPhotoLabel != null)
517         {
518                 RemoveControl(*__pSmallPhotoLabel);
519                 __pSmallPhotoLabel = null;
520         }
521         //Draw Small Photo and show on small photo label
522         __pSmallPhotoLabel  = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
523         __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
524         __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
525         __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
526         // Add a Label to the Form
527         AddControl(*__pSmallPhotoLabel);
528         __pSmallPhotoLabel->Invalidate(true);
529 }
530
531 void
532 EndCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
533 {
534         //goto initial scene or close application, since this was last active call.
535         HandleLastCallCompletion();
536 }
537
538 void
539 EndCallForm::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData)
540 {
541         AppLogDebug("Enter");
542         if (__isMsgAppControlLaunched == true)
543         {
544                 //Message AppControl request completed.
545                 __isMsgAppControlLaunched = false;
546                 __pCallPresentor->AppControlRequestCompleted();
547         }
548         //AppControl completed, goto initial scene if present
549         //else exit.
550         HandleLastCallCompletion();
551 }
552
553 void
554 EndCallForm::HandleLastCallCompletion(void)
555 {
556         CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
557         pPhoneApp->Terminate();
558 }
559
560 void
561 EndCallForm::OnForeground(void)
562 {
563         AppLogDebug("Enter");
564         //If Contact app control was launched
565         //as we do not know if it success or failed.
566         if(__isContactAppControlLaunched == true)
567         {
568                 if(__pEndCallEventTimer != null)
569                 {
570                         __pEndCallEventTimer->Start(2000);
571                 }
572                 if (__pContactNumber != null && __pContactNumber->IsEmpty() == false)
573                 {
574                         Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
575                         //before setting check if the contact is deleted
576                         if(pContact != null)
577                         {
578                                 SetContactButtonState(false);
579                                 delete pContact;
580                                 pContact = null;
581                         }
582                         else
583                         {
584                                 SetContactButtonState(true);
585                         }
586                 }
587
588                 //notify app control completed
589                 __isContactAppControlLaunched = false;
590                 __pCallPresentor->AppControlRequestCompleted();
591         }
592
593         if (__isMsgAppControlLaunched == true)
594         {
595                 //Message AppControl request completed.
596                 if(__pEndCallEventTimer != null)
597                 {
598                         __pEndCallEventTimer->Start(2000);
599                 }
600                 __isMsgAppControlLaunched = false;
601                 __pCallPresentor->AppControlRequestCompleted();
602         }
603         AppLogDebug("Exit");
604 }
605
606 void
607 EndCallForm::OnBackground(void)
608 {
609         AppLogDebug("Enter");
610 }
611
612 void
613 EndCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
614 {
615         AppLogDebug("Enter");
616         if (__pCallButtonsPanel != null)
617         {
618                 //update position of call buttons panel
619                 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
620                 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
621                 //bring button on top
622                 __pCallButtonsPanel->SetButtonPosition();
623                 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
624                 if (pRelativeLayout != null)
625                 {
626                         //pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
627                 }
628                 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
629                 if (pRelativeLayout != null)
630                 {
631                         pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
632                         pRelativeLayout->SetRelation(*__pCallButtonsPanel, *this, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
633                 }
634         }
635 }