add patch
[framework/osp/uifw.git] / src / app / FApp_UiAppImpl.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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        FApp_UiAppImpl.cpp
20  * @brief       This is the implementation for the _UiAppImpl class.
21  */
22
23 #include <appsvc/appsvc.h>
24 #include <bundle.h>
25 #include <glib.h>
26 #include <unique_ptr.h>
27 #include <X11/Xatom.h>
28 #include <X11/Xlib.h>
29
30 #include <FBaseSysLog.h>
31 #include <FBaseColArrayList.h>
32 #include <FAppAppRegistry.h>
33 #include <FUiCtrlFrame.h>
34
35 #include <FBaseRt_Process.h>
36 #include <FUi_ControlImplManager.h>
37 #include <FUi_KeyEventManager.h>
38 #include <FUi_WindowImpl.h>
39 #include <FUi_EcoreEvasMgr.h>
40 #include <FUi_EcoreEvas.h>
41 #include <FUi_UiNotificationEvent.h>
42 #include <FUi_UiEventManager.h>
43 #include <FUiCtrl_FrameImpl.h>
44 #include <FSys_PowerManagerImpl.h>
45 #include <FSys_SettingInfoImpl.h>
46
47 #include "FApp_AppFrame.h"
48 #include "FApp_AppInfo.h"
49 #include "FApp_AppImpl.h"
50 #include "FApp_UiAppImpl.h"
51 #include "FApp_AppArg.h"
52
53 using namespace std;
54 using namespace Tizen::App;
55 using namespace Tizen::Base;
56 using namespace Tizen::Base::Collection;
57 using namespace Tizen::Base::Runtime;
58 using namespace Tizen::Ui;
59 using namespace Tizen::Ui::Controls;
60 using namespace Tizen::System;
61 using namespace Tizen::Graphics;
62
63
64 extern "C" int appsvc_request_transient_app(bundle*, Ecore_X_Window, appsvc_host_res_fn, void*);
65 extern "C" int appcore_set_app_state(int);
66
67 namespace Tizen { namespace App
68 {
69
70 _UiAppImpl* _UiAppImpl::__pUiAppImpl = null;
71
72
73 _UiAppImpl::_UiAppImpl(UiApp* pUiApp)
74         : __pAppFrame(null)
75         , __pAppImpl(_AppImpl::GetInstance())
76         , __appUiState(APP_UI_STATE_BACKGROUND)
77         , __pFrameList(null)
78         , __pUiApp(pUiApp)
79 {
80         __pUiAppImpl = this;
81         __pFrameList = new (std::nothrow) ArrayList();
82         SysTryReturnVoidResult(NID_APP, __pFrameList != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
83         __pFrameList->Construct();
84         SysTryReturnVoidResult(NID_APP, __pAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting internal instance failed.");
85 }
86
87
88 _UiAppImpl::~_UiAppImpl(void)
89 {
90         RemoveAllFrames();
91
92         delete __pAppFrame;
93         __pUiAppImpl = null;
94 }
95
96
97 bool
98 _UiAppImpl::OnCreate(void)
99 {
100         SysLog(NID_APP, "Platform creation event.");
101
102         _AppInfo::SetAppState(INITIALIZING);
103
104         return true;
105 }
106
107
108 void
109 _UiAppImpl::RaiseFrame(Frame& frame)
110 {
111         _FrameImpl* pFrameImpl = _FrameImpl::GetInstance(frame);
112
113         if (pFrameImpl)
114         {
115                 // [N_SE-39536] Window raise is requested as synchronous due to B/S issue
116                 _EcoreEvas* pEvas = GetEcoreEvasMgr()->GetEcoreEvas();
117                 if (pEvas)
118                 {
119                         pEvas->ActivateWindow(pFrameImpl->GetCore());
120                 }
121         }
122 }
123
124
125 long
126 _UiAppImpl::GetTargetWindowHandle(void) const
127 {
128         result r = E_SUCCESS;
129
130         _EcoreEvasMgr* pEcoreEvasMgr = GetEcoreEvasMgr();
131         r = GetLastResult();
132         SysTryReturn(NID_APP, pEcoreEvasMgr, -1, r, "Propagating.");
133
134         _EcoreEvas* pEcoreEvas = pEcoreEvasMgr->GetEcoreEvas();
135         r = GetLastResult();
136         SysTryReturn(NID_APP, pEcoreEvas, -1, r, "Propagating.");
137
138         Atom actualTypeReturn;
139         int actualFormatReturn;
140         unsigned long nItemsReturn;
141         unsigned long bytesAfterReturn;
142         unsigned char* pPropReturn = null;
143
144     gint ret = 0;
145     ret = XGetWindowProperty(static_cast<Display*>(ecore_x_display_get()),
146                                                         ecore_x_window_root_get(pEcoreEvas->GetXWindow()),
147                                                         ecore_x_atom_get("_ISF_ACTIVE_WINDOW"),
148                                                         0,
149                                                         G_MAXLONG,
150                                                         false,
151                                                         XA_WINDOW,
152                                                         &actualTypeReturn,
153                                                         &actualFormatReturn,
154                                                         &nItemsReturn,
155                                                         &bytesAfterReturn,
156                                                         &pPropReturn);
157         SysTryReturn(NID_APP, ret == Success, -1, E_SYSTEM, "A failure occurs from the underlying system.");
158
159         Ecore_X_Window targetWindow = 0;
160
161         if (pPropReturn)
162         {
163                 if (actualTypeReturn == XA_WINDOW)
164                 {
165                         targetWindow = *(reinterpret_cast<Ecore_X_Window*>(pPropReturn));
166                         SysLog(NID_APP, "The handle of the target window is %x.", targetWindow);
167                 }
168
169                 XFree(pPropReturn);
170         }
171
172         return targetWindow? targetWindow: -1;
173 }
174
175
176 static int
177 TransientResponseCb(void* pData)
178 {
179         SysLog(NID_APP, "Handling cleanup for submode app.");
180
181         // platform invokes ecore_main_loop_quit() after returning this callback
182         return 0;
183 }
184
185 void
186 _UiAppImpl::OnService(service_s* service, bool initial)
187 {
188         Frame* pFrame = dynamic_cast<Frame*>(__pFrameList->GetAt(0));
189         _EcoreEvas* pEvas = GetEcoreEvasMgr()->GetEcoreEvas();
190
191         const int type = _AppInfo::GetAppType();
192
193         if (type & _APP_TYPE_IME_APP)
194         {
195                 bundle* pBundle = _AppArg::GetBundleFromSvc(service);
196                 const int pid = _AppArg::GetCallerPid(pBundle);
197                 if (pid > 0)
198                 {
199                         SysLogException(NID_APP, E_SYSTEM, "ImeApp should not be the target for launch API (caller : %d).", pid);
200                         _Process::Exit(-1);
201                 }
202         }
203
204         // make OnForeground event
205         if (pFrame != null)
206         {
207                 // handle submode
208                 if (pEvas && _AppInfo::IsSubMode())
209                 {
210                         unsigned int win = 0;
211                         service_get_window(service, &win);
212
213                         _FrameImpl* pFrameImpl = _FrameImpl::GetInstance(*pFrame);
214                         if (static_cast<int>(win) > 0 && pFrameImpl != null)
215                         {
216                                 const unsigned int curHandle = pFrameImpl->GetNativeHandle();
217
218                                 bundle* pBundle = _AppArg::GetBundleFromSvc(service);
219                                 const int pid = _AppArg::GetCallerPid(pBundle);
220                                 if (pid <= 0 || ((kill(pid, 0) < 0) && errno == ESRCH))
221                                 {
222                                         SysLogException(NID_APP, E_SYSTEM, "Caller process %d with %d not exist : terminating %d.", pid, win, getpid());
223                                         _Process::Exit(-1);
224                                 }
225
226                                 int ret = appsvc_request_transient_app(pBundle, curHandle, TransientResponseCb, NULL);
227
228                                 SysLog(NID_APP, "Transient sets for (0x%x) with result (%d).", curHandle, ret);
229                         }
230                 }
231
232                 if (initial)
233                 {
234                         const int type = _AppInfo::GetAppType();
235                         if (type & _APP_TYPE_IME_APP)
236                         {
237                                 SysLog(NID_APP, "Skipping 1st resume for IME app.");
238                         }
239                         else
240                         {
241                                 OnResume();
242                         }
243                 }
244         }
245
246         // [INFO] to confirm that the window is not foreground
247         if (pEvas)
248         {
249                 int pid = pEvas->GetProcessId(pEvas->GetActiveWindow());
250                 SysLog(NID_APP, "%d -> %d", pid, _AppInfo::GetProcessId());
251                 if (pid != _AppInfo::GetProcessId())
252                 {
253                         if (!initial)
254                         {
255                                 if (pFrame != null)
256                                 {
257                                         _FrameImpl* pFrameImpl = _FrameImpl::GetInstance(*pFrame);
258
259                                         // [FIXME] Multi window handling
260                                         if (pFrameImpl != null)
261                                         {
262                                                 //pEvas->ActivateWindow(pFrameImpl->GetCore());
263
264                                                 unique_ptr<ArrayList> pEventArgs(new (std::nothrow) ArrayList());
265                                                 SysTryReturnVoidResult(NID_APP, pEventArgs, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
266                                                 pEventArgs->Construct();
267
268                                                 unique_ptr<String> pString(new (std::nothrow) Tizen::Base::String(L"ActivateFrame"));
269                                                 SysTryReturnVoidResult(NID_APP, pString, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
270
271                                                 pEventArgs->Add(*(pString.get()));
272
273                                                 _UiNotificationEvent event(pFrameImpl->GetCore().GetHandle(), pEventArgs.get());
274
275                                                 result r = _UiEventManager::GetInstance()->PostEvent(event);
276                                                 SysTryReturnVoidResult(NID_APP, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
277
278                                                 pString.release();
279                                                 pEventArgs.release();
280
281                                                 // N_SE-24616, N_SE-24383 for OnForground() and visibility issue
282                                                 OnResume();
283                                         }
284                                 }
285                         }
286                 }
287         }
288 }
289
290
291 void
292 _UiAppImpl::OnTerminate(void)
293 {
294         SysLog(NID_APP, "Termination event 0x%x state", _AppInfo::GetAppState());
295
296         if (__pUiApp->GetAppUiState() == APP_UI_STATE_FOREGROUND)
297         {
298                 OnPause();
299         }
300
301         if (OnUiAppImplTerminating() != true)
302         {
303                 SysLog(NID_APP, "[E_SYSTEM] The Termination of application failed.");
304         }
305 }
306
307
308 void
309 _UiAppImpl::OnResume(void)
310 {
311         SysLog(NID_APP, "System resume event on 0x%x state", _AppInfo::GetAppState());
312
313         if (_AppInfo::GetAppState() == RUNNING)
314         {
315                 OnForeground();
316         }
317 }
318
319
320 void
321 _UiAppImpl::OnPause(void)
322 {
323         SysLog(NID_APP, "System pause event on 0x%x state", _AppInfo::GetAppState());
324
325         if (_AppInfo::GetAppState() == RUNNING)
326         {
327                 OnBackground();
328         }
329 }
330
331
332 result
333 _UiAppImpl::OnFrameRaiseRequested(void)
334 {
335         SysLog(NID_APP, "Frame raise is requested.");
336
337         Frame* pFrame = null;
338         if (__pFrameList == null || (pFrame = dynamic_cast<Frame*>(__pFrameList->GetAt(0))) == null)
339         {
340                 SysLog(NID_APP, "No frame is available.");
341                 return E_SUCCESS;
342         }
343
344         if (__appUiState == APP_UI_STATE_FOREGROUND)
345         {
346                 SysLog(NID_APP, "Already foreground state.");
347                 return E_SUCCESS;
348         }
349
350         RaiseFrame(*pFrame);
351         return E_SUCCESS;
352 }
353
354
355 long
356 _UiAppImpl::OnWindowHandleRequest(void)
357 {
358         long handle = -1;
359         const int type = _AppInfo::GetAppType();
360
361         if (type & _APP_TYPE_IME_APP)
362         {
363                 handle = GetTargetWindowHandle();
364         }
365         else
366         {
367                 const _EcoreEvas* const pEvas = GetEcoreEvasMgr()->GetEcoreEvas();
368                 handle = (pEvas) ? static_cast<long>(pEvas->GetXWindow()) : -1;
369         }
370
371         return handle;
372 }
373
374
375 result
376 _UiAppImpl::AddFrame(const Frame& frame)
377 {
378         result r = E_SUCCESS;
379         Frame& tmpFrame = const_cast <Frame&>(frame);
380
381         SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed.");
382         SysTryReturnResult(NID_APP, !__pFrameList->Contains(tmpFrame), E_OBJ_ALREADY_EXIST, "The frame is already registered.");
383
384         _WindowImpl* pFrameImpl = _WindowImpl::GetInstance(tmpFrame);
385         SysTryReturnResult(NID_APP, pFrameImpl != null, E_INVALID_ARG, "The frame is not constructed yet.");
386
387         __pFrameList->Add(tmpFrame);
388         r = pFrameImpl->Open(false); // Attach to the main tree without 'draw & show'.
389         if (IsFailed(r))
390         {
391                 SysLog(NID_UI, "Failed to attach frame.");
392                 __pFrameList->Remove(tmpFrame);
393         }
394
395         return r;
396 }
397
398
399 IAppFrame*
400 _UiAppImpl::GetAppFrame(void)
401 {
402         SysTryReturn(NID_APP, __pFrameList != null, null, E_INVALID_STATE, "[E_INVALID_STATE] Getting FrameList failed.");
403         int frameCount = __pFrameList->GetCount();
404
405         if (frameCount <= 0)
406         {
407                 SysLogException(NID_APP, E_OBJ_NOT_FOUND, "There is no frame !!! use AddFrame() before call GetAppFrame()");
408                 SysAssertf(false, "There is no frame !!! use AddFrame() before call GetAppFrame()");
409         }
410
411         Frame* pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(frameCount - 1));
412
413         if (pFrame == null)
414         {
415                 SysLogException(NID_APP, E_OBJ_NOT_FOUND, "There is no frame !!! use AddFrame() before call GetAppFrame()");
416                 SysAssertf(false, "There is no frame !!! use AddFrame() before call GetAppFrame()");
417         }
418
419         if (__pAppFrame == null)
420         {
421                 __pAppFrame = new (std::nothrow) _AppFrame(*pFrame);
422                 SysTryReturn(NID_APP, __pAppFrame != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
423                 __pAppFrame->Construct();
424         }
425         else if (__pAppFrame->GetFrame() != pFrame)
426         {
427                 __pAppFrame->SetFrame(pFrame);
428         }
429
430         return __pAppFrame;
431 }
432
433
434 result
435 _UiAppImpl::RemoveFrame(const Frame& frame)
436 {
437         result r = E_SUCCESS;
438         SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed.");
439
440         Frame& tmpFrame = const_cast <Frame&>(frame);
441         _WindowImpl* pFrameImpl = _WindowImpl::GetInstance(tmpFrame);
442
443         r = __pFrameList->Remove(frame, false);
444
445         if (pFrameImpl)
446         {
447                 pFrameImpl->Destroy();
448         }
449
450         return r;
451 }
452
453
454 result
455 _UiAppImpl::RemoveAllFrames(void)
456 {
457         result r = E_SUCCESS;
458         SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed.");
459
460         int frameCount = __pFrameList->GetCount();
461         for (int i = 0; i < frameCount; i++)
462         {
463                 Frame* pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(i));
464                 if (pFrame)
465                 {
466                         _WindowImpl* pFrameImpl = _WindowImpl::GetInstance(*pFrame);
467                         if (pFrameImpl)
468                         {
469                                 pFrameImpl->Destroy();
470                         }
471                 }
472         }
473
474         if (__pFrameList->GetCount() > 0)
475         {
476                 __pFrameList->RemoveAll(false);
477         }
478
479         delete __pFrameList;
480         __pFrameList = null;
481
482         return r;
483 }
484
485
486 IList*
487 _UiAppImpl::GetFrameList(void)
488 {
489         return __pFrameList;
490 }
491
492
493 Frame*
494 _UiAppImpl::GetFrame(const String& name)
495 {
496         Frame* pFrame = null;
497         SysTryReturn(NID_APP, __pFrameList != null, null, E_INVALID_STATE, "[E_INVALID_STATE] Getting FrameList failed.");
498         int frameCount = __pFrameList->GetCount();
499
500         for (int i = 0; i < frameCount; i++)
501         {
502                 pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(i));
503
504                 if (pFrame != null && pFrame->GetName() == name)
505                 {
506                         return pFrame;
507                 }
508         }
509
510         return null;
511 }
512
513
514 Frame*
515 _UiAppImpl::GetFrameAt(int index)
516 {
517         Frame* pFrame = null;
518         SysTryReturn(NID_APP, __pFrameList != null, null, E_INVALID_STATE, "[E_INVALID_STATE] Getting FrameList failed.");
519         SysTryReturn(NID_APP, index >= 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is less than 0.");
520
521         int frameCount = __pFrameList->GetCount();
522         SysTryReturn(NID_APP, index < frameCount, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is greater than the number of frames.");
523
524         pFrame = dynamic_cast <Frame*>(__pFrameList->GetAt(index));
525
526         return pFrame;
527 }
528
529 bool
530 _UiAppImpl::OnAppInitializing(void)
531 {
532         // Do Ui related initializing for UiApp
533         result r = InitializeUiFramework();
534         if (IsFailed(r))
535         {
536                 SysLogException(NID_APP, E_SYSTEM, "Getting resolution information failure. Application may not be installed correctly.");
537                 _Process::Exit(-1);
538         }
539
540         _KeyEventManager* pKeyManager = _KeyEventManager::GetInstance();
541         if (pKeyManager)
542         {
543                 pKeyManager->AddKeyEventListener(*this);
544         }
545
546         // API versioning for initial frame creation
547         if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
548         {       // if API version is less than 3.0, create initial frame
549                 Frame* pDefaultFrame = new (std::nothrow) Frame();
550                 SysTryReturn(NID_APP, pDefaultFrame != null, false, r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Frame creation failed.");
551                 pDefaultFrame->Construct();
552                 AddFrame(*pDefaultFrame);
553                 SysLog(NID_APP, "Default frame is added for API version %d Compatibility.", _AppInfo::GetApiVersion());
554         }
555
556         SysTryReturn(NID_APP, __pUiApp != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Getting UiApp instance failed.");
557
558         SysLog(NID_APP, "Entering user OnAppInitializing().");
559         const bool bReturn = __pUiApp->OnAppInitializing(*(AppRegistry::GetInstance()));
560
561         SysLog(NID_APP, "Back to the platform initializing routine.");
562         _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
563         return bReturn;
564 }
565
566
567 bool
568 _UiAppImpl::OnAppInitialized(void)
569 {
570         SysTryReturn(NID_APP, __pUiApp != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Getting UiApp instance failed.");
571
572         const bool b = __pUiApp->OnAppInitialized();
573
574         Frame* pFrame = dynamic_cast<Frame*>(__pFrameList->GetAt(0));
575         if (pFrame)
576         {
577                 int type = _AppInfo::GetAppType();
578                 if (type & _APP_TYPE_IME_APP)
579                 {
580                         SysLog(NID_APP, "Defering frame update for IME app.");
581                         pFrame->SetShowState(false);
582                         appcore_set_app_state(3);
583                 }
584         }
585
586         if (b)
587         {
588                 if (__pFrameList->GetCount() > 0)
589                 {
590                         return true;
591                 }
592                 else
593                 {
594                         SysLogException(NID_APP, E_OBJ_NOT_FOUND, "There is no frame !!! use AddFrame() before returning OnAppInitialized()");
595                         SysAssertf(false, "There is no frame !!! use AddFrame() before returning OnAppInitialized()");
596                 }
597         }
598         return false;
599 }
600
601
602 bool
603 _UiAppImpl::OnUiAppImplTerminating(void)
604 {
605         bool result = false;
606
607         RemoveAllFrames();
608
609         if (_AppInfo::GetAppState() != TERMINATED)
610         {
611                 result = __pUiApp->OnAppTerminating(*(AppRegistry::GetInstance()), __pAppImpl->IsForcedTermination());
612                 _AppInfo::SetAppState(TERMINATED);
613         }
614
615         // Do Ui related finalizing for UiApp
616         FinalizeUiFramework();
617
618         return result;
619 }
620
621
622 bool
623 _UiAppImpl::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
624 {
625         return false;
626 }
627
628
629 bool
630 _UiAppImpl::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
631 {
632         if (__appUiState == APP_UI_STATE_FOREGROUND)
633         {
634                 if (keyInfo.GetKeyCode() == _KEY_END)
635                 {
636                         SysTryReturn(NID_APP, __pUiApp != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Getting UI App instance failed.");
637
638                         if (__pUiApp->OnAppWillTerminate())
639                         {
640                                 __pUiApp->Terminate();
641                                 return true;
642                         }
643                 }
644         }
645         return false;
646 }
647
648
649 void
650 _UiAppImpl::OnForeground(void)
651 {
652         result r = E_SUCCESS;
653
654         SysLog(NID_APP, "Invoking application callback.");
655
656         __appUiState = APP_UI_STATE_FOREGROUND;
657         __pUiApp->OnForeground();
658
659         SysLog(NID_APP, "Returned from application callback.");
660
661         r = _PowerManagerImpl::OnForeground();
662
663         SysTryLog(NID_APP, !IsFailed(r), "Failed to send foreground event to powermanager");
664 }
665
666
667 void
668 _UiAppImpl::OnBackground(void)
669 {
670         result r = E_SUCCESS;
671
672         SysLog(NID_APP, "Invoking application callback.");
673
674         __appUiState = APP_UI_STATE_BACKGROUND;
675         __pUiApp->OnBackground();
676
677         SysLog(NID_APP, "Returned from application callback.");
678
679         r = _PowerManagerImpl::OnBackground();
680
681         SysTryLog(NID_APP, !IsFailed(r), "Failed to send background event to powermanager");
682 }
683
684
685 AppUiState
686 _UiAppImpl::GetAppUiState(void) const
687 {
688         return __appUiState;
689 }
690
691
692 _UiAppImpl*
693 _UiAppImpl::GetInstance(void)
694 {
695         return __pUiAppImpl;
696 }
697
698
699 UiApp*
700 _UiAppImpl::GetUiAppInstance(void)
701 {
702         return __pUiApp;
703 }
704
705 void
706 _UiAppImpl::OnSettingChanged(String& key)
707 {
708         SysLog(NID_APP,"Changed Key: %ls", key.GetPointer());
709
710         if (key == L"http://tizen.org/setting/locale.language")
711         {
712                 _AppImpl::OnLanguageChanged(null);
713         }
714 }
715
716 } } //Tizen::App