Fixed return value.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_Indicator.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  * @file                FUiCtrl_Indicator.cpp
19  * @brief               This is the implementation file for the _Form class.
20  */
21
22 #include <FGrpRectangle.h>
23 #include <FGrp_CoordinateSystem.h>
24 #include <FUiAnim_VisualElementSurfaceImpl.h>
25 #include "FUiAnim_VisualElement.h"
26 #include "FUiAnim_VisualElementImpl.h"
27 #include "FUiAnim_EflNode.h"
28 #include "FUi_EcoreEvasMgr.h"
29 #include "FUi_EcoreEvas.h"
30 #include "FUi_ResourceManager.h"
31 #include "FUi_CoordinateSystemUtils.h"
32 #include "FUi_Window.h"
33 #include "FUiCtrl_Form.h"
34 #include "FUiCtrl_Indicator.h"
35 #include "FUiCtrl_IndicatorManager.h"
36
37 using namespace Tizen::Base::Runtime;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Ui;
40 using namespace Tizen::Ui::Animations;
41
42 namespace Tizen { namespace Ui { namespace Controls
43 {
44
45 static const char* pPortraitSvcName = "elm_indicator_portrait";
46 static const char* pLandScapeSvcName = "elm_indicator_landscape";
47 static const char* pPortPublicKey = "__Plug_Ecore_Evas_Port";
48 static const char* pLandPublicKey = "__Plug_Ecore_Evas_Land";
49 static const char* pIndicatorKey = "Inidcator_Manager_Object";
50 static const int CONNECTION_INTERVAL = 1000;
51
52 #define MSG_DOMAIN_CONTROL_INDICATOR 0x10001
53 #define MSG_ID_INDICATOR_REPEAT_EVENT 0x10002
54 #define MSG_ID_INDICATOR_ROTATION 0x10003
55 #define MSG_ID_INDICATOR_OPACITY 0X1004
56 #define MSG_ID_INDICATOR_TYPE 0X1005
57
58 typedef enum
59 {
60    _INDICATOR_TYPE_UNKNOWN, /**< Unknown indicator type mode */
61    _INDICATOR_TYPE_1, /**< Type 0 the the indicator */
62    _INDICATOR_TYPE_2, /**< Type 1 the indicator */
63 } _IndicatorTypeMode;
64
65 _Indicator*
66 _Indicator::CreateIndicator(void)
67 {
68         result r = E_SUCCESS;
69         Color bgColor(0xff343432);
70
71         _Indicator* pIndicator = new (std::nothrow) _Indicator;
72         SysTryReturn(NID_UI_CTRL, pIndicator, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
73         SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred.");
74
75         r = pIndicator->ConstructControlVisualElement();
76         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
77
78         pIndicator->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
79
80         return pIndicator;
81
82 CATCH:
83         delete pIndicator;
84         return null;
85 }
86
87 _Indicator::_Indicator(void)
88         : __pPortraitIndicatorEvasObject(null)
89         , __pLandscapeIndicatorEvasObject(null)
90         , __pConnectionTimer(null)
91         , __pPortraitVisualElement(null)
92         , __pLandscapeVisualElement(null)
93         , __pCurrentVisualElement(null)
94         , __pWindow(null)
95         , __showstate(false)
96         , __autohide(false)
97         , __opacity(_INDICATOR_OPACITY_OPAQUE)
98         , __orientation(_CONTROL_ORIENTATION_PORTRAIT)
99 {
100 }
101
102 _Indicator::~_Indicator(void)
103 {
104         if (__pConnectionTimer != null)
105         {
106                 __pConnectionTimer->Cancel();
107                 delete __pConnectionTimer;
108                 __pConnectionTimer = null;
109         }
110 }
111
112 result
113 _Indicator::SetIndicatorShowState(bool state)
114 {
115         result r = E_SUCCESS;
116
117         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
118         SysTryReturnResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] Unable to get evas");
119
120         if (__pWindow)
121         {
122                 r = pEcoreEvas->SetIndicatorShowState(*__pWindow, state);
123                 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
124         }
125
126         __showstate = state;
127
128         SetShowState(state);
129
130         if (state)
131         {
132                 SetIndicatorOpacity(__opacity);
133         }
134
135         return r;
136 }
137
138 void
139 _Indicator::SetIndicatorAutoHide(bool autohide)
140 {
141         Ecore_X_Window win;
142         if (__pWindow)
143         {
144                 win = (Ecore_X_Window)__pWindow->GetNativeHandle();
145         }
146
147         Ecore_Evas *pPortraitEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject);
148         SysTryReturnVoidResult(NID_UI_CTRL, pPortraitEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
149         Ecore_Evas *pLandscapeEe = ecore_evas_object_ecore_evas_get(__pLandscapeIndicatorEvasObject);
150         SysTryReturnVoidResult(NID_UI_CTRL, pLandscapeEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
151
152         if (autohide)
153         {
154                 Color bgColor(0x00000000);
155                 SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
156    ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
157         }
158         else
159         {
160                 SetIndicatorOpacity(__opacity);
161                 ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
162         }
163
164         __autohide = autohide;
165 }
166
167 result
168 _Indicator::SetIndicatorOpacity(_IndicatorOpacity opacity)
169 {
170         result r = E_SUCCESS;
171
172         if (opacity == _INDICATOR_OPACITY_OPAQUE)
173         {
174                 Color bgColor(0xff343432);
175                 SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
176         }
177         else if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
178         {
179                 if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
180                 {
181                         Color bgColor(0x7f000000);
182                         SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
183                 }
184                 else
185                 {
186                         Color bgColor(0x00000000);
187                         SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
188                 }
189         }
190
191         __opacity = opacity;
192
193         return r;
194 }
195
196 bool
197 _Indicator::GetIndicatorShowState(void) const
198 {
199         return __showstate;
200 }
201
202 _IndicatorOpacity
203 _Indicator::GetIndicatorOpacity(void) const
204 {
205         if (__autohide)
206         {
207                 return _INDICATOR_OPACITY_TRANSPARENT;
208         }
209
210         return __opacity;
211 }
212
213 bool
214 _Indicator::GetIndicatorAutoHide(void) const
215 {
216         return __autohide;
217 }
218
219 Rectangle
220 _Indicator::GetIndicatorBounds(void) const
221 {
222         const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize();
223         const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width);
224
225         _ControlOrientation orientation = __pWindow->GetOrientation();
226
227         Rectangle indicatorbounds(0, 0, 0, 0);
228
229         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
230         {
231                 indicatorbounds.width = portraitSize.width;
232                 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
233         }
234         else
235         {
236                 indicatorbounds.width = landscapeSize.width;
237                 GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
238         }
239
240         _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
241         SysTryReturn(NID_UI_CTRL, pCoordSystem, Rectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed.");
242
243         _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetTransformer();
244         SysTryReturn(NID_UI_CTRL, pXformer, Rectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed.");
245
246         indicatorbounds = pXformer->Transform(indicatorbounds);
247
248         return indicatorbounds;
249 }
250
251 FloatRectangle
252 _Indicator::GetIndicatorBoundsF(void) const
253 {
254         const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
255         const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
256
257         _ControlOrientation orientation = __pWindow->GetOrientation();
258
259         FloatRectangle indicatorbounds(0.0f, 0.0f, 0.0f, 0.0f);
260
261         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
262         {
263                 indicatorbounds.width = portraitSize.width;
264                 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
265         }
266         else
267         {
268                 indicatorbounds.width = landscapeSize.width;
269                 GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
270         }
271
272         _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
273         SysTryReturn(NID_UI_CTRL, pCoordSystem, FloatRectangle(-1.0, -1.0, -1.0, -1.0), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed.");
274
275         _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetTransformer();
276         SysTryReturn(NID_UI_CTRL, pXformer, FloatRectangle(-1.0, -1.0, -1.0, -1.0), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed.");
277
278         indicatorbounds = pXformer->Transform(indicatorbounds);
279
280         return indicatorbounds;
281 }
282
283 result
284 _Indicator::AddIndicatorObject(_Control* pControl, _Window* pWindow)
285 {
286         result r = E_SUCCESS;
287
288         __pWindow = pWindow;
289
290         __pPortraitVisualElement =      _IndicatorManager::GetInstance()->GetIndicatorVisualElement(pWindow, _INDICATOR_ORIENTATION_PORTRAIT, pControl);
291         SysTryReturn(NID_UI_CTRL, __pPortraitVisualElement, null,  E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface.");
292         __pLandscapeVisualElement = _IndicatorManager::GetInstance()->GetIndicatorVisualElement(pWindow, _INDICATOR_ORIENTATION_LANDSCAPE, pControl);
293         SysTryReturn(NID_UI_CTRL, __pLandscapeVisualElement, null,  E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface.");
294         __pPortraitIndicatorEvasObject = _IndicatorManager::GetInstance()->GetEvasObject(pWindow, pControl, _INDICATOR_ORIENTATION_PORTRAIT);
295         SysTryReturn(NID_UI_CTRL, __pPortraitIndicatorEvasObject, null,  E_SYSTEM, "[E_SYSTEM] Indicator can not get the Evas_Object.");
296         __pLandscapeIndicatorEvasObject = _IndicatorManager::GetInstance()->GetEvasObject(pWindow, pControl, _INDICATOR_ORIENTATION_LANDSCAPE);
297         SysTryReturn(NID_UI_CTRL, __pLandscapeIndicatorEvasObject, null,  E_SYSTEM, "[E_SYSTEM] Indicator can not get the Evas_Object.");
298
299         _ControlOrientation orientation = pControl->GetOrientation();
300         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
301         {
302                 r = ChangeCurrentVisualElement(__pPortraitVisualElement);
303         }
304         else
305         {
306                 r = ChangeCurrentVisualElement(__pLandscapeVisualElement);
307         }
308
309         Ecore_Evas *pPortraitEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject);
310         SysTryReturn(NID_UI_CTRL, pPortraitEe, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
311         Ecore_Evas *pLandscapeEe = ecore_evas_object_ecore_evas_get(__pLandscapeIndicatorEvasObject);
312         SysTryReturn(NID_UI_CTRL, pLandscapeEe, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
313
314         ecore_evas_data_set(pPortraitEe, pPortPublicKey, __pPortraitIndicatorEvasObject);
315         ecore_evas_data_set(pLandscapeEe, pLandPublicKey, __pLandscapeIndicatorEvasObject);
316         ecore_evas_data_set(pPortraitEe, pIndicatorKey, this);
317         ecore_evas_data_set(pLandscapeEe, pIndicatorKey, this);
318         ecore_evas_callback_delete_request_set(pPortraitEe, _Indicator::OnDisconnected);
319         ecore_evas_callback_delete_request_set(pLandscapeEe, _Indicator::OnDisconnected);
320
321         ecore_evas_callback_msg_handle_set(pPortraitEe, _Indicator::OnMessageHandle);
322         ecore_evas_callback_msg_handle_set(pLandscapeEe, _Indicator::OnMessageHandle);
323
324         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
325         int rotation = 0;
326         if (pEcoreEvas && __pWindow)
327         {
328                 rotation = pEcoreEvas->GetWindowRotation(*__pWindow);
329         }
330
331         if(rotation == 0 || rotation == 180)
332         {
333                 ecore_evas_msg_parent_send(pPortraitEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
334         }
335         else
336         {
337                 ecore_evas_msg_parent_send(pLandscapeEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
338         }
339
340         return r;
341 }
342
343 result
344 _Indicator::DeleteIndicatorObject(void)
345 {
346         result r = E_SUCCESS;
347
348         r = _IndicatorManager::GetInstance()->ReleaseIndicatorVisualElement(__pWindow, _INDICATOR_ORIENTATION_PORTRAIT, __pPortraitVisualElement);
349         r = _IndicatorManager::GetInstance()->ReleaseIndicatorVisualElement(__pWindow, _INDICATOR_ORIENTATION_LANDSCAPE, __pLandscapeVisualElement);
350
351                 if (__pPortraitVisualElement)
352         {
353                 r = DetachChild(*__pPortraitVisualElement);
354         }
355         if (__pLandscapeVisualElement)
356         {
357                 r = DetachChild(*__pLandscapeVisualElement);
358         }
359
360         __pPortraitIndicatorEvasObject = null;
361         __pLandscapeIndicatorEvasObject = null;
362         __pPortraitVisualElement = null;
363         __pLandscapeVisualElement = null;
364         __pCurrentVisualElement = null;
365
366         return r;
367 }
368
369 result
370 _Indicator::ChangeCurrentVisualElement(Tizen::Ui::Animations::_VisualElement* pVisualElement)
371 {
372         result r = E_SUCCESS;
373
374         if (!(__pCurrentVisualElement == pVisualElement))
375         {
376                 r = AttachChild(*pVisualElement);
377                 if (__pCurrentVisualElement)
378                 {
379                         r = DetachChild(*__pCurrentVisualElement);
380                 }
381                 __pCurrentVisualElement = pVisualElement;
382         }
383
384         return r;
385 }
386
387 void
388 _Indicator::OnChangeLayout(_ControlOrientation orientation)
389 {
390         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
391         {
392                 ChangeCurrentVisualElement(__pPortraitVisualElement);
393                 SetClipChildrenEnabled(true);
394         }
395         else
396         {
397                 ChangeCurrentVisualElement(__pLandscapeVisualElement);
398                 SetClipChildrenEnabled(false);
399         }
400         __orientation = orientation;
401         if (!__autohide)
402         {
403                 SetIndicatorOpacity(__opacity);
404         }
405
406         _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
407         int rotation = 0;
408         Ecore_Evas *pPortraitEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject);
409         SysTryReturnVoidResult(NID_UI_CTRL, pPortraitEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
410         Ecore_Evas *pLandscapeEe = ecore_evas_object_ecore_evas_get(__pLandscapeIndicatorEvasObject);
411         SysTryReturnVoidResult(NID_UI_CTRL, pLandscapeEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
412
413         if (pEcoreEvas && __pWindow)
414         {
415                 rotation = pEcoreEvas->GetWindowRotation(*__pWindow);
416         }
417
418         if(rotation == 0 || rotation == 180)
419         {
420                 ecore_evas_msg_parent_send(pPortraitEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
421         }
422         else
423         {
424                 ecore_evas_msg_parent_send(pLandscapeEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
425         }
426 }
427
428 result
429 _Indicator::OnAttachedToMainTree(void)
430 {
431         result r = E_SUCCESS;
432
433         if (__pCurrentVisualElement)
434         {
435                 r = ChangeCurrentVisualElement(__pCurrentVisualElement);
436         }
437
438         return r;
439 }
440
441 void
442 _Indicator::OnTimerExpired(Timer& timer)
443 {
444         Eina_Bool result = EINA_TRUE;
445
446         _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
447         if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
448         {
449                 result = ecore_evas_extn_plug_connect(__pPortraitIndicatorEvasObject, pPortraitSvcName, 0, EINA_FALSE);
450         }
451         else
452         {
453                 result = ecore_evas_extn_plug_connect(__pLandscapeIndicatorEvasObject, pLandScapeSvcName, 0, EINA_FALSE);
454         }
455
456         if (result == EINA_TRUE)
457         {
458                 timer.Cancel();
459         }
460         else
461         {
462                 timer.Start(CONNECTION_INTERVAL);
463         }
464 }
465
466 void
467 _Indicator::OnDisconnected(Ecore_Evas *pEe)
468 {
469         _Indicator* pIndicator = (_Indicator*)ecore_evas_data_get(pEe, pIndicatorKey);
470         SysTryReturnVoidResult(NID_UI_CTRL, pIndicator, E_SYSTEM, "[E_SYSTEM] Unable to get Indicator Object");
471
472         if (pIndicator->__pConnectionTimer == null)
473         {
474                 pIndicator->__pConnectionTimer = new (std::nothrow) Timer;
475                 if (pIndicator->__pConnectionTimer == null)
476                 {
477                         return;
478                 }
479
480                 result r = pIndicator->__pConnectionTimer->Construct(*pIndicator);
481                 if (r != E_SUCCESS)
482                 {
483                         delete pIndicator->__pConnectionTimer;
484                         pIndicator->__pConnectionTimer = null;
485
486                         return;
487                 }
488         }
489
490         pIndicator->__pConnectionTimer->Start(CONNECTION_INTERVAL);
491 }
492
493 result
494 _Indicator::SetNotificationTrayOpenEnabled(bool enable)
495 {
496         Ecore_X_Window win = (Ecore_X_Window)__pWindow->GetNativeHandle();
497
498         Ecore_X_Atom atomPanelScrollable = ecore_x_atom_get("_E_MOVE_PANEL_SCROLLABLE_STATE");
499
500         unsigned int val[3];
501         ecore_x_window_prop_card32_get(win, atomPanelScrollable, val, 3);
502
503         if (enable)
504     {
505                 val[1] = 1;
506     }
507         else
508     {
509                 val[1] = 0;
510     }
511
512         ecore_x_window_prop_card32_set(win, atomPanelScrollable, val, 3);
513
514
515         return E_SUCCESS;
516 }
517
518 bool
519 _Indicator::IsNotificationTrayOpenEnabled(void) const
520 {
521         Ecore_X_Window win = (Ecore_X_Window)__pWindow->GetNativeHandle();
522
523         Ecore_X_Atom atomPanelScrollable = ecore_x_atom_get("_E_MOVE_PANEL_SCROLLABLE_STATE");
524
525         unsigned int val[3];
526         ecore_x_window_prop_card32_get(win, atomPanelScrollable, val, 3);
527
528         if (val[1] == 1)
529     {
530                 return true;
531     }
532         else
533         {
534                 return false;
535     }
536 }
537
538 void
539 _Indicator::OnMessageHandle(Ecore_Evas *pEe, int msgDomain, int msgId, void *data, int size)
540 {
541         if (!data)
542         {
543                 return;
544         }
545
546         if (msgDomain == MSG_DOMAIN_CONTROL_INDICATOR)
547         {
548                 /*if (msg_id == MSG_ID_INDICATOR_REPEAT_EVENT)
549                 {
550                         int *repeat = static_cast<int*>(data);
551                 }*/
552                 if (msgId == MSG_ID_INDICATOR_TYPE)
553                 {
554                         _IndicatorTypeMode *pIndicatorTypeMode = (_IndicatorTypeMode*)(data);
555
556                         _Window* pWindow =      _ControlManager::GetInstance()->_ControlManager::GetTopVisibleWindow();
557                         SysTryReturnVoidResult(NID_UI_CTRL, pWindow, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree.");
558
559                         Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle();
560
561                         if (*pIndicatorTypeMode == _INDICATOR_TYPE_1)
562                         {
563                           ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
564                         }
565                         else if (*pIndicatorTypeMode == _INDICATOR_TYPE_2)
566                         {
567                           ecore_x_e_illume_indicator_type_set   (win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
568                         }
569                 }
570         }
571 }
572
573 }}} // Tizen::Ui::Controls