Merge "Revert "reset commit to request SR"" into tizen_2.1
[platform/framework/native/uifw.git] / src / ui / FUi_OrientationAgent.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FUi_OrientationAgent.cpp
20  * @brief       This is the implementation file for the _OrientationAgent class.
21  */
22
23 #include <unique_ptr.h>
24 #include <app.h>
25 #include <FBaseSysLog.h>
26 #include <FBaseColArrayList.h>
27 #include "FUi_OrientationAgent.h"
28 #include "FUi_ControlManager.h"
29 #include "FUi_ControlImplManager.h"
30 #include "FUi_PublicOrientationEvent.h"
31 #include "FUi_ControlImpl.h"
32 #include "FUi_Window.h"
33 #include "FUiCtrl_FormImpl.h"
34 #include "FUiCtrl_FrameImpl.h"
35 #include "FUiCtrl_Frame.h"
36 #include "FUiCtrl_Form.h"
37 #include "FUi_EcoreEvasMgr.h"
38 #include "FUi_EcoreEvas.h"
39 #include "FUi_ControlManager.h"
40 #include "FUi_UiNotificationEvent.h"
41 #include "FUi_UiEventManager.h"
42
43 using namespace std;
44 using namespace Tizen::Base;
45 using namespace Tizen::Base::Collection;
46 using namespace Tizen::Base::Runtime;
47 using namespace Tizen::Ui::Controls;
48 using namespace Tizen::Graphics;
49
50 namespace Tizen { namespace Ui {
51
52 const String _REQUEST_ORIENTATION_EVENT = L"RequestOrientationEvent";
53
54 _OrientationAgent*
55 _OrientationAgent::CreateInstanceN(Control& publicControl)
56 {
57         _OrientationAgent* pAgent = new (std::nothrow) _OrientationAgent(publicControl);
58         SysTryReturn(NID_UI, pAgent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
59
60         result r = GetLastResult();
61         SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
62
63         SetLastResult(E_SUCCESS);
64
65         return pAgent;
66
67 CATCH:
68         delete pAgent;
69         return null;
70 }
71
72 _OrientationAgent::_OrientationAgent(Control& publicControl)
73         : __publicControl(publicControl)
74         , __pPublicEvent(null)
75         , __mode(ORIENTATION_PORTRAIT)
76         , __status(ORIENTATION_STATUS_PORTRAIT)
77         , __tempStatus(ORIENTATION_STATUS_PORTRAIT)
78         , __firePublicEvent(false)
79         , __statusChanged(false)
80         , __updateStatus(true)
81 #if defined(WINDOW_BASE_ROTATE)
82         , __draw(false)
83 #endif
84 {
85         _PublicOrientationEvent* pPublicEvent = _PublicOrientationEvent::CreateInstanceN(publicControl);
86
87         result r = GetLastResult();
88         SysTryReturnVoidResult(NID_UI, pPublicEvent, r, "[%s] Propagating.", GetErrorMessage(r));
89
90         __pPublicEvent = pPublicEvent;
91
92         SetLastResult(E_SUCCESS);
93 }
94
95 _OrientationAgent::~_OrientationAgent(void)
96 {
97         if (__pPublicEvent)
98         {
99                 delete __pPublicEvent;
100                 __pPublicEvent = null;
101         }
102 }
103
104 void
105 _OrientationAgent::AddListener(IOrientationEventListener& listener)
106 {
107         result r = __pPublicEvent->AddListener(listener);
108         SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
109
110         SetLastResult(E_SUCCESS);
111 }
112
113 void
114 _OrientationAgent::RemoveListener(IOrientationEventListener& listener)
115 {
116         result r = __pPublicEvent->RemoveListener(listener);
117         SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
118
119         SetLastResult(E_SUCCESS);
120 }
121
122 Orientation
123 _OrientationAgent::GetMode(void) const
124 {
125         return __mode;
126 }
127
128 OrientationStatus
129 _OrientationAgent::GetStatus(void) const
130 {
131         return __status;
132 }
133
134 void
135 _OrientationAgent::SetMode(Orientation mode)
136 {
137         SysTryReturnVoidResult(NID_UI, mode != ORIENTATION_NONE, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid.");
138
139         SetLastResult(E_SUCCESS);
140
141         if (__mode == mode)
142         {
143                 return;
144         }
145
146         __mode = mode;
147         Update();
148 }
149
150 void
151 _OrientationAgent::Update(bool draw)
152 {
153 #if defined(WINDOW_BASE_ROTATE)
154         _ControlImplManager* pImplManager = _ControlImplManager::GetInstance();
155         SysAssert(pImplManager);
156
157         _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
158         if (!pImpl)
159         {
160                 return;
161         }
162
163         // Set window rotation.
164         _Form* pForm = dynamic_cast<_Form*>(&(pImpl->GetCore()));
165         if (pForm)
166         {
167                 _Control* pParent = pForm->GetParent();
168                 if (pParent)
169                 {
170                         _Form* pCurrentForm = null;
171                         int childCount = pParent->GetChildCount();
172                         
173                         for (int i = childCount; i > 0; i--)
174                         {
175                                 _Control* pChild = pParent->GetChild(i - 1);
176                         
177                                 _Form* pChildForm = dynamic_cast<_Form*>(pChild);
178                                 if (pChildForm)
179                                 {
180                                         if (pChildForm->IsVisible())
181                                         {
182                                                 pCurrentForm = pChildForm;
183
184                                                 break;
185                                         }
186                                 }
187                         }
188
189                         // Current Form
190                         if (pCurrentForm == pForm)
191                         {
192                                 _Window* pWindow = pForm->GetRootWindow();
193                                 if (pWindow)
194                                 {
195                                         Rectangle bounds = pWindow->GetBounds();
196                                         SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d, Form] Set window rotation with mode(%d).", 
197                                                 pWindow->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, __mode);
198                                         SetRotation(*pWindow, __mode);
199                                 }
200
201                                 int owneeCount = pForm->GetOwneeCount();
202                                 for (int i = 0; i < owneeCount; i++)
203                                 {
204                                         _Window* pOwnee = pForm->GetOwnee(i);
205                         
206                                         if (pOwnee)
207                                         {
208                                                 SetRotation(*pOwnee, __mode);
209                                         }
210                                 }
211                         }
212                 }
213                 else
214                 {
215                         switch (__mode)
216                         {
217                         case ORIENTATION_PORTRAIT:
218                                 {
219                                 __draw = draw;
220                                 __tempStatus = ORIENTATION_STATUS_PORTRAIT;
221                                 UpdateOrientation(true);
222                                 }
223                                 break;
224                         case ORIENTATION_LANDSCAPE:
225                                 {
226                                 __draw = draw;
227                                 __tempStatus = ORIENTATION_STATUS_LANDSCAPE;
228                                 UpdateOrientation(true);
229                                 SysLog(NID_UI, "Window Manager Rotation");
230                                 }
231                                 break;
232                         case ORIENTATION_PORTRAIT_REVERSE:
233                                 {
234                                 __draw = draw;
235                                 __tempStatus = ORIENTATION_STATUS_PORTRAIT_REVERSE;
236                                 UpdateOrientation(true);
237                                 }
238                                 break;
239                         case ORIENTATION_LANDSCAPE_REVERSE:
240                                 {
241                                 __draw = draw;
242                                 __tempStatus = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
243                                 UpdateOrientation(true);
244                                 }
245                                 break;
246                         default:
247                                 {
248                                 SysLog(NID_UI, "Window Manager Rotation Default");
249                                 }
250                                 break;
251                         }
252                 }
253         }
254         else
255         {
256                 _Frame* pFrame = dynamic_cast<_Frame*>(&(pImpl->GetCore()));
257
258                 if (pFrame)
259                 {
260                         // Frame which has no forms
261                         int childCount = pFrame->GetChildCount();
262                         if (childCount == 0)
263                         {
264                                 Rectangle bounds = pFrame->GetBounds();
265                                 SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d, Frame] Set window rotation with mode(%d).", 
266                                         pFrame->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, __mode);
267                                 SetRotation(*pFrame, __mode);
268
269                                 int owneeCount = pFrame->GetOwneeCount();
270                                 
271                                 for (int i = 0; i < owneeCount; i++)
272                                 {
273                                         _Window* pOwnee = pFrame->GetOwnee(i);
274
275                                         if (pOwnee)
276                                         {
277                                                 SetRotation(*pOwnee, __mode);
278                                         }
279                                 }
280                         }
281                 }
282         }
283
284         __draw = draw;
285 #else           
286         _ControlImplManager* pImplManager = _ControlImplManager::GetInstance();
287         SysAssert(pImplManager);
288
289         _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
290         if (!pImpl)
291         {
292                 return;
293         }
294
295         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
296         if (!pEcoreEvas)
297         {
298                 return;
299         }
300
301         _Form* pForm = dynamic_cast<_Form*>(&(pImpl->GetCore()));
302         if (pForm)
303         {
304                 _Control* pParent = pForm->GetParent();
305
306                 if (pParent)
307                 {
308                         int index = pParent->GetChildIndex(*pForm);
309                         int childCount = pParent->GetChildCount();
310
311                         if (index == (childCount - 1))
312                         {
313                                 _Window* pWindow = pForm->GetRootWindow();
314                                 if (pWindow)
315                                 {
316                                         if ((__mode == ORIENTATION_AUTOMATIC) || (__mode == ORIENTATION_AUTOMATIC_FOUR_DIRECTION))
317                                         {
318                                                 pEcoreEvas->SetWindowOrientationEnabled(*pWindow, true);
319                                                 pWindow->SetOrientationEnabled(true);
320                                         }
321                                         else
322                                         {
323                                                 pEcoreEvas->SetWindowOrientationEnabled(*pWindow, false);
324                                                 pWindow->SetOrientationEnabled(false);
325                                         }
326                                 }
327                         }
328                 }
329         }
330         else
331         {
332                 _Frame* pFrame = dynamic_cast<_Frame*>(&(pImpl->GetCore()));
333                 if (pFrame)
334                 {
335                         int childCount = pFrame->GetChildCount();
336                         if (childCount == 0)
337                         {
338                                 _Window* pCurrentFrame = _ControlManager::GetInstance()->GetCurrentFrame();
339                                 if (pCurrentFrame == pFrame)
340                                 {
341                                         if ((__mode == ORIENTATION_AUTOMATIC) || (__mode == ORIENTATION_AUTOMATIC_FOUR_DIRECTION))
342                                         {
343                                                 pEcoreEvas->SetWindowOrientationEnabled(*pFrame, true);
344                                                 pFrame->SetOrientationEnabled(true);
345                                         }
346                                         else
347                                         {
348                                                 pEcoreEvas->SetWindowOrientationEnabled(*pFrame, false);
349                                                 pFrame->SetOrientationEnabled(false);
350                                         }
351                                 }
352                         }
353                 }
354         }
355
356         OrientationStatus status = pImplManager->GetOrientationStatus(__mode);
357
358         if (__updateStatus == true)
359         {
360                 __statusChanged = false;
361                 if (__status != status)
362                 {
363                         __statusChanged = true;
364                         __updateStatus = false;
365                 }
366         }
367
368         __status = status;
369
370         pEcoreEvas->AllowSetWindowBounds(false);
371         FireEvent(status);
372         pEcoreEvas->AllowSetWindowBounds(true);
373
374         // For the form to be made by Ui-Builder
375         if ((draw == true) && (__statusChanged == true))
376         {
377                 _ControlOrientation coreOrientation =
378                         (status == ORIENTATION_STATUS_PORTRAIT || status == ORIENTATION_STATUS_PORTRAIT_REVERSE) ?
379                         _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
380
381                 Rectangle temp;
382                 bool exist = pImpl->GetBuilderBounds(coreOrientation, temp);
383                 if (exist)
384                 {
385                         pImpl->Invalidate(true);
386                 }
387         }
388
389         // Despite not changing status, it needs to rotate screen.
390         _ControlImpl* pControlImpl = _ControlImpl::GetInstance(__publicControl);
391         pImplManager->RotateScreen(pControlImpl, status);
392 #endif
393 }
394
395 #if defined(WINDOW_BASE_ROTATE)
396 void
397 _OrientationAgent::UpdateOrientation(bool force)
398 {
399         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
400         if (!pEcoreEvas)
401         {
402                 return;
403         }
404
405         _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
406         if (!pImpl)
407         {
408                 return;
409         }
410
411         int rotation = 0;
412
413         _Window* pWindow = pImpl->GetCore().GetRootWindow();
414         if (pWindow)
415         {
416                 rotation = pEcoreEvas->GetWindowRotation(*pWindow);
417         }
418
419         // Update evas objects.
420         OrientationStatus status = ORIENTATION_STATUS_NONE;
421         switch (rotation)
422         {
423         case 0:
424                 status = ORIENTATION_STATUS_PORTRAIT;
425                 break;
426         case 270:
427                 status = ORIENTATION_STATUS_LANDSCAPE;
428                 break;
429         case 180:
430                 status = ORIENTATION_STATUS_PORTRAIT_REVERSE;
431                 break;
432         case 90:
433                 status = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
434                 break;
435         default:
436                 break;
437         }
438
439         if (force)
440         {
441                 status = __tempStatus;
442         }
443
444         if (__updateStatus == true)
445         {
446                 __statusChanged = false;
447                 if (__status != status)
448                 {
449                         __statusChanged = true;
450                         __updateStatus = false;
451                 }
452         }
453
454         __status = status;
455
456         pEcoreEvas->AllowSetWindowBounds(false);
457         FireEvent(status);
458         pEcoreEvas->AllowSetWindowBounds(true);
459
460         // For the form to be made by Ui-Builder
461         if ((__draw == true) && (__statusChanged == true))
462         {
463                 _ControlOrientation coreOrientation =
464                         (status == ORIENTATION_STATUS_PORTRAIT || status == ORIENTATION_STATUS_PORTRAIT_REVERSE) ?
465                         _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
466
467                 Rectangle temp;
468                 bool exist = pImpl->GetBuilderBounds(coreOrientation, temp);
469                 if (exist)
470                 {
471                         pImpl->Invalidate(true);
472                 }
473         }
474
475         _Window* pRootWindow = pImpl->GetCore().GetRootWindow();
476         if (pRootWindow)
477         {
478                 pEcoreEvas->UpdateWindowBounds(*pRootWindow);
479                 
480                 pImpl->Invalidate(true);
481
482                 Rectangle bounds = pRootWindow->GetBounds();
483                 SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d] Update VEs to %d degree.", 
484                         pRootWindow->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, rotation);
485         }
486 }
487 #endif
488
489 void
490 _OrientationAgent::RequestOrientationEvent(void)
491 {
492         ClearLastResult();
493
494         _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
495         SysTryReturnVoidResult(NID_UI, pImpl, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
496
497         unique_ptr<ArrayList> pEventArgs(new (std::nothrow) ArrayList());
498         SysTryReturnVoidResult(NID_UI, pEventArgs, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
499         pEventArgs->Construct();
500
501         unique_ptr<String> pString(new (std::nothrow) Tizen::Base::String(_REQUEST_ORIENTATION_EVENT));
502         SysTryReturnVoidResult(NID_UI, pString, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
503
504         pEventArgs->Add(*(pString.get()));
505         
506         _UiNotificationEvent event(pImpl->GetCore().GetHandle(), pEventArgs.get());
507
508         result r = _UiEventManager::GetInstance()->PostEvent(event);
509         SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
510
511         pString.release();
512         pEventArgs.release();
513 }
514
515 void
516 _OrientationAgent::FireOrientationEvent(void)
517 {
518         if (__firePublicEvent)
519         {
520                 return;
521         }
522
523         __firePublicEvent = true;
524
525         SysLog(NID_UI, "Fire the orientation event.");
526
527         if (__statusChanged)
528         {
529                 IEventArg* pArg = _PublicOrientationEvent::CreateOrientationEventArgN(*__pPublicEvent->GetSource(), __status);
530                 __pPublicEvent->Fire(*pArg);
531
532                 _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
533                 if (pImpl)
534                 {
535                         _Window* pWindow = pImpl->GetCore().GetRootWindow();
536                         if (pWindow)
537                         {
538                                 SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Fire the public orientation event..", pWindow->GetNativeHandle());
539                         }
540                 }
541
542                 __updateStatus = true;
543         }
544 }
545
546 void
547 _OrientationAgent::FireEvent(OrientationStatus status)
548 {
549         ClearLastResult();
550
551         _ControlManager* pCoreManager = _ControlManager::GetInstance();
552         SysAssert(pCoreManager);
553
554         _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
555         if (!pImpl)
556         {
557                 return;
558         }
559
560         _ControlOrientation coreOrientation =
561                 (status == ORIENTATION_STATUS_PORTRAIT || status == ORIENTATION_STATUS_PORTRAIT_REVERSE) ?
562                 _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
563
564         _ControlImplManager* pImplManager = _ControlImplManager::GetInstance();
565         SysAssert(pImplManager);
566
567         // Core
568         pCoreManager->SetOrientation(coreOrientation);
569         pImplManager->SetOrientationStatus(status);
570         pImpl->GetCore().ChangeLayout(coreOrientation);
571
572 #if !defined(WINDOW_BASE_ROTATE)
573         // Ownee
574         int owneeCount = pImpl->GetCore().GetOwneeCount();
575         for (int i = 0; i < owneeCount; i++)
576         {
577                 _Window* pOwnee = pImpl->GetCore().GetOwnee(i);
578
579                 if (pOwnee)
580                 {
581                         pOwnee->ChangeLayout(coreOrientation);
582                 }
583         }
584 #endif
585
586         // Public
587         if (__firePublicEvent && __statusChanged)
588         {
589                 IEventArg* pArg = _PublicOrientationEvent::CreateOrientationEventArgN(*__pPublicEvent->GetSource(), status);
590                 __pPublicEvent->Fire(*pArg);
591
592                 _Window* pWindow = pImpl->GetCore().GetRootWindow();
593                 if (pWindow)
594                 {
595                         SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Fire the public orientation event..", pWindow->GetNativeHandle());
596                 }
597
598                 __updateStatus = true;
599         }
600 }
601
602 #if defined(WINDOW_BASE_ROTATE)
603 void
604 _OrientationAgent::SetRotation(const _Window& window, Orientation orientation)
605 {
606         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
607         if (!pEcoreEvas)
608         {
609                 return;
610         }
611
612         int deviceOrientation = app_get_device_orientation();
613         int windowRotation = pEcoreEvas->GetWindowRotation(window);
614
615         bool callback = true;
616
617         // Decide updating orientation forcibly.
618         switch (orientation)
619         {
620         case ORIENTATION_PORTRAIT:
621                 {
622                         pEcoreEvas->SetWindowPreferredRotation(window, 0);
623
624                         __tempStatus = ORIENTATION_STATUS_PORTRAIT;
625                         UpdateOrientation(true);
626
627                         return;
628         
629                         /*
630                         if ((deviceOrientation == 0) || (windowRotation == 0))
631                         {
632                                 callback = false;
633                         }
634                         */
635                 }
636                 break;
637         case ORIENTATION_LANDSCAPE:
638                 {
639                         pEcoreEvas->SetWindowPreferredRotation(window, 270);
640
641                         __tempStatus = ORIENTATION_STATUS_LANDSCAPE;
642                         UpdateOrientation(true);
643
644                         return;
645
646                         /*
647                         if ((deviceOrientation == 270) || (windowRotation == 270))
648                         {
649                                 callback = false;
650                         }
651                         */
652                 }
653                 break;
654         case ORIENTATION_PORTRAIT_REVERSE:
655                 {
656                         pEcoreEvas->SetWindowPreferredRotation(window, 180);
657                 
658                         __tempStatus = ORIENTATION_STATUS_PORTRAIT_REVERSE;
659                         UpdateOrientation(true);
660                         
661                         return;
662
663                         /*
664                         if ((deviceOrientation == 180) || (windowRotation == 180))
665                         {
666                                 callback = false;
667                         }
668                         */
669                 }
670                 break;
671         case ORIENTATION_LANDSCAPE_REVERSE:
672                 {
673                         pEcoreEvas->SetWindowPreferredRotation(window, 90);
674                         
675                         __tempStatus = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
676                         UpdateOrientation(true);
677                         
678                         return;
679
680                         /*              
681                         if ((deviceOrientation == 90) || (windowRotation == 90))
682                         {
683                                 callback = false;
684                         }
685                         */
686                 }
687                 break;
688         case ORIENTATION_AUTOMATIC:
689                 {
690                         pEcoreEvas->SetWindowPreferredRotation(window, -1);
691
692                         int autoRotation[3] = {0, 90, 270};
693                         pEcoreEvas->SetWindowAvailabledRotation(window, autoRotation, 3);
694
695                         if (deviceOrientation == windowRotation)
696                         {
697                                 callback = false;
698                         }
699                         else
700                         {
701                                 if (deviceOrientation == 180)
702                                 {
703                                         callback = false;
704                                 }
705                         }
706                 }
707                 break;
708         case ORIENTATION_AUTOMATIC_FOUR_DIRECTION:
709                 {
710                         pEcoreEvas->SetWindowPreferredRotation(window, -1);
711
712                         int autoFourRotation[4] = {0, 90, 180, 270};
713                         pEcoreEvas->SetWindowAvailabledRotation(window, autoFourRotation, 4);
714
715                         if (deviceOrientation == windowRotation)
716                         {
717                                 callback = false;
718                         }
719                 }
720                 break;
721         default:
722                 break;
723         }
724
725         if (callback == false)
726         {
727                 UpdateOrientation();
728         }
729 }
730 #endif
731
732 }} // Tizen::Ui