[Tizen] Disable indicator
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 // CLASS HEADER
19 #include <dali/internal/window-system/common/window-impl.h>
20
21 // EXTERNAL HEADERS
22 #include <dali/integration-api/core.h>
23 #include <dali/integration-api/system-overlay.h>
24 #include <dali/public-api/render-tasks/render-task.h>
25 #include <dali/public-api/render-tasks/render-task-list.h>
26 #include <dali/devel-api/adaptor-framework/orientation.h>
27
28 // INTERNAL HEADERS
29 #include <dali/internal/input/common/drag-and-drop-detector-impl.h>
30 #include <dali/internal/window-system/common/window-visibility-observer.h>
31 #include <dali/internal/window-system/common/orientation-impl.h>
32 #include <dali/internal/window-system/common/render-surface-factory.h>
33 #include <dali/internal/window-system/common/window-factory.h>
34 #include <dali/internal/window-system/common/window-base.h>
35 #include <dali/internal/window-system/common/window-render-surface.h>
36
37 namespace Dali
38 {
39 namespace Internal
40 {
41 namespace Adaptor
42 {
43
44 namespace
45 {
46
47 #if defined(DEBUG_ENABLED)
48 Debug::Filter* gWindowLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW" );
49 #endif
50
51 } // unnamed namespace
52
53 Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
54 {
55   Window* window = new Window();
56   window->mIsTransparent = isTransparent;
57   window->Initialize( positionSize, name, className );
58   return window;
59 }
60
61 Window::Window()
62 : mSurface( NULL ),
63   mWindowBase(),
64   mIndicatorVisible( Dali::Window::INVISIBLE ),
65   mIndicatorIsShown( false ),
66   mShowRotatedIndicatorOnClose( false ),
67   mStarted( false ),
68   mIsTransparent( false ),
69   mIsFocusAcceptable( true ),
70   mVisible( true ),
71   mIconified( false ),
72   mOpaqueState( false ),
73   mResizeEnabled( false ),
74   mIndicator(),
75   mIndicatorOrientation( Dali::Window::PORTRAIT ),
76   mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
77   mIndicatorOpacityMode( Dali::Window::OPAQUE ),
78   mOverlay( NULL ),
79   mAdaptor( NULL ),
80   mType( Dali::Window::NORMAL ),
81   mPreferredOrientation( Dali::Window::PORTRAIT ),
82   mIndicatorVisibilityChangedSignal(),
83   mFocusChangedSignal(),
84   mResizedSignal(),
85   mDeleteRequestSignal()
86 {
87 }
88
89 Window::~Window()
90 {
91   if( mIndicator )
92   {
93     mOverlay->Remove( mIndicator->GetActor() );
94     Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
95     Dali::RenderTask indicatorTask = taskList.GetTask(0);
96     mOverlay->GetOverlayRenderTasks().RemoveTask(indicatorTask);
97     mIndicator->Close();
98   }
99
100   if ( mAdaptor )
101   {
102     mAdaptor->RemoveObserver( *this );
103     mAdaptor->SetDragAndDropDetector( NULL );
104     mAdaptor = NULL;
105   }
106
107   delete mSurface;
108 }
109
110 void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
111 {
112   // create a window render surface
113   Any surface;
114   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
115   auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, name, className, mIsTransparent );
116   mSurface = windowRenderSurface.release();
117
118   // create a window base
119   auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
120   mWindowBase = windowFactory->CreateWindowBase( this, mSurface );
121
122   mWindowBase->Initialize();
123
124   if( !positionSize.IsEmpty() )
125   {
126     AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
127     mResizeEnabled = true;
128   }
129
130   SetClass( name, className );
131
132   mSurface->Map();
133
134   mOrientation = Orientation::New( this );
135 }
136
137 void Window::SetAdaptor(Dali::Adaptor& adaptor)
138 {
139   DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
140   mStarted = true;
141
142   // Only create one overlay per window
143   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
144   Integration::Core& core = adaptorImpl.GetCore();
145   mOverlay = &core.GetSystemOverlay();
146
147   Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
148   taskList.CreateTask();
149
150   mAdaptor = &adaptorImpl;
151   mAdaptor->AddObserver( *this );
152
153   // Can only create the detector when we know the Core has been instantiated.
154   mDragAndDropDetector = DragAndDropDetector::New();
155   mAdaptor->SetDragAndDropDetector( &GetImplementation( mDragAndDropDetector ) );
156
157   if( mOrientation )
158   {
159     mOrientation->SetAdaptor(adaptor);
160   }
161
162   if( mIndicator != NULL )
163   {
164     mIndicator->SetAdaptor(mAdaptor);
165   }
166 }
167
168 WindowRenderSurface* Window::GetSurface()
169 {
170   return mSurface;
171 }
172
173 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
174 {
175   mIndicatorVisible = visibleMode;
176
177   mWindowBase->ShowIndicator( mIndicatorVisible, mIndicatorOpacityMode );
178
179   DoShowIndicator( mIndicatorOrientation );
180 }
181
182 void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode )
183 {
184   mIndicatorOpacityMode = opacityMode;
185
186   if( mIndicator != NULL )
187   {
188     mIndicator->SetOpacityMode( opacityMode );
189   }
190 }
191
192 void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
193 {
194   mIndicatorVisible = mode;
195 }
196
197 void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
198 {
199   DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "Orientation: %d\n", orientation );
200
201   DoRotateIndicator( orientation );
202 }
203
204 void Window::SetClass( std::string name, std::string className )
205 {
206   mWindowBase->SetClass( name, className );
207 }
208
209 void Window::Raise()
210 {
211   mWindowBase->Raise();
212 }
213
214 void Window::Lower()
215 {
216   mWindowBase->Lower();
217 }
218
219 void Window::Activate()
220 {
221   mWindowBase->Activate();
222 }
223
224 void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
225 {
226   bool found = false;
227
228   if( orientation <= Dali::Window::LANDSCAPE_INVERSE )
229   {
230     for( std::size_t i = 0; i < mAvailableOrientations.size(); i++ )
231     {
232       if( mAvailableOrientations[i] == orientation )
233       {
234         found = true;
235         break;
236       }
237     }
238
239     if( !found )
240     {
241       mAvailableOrientations.push_back( orientation );
242       SetAvailableOrientations( mAvailableOrientations );
243     }
244   }
245 }
246
247 void Window::RemoveAvailableOrientation( Dali::Window::WindowOrientation orientation )
248 {
249   for( std::vector<Dali::Window::WindowOrientation>::iterator iter = mAvailableOrientations.begin();
250        iter != mAvailableOrientations.end(); ++iter )
251   {
252     if( *iter == orientation )
253     {
254       mAvailableOrientations.erase( iter );
255       break;
256     }
257   }
258   SetAvailableOrientations( mAvailableOrientations );
259 }
260
261 void Window::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
262 {
263   if( orientations.size() > 4 )
264   {
265     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAvailableOrientations: Invalid vector size! [%d]\n", orientations.size() );
266     return;
267   }
268
269   mAvailableOrientations = orientations;
270
271   mWindowBase->SetAvailableOrientations( mAvailableOrientations );
272 }
273
274 const std::vector< Dali::Window::WindowOrientation >& Window::GetAvailableOrientations()
275 {
276   return mAvailableOrientations;
277 }
278
279 void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
280 {
281   mPreferredOrientation = orientation;
282
283   mWindowBase->SetPreferredOrientation( mPreferredOrientation );
284 }
285
286 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
287 {
288   return mPreferredOrientation;
289 }
290
291 Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
292 {
293   return mDragAndDropDetector;
294 }
295
296 Dali::Any Window::GetNativeHandle() const
297 {
298   return mSurface->GetWindow();
299 }
300
301 void Window::SetAcceptFocus( bool accept )
302 {
303   mIsFocusAcceptable = accept;
304
305   mWindowBase->SetAcceptFocus( accept );
306 }
307
308 bool Window::IsFocusAcceptable() const
309 {
310   return mIsFocusAcceptable;
311 }
312
313 void Window::Show()
314 {
315   mVisible = true;
316
317   mWindowBase->Show();
318
319   if( !mIconified )
320   {
321     WindowVisibilityObserver* observer( mAdaptor );
322     observer->OnWindowShown();
323     DALI_LOG_RELEASE_INFO( "Window (%p) ::Show()\n", this );
324   }
325 }
326
327 void Window::Hide()
328 {
329   mVisible = false;
330
331   mWindowBase->Hide();
332
333   if( !mIconified )
334   {
335     WindowVisibilityObserver* observer( mAdaptor );
336     observer->OnWindowHidden();
337     DALI_LOG_RELEASE_INFO( "Window (%p) ::Hide() \n", this );
338   }
339 }
340
341 bool Window::IsVisible() const
342 {
343   return mVisible;
344 }
345
346 unsigned int Window::GetSupportedAuxiliaryHintCount() const
347 {
348   return mWindowBase->GetSupportedAuxiliaryHintCount();
349 }
350
351 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
352 {
353   return mWindowBase->GetSupportedAuxiliaryHint( index );
354 }
355
356 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
357 {
358   return mWindowBase->AddAuxiliaryHint( hint, value );
359 }
360
361 bool Window::RemoveAuxiliaryHint( unsigned int id )
362 {
363   return mWindowBase->RemoveAuxiliaryHint( id );
364 }
365
366 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
367 {
368   return mWindowBase->SetAuxiliaryHintValue( id, value );
369 }
370
371 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
372 {
373   return mWindowBase->GetAuxiliaryHintValue( id );
374 }
375
376 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
377 {
378   return mWindowBase->GetAuxiliaryHintId( hint );
379 }
380
381 void Window::SetInputRegion( const Rect< int >& inputRegion )
382 {
383   mWindowBase->SetInputRegion( inputRegion );
384
385   DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
386 }
387
388 void Window::SetType( Dali::Window::Type type )
389 {
390   if( type != mType )
391   {
392     mWindowBase->SetType( type );
393
394     mType = type;
395   }
396 }
397
398 Dali::Window::Type Window::GetType() const
399 {
400   return mType;
401 }
402
403 bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
404 {
405   if( mType != Dali::Window::NOTIFICATION )
406   {
407     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
408     return false;
409   }
410
411   return mWindowBase->SetNotificationLevel( level );
412 }
413
414 Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
415 {
416   if( mType != Dali::Window::NOTIFICATION )
417   {
418     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
419     return Dali::Window::NotificationLevel::NONE;
420   }
421
422   return mWindowBase->GetNotificationLevel();
423 }
424
425 void Window::SetOpaqueState( bool opaque )
426 {
427   mOpaqueState = opaque;
428
429   mWindowBase->SetOpaqueState( opaque );
430
431   DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
432 }
433
434 bool Window::IsOpaqueState() const
435 {
436   return mOpaqueState;
437 }
438
439 bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
440 {
441   return mWindowBase->SetScreenOffMode( screenOffMode );
442 }
443
444 Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
445 {
446   return mWindowBase->GetScreenOffMode();
447 }
448
449 bool Window::SetBrightness( int brightness )
450 {
451   if( brightness < 0 || brightness > 100 )
452   {
453     DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness );
454     return false;
455   }
456
457   return mWindowBase->SetBrightness( brightness );
458 }
459
460 int Window::GetBrightness() const
461 {
462   return mWindowBase->GetBrightness();
463 }
464
465 void Window::SetSize( Dali::Window::WindowSize size )
466 {
467   if( !mResizeEnabled )
468   {
469     AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
470     mResizeEnabled = true;
471   }
472
473   PositionSize positionSize = mSurface->GetPositionSize();
474
475   if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
476   {
477     positionSize.width = size.GetWidth();
478     positionSize.height = size.GetHeight();
479
480     mSurface->MoveResize( positionSize );
481
482     mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
483
484     // Emit signal
485     mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
486
487     mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
488   }
489 }
490
491 Dali::Window::WindowSize Window::GetSize() const
492 {
493   PositionSize positionSize = mSurface->GetPositionSize();
494
495   return Dali::Window::WindowSize( positionSize.width, positionSize.height );
496 }
497
498 void Window::SetPosition( Dali::Window::WindowPosition position )
499 {
500   if( !mResizeEnabled )
501   {
502     AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
503     mResizeEnabled = true;
504   }
505
506   PositionSize positionSize = mSurface->GetPositionSize();
507
508   if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
509   {
510     positionSize.x = position.GetX();
511     positionSize.y = position.GetY();
512
513     mSurface->MoveResize( positionSize );
514   }
515 }
516
517 Dali::Window::WindowPosition Window::GetPosition() const
518 {
519   PositionSize positionSize = mSurface->GetPositionSize();
520
521   return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
522 }
523
524 void Window::SetTransparency( bool transparent )
525 {
526   mSurface->SetTransparency( transparent );
527 }
528
529 bool Window::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
530 {
531   return mWindowBase->GrabKey( key, grabMode );
532 }
533
534 bool Window::UngrabKey( Dali::KEY key )
535 {
536   return mWindowBase->UngrabKey( key );
537 }
538
539 bool Window::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
540 {
541   return mWindowBase->GrabKeyList( key, grabMode, result );
542 }
543
544 bool Window::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
545 {
546   return mWindowBase->UngrabKeyList( key, result );
547 }
548
549 void Window::RotationDone( int orientation, int width, int height )
550 {
551   mSurface->RequestRotation( orientation, width, height );
552
553   mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
554
555   // Emit signal
556   mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
557
558   mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
559 }
560
561 void Window::OnIconifyChanged( bool iconified )
562 {
563   if( iconified )
564   {
565     mIconified = true;
566
567     if( mVisible )
568     {
569       WindowVisibilityObserver* observer( mAdaptor );
570       observer->OnWindowHidden();
571       DALI_LOG_RELEASE_INFO( "Window (%p) Iconified\n", this );
572     }
573   }
574   else
575   {
576     mIconified = false;
577
578     if( mVisible )
579     {
580       WindowVisibilityObserver* observer( mAdaptor );
581       observer->OnWindowShown();
582       DALI_LOG_RELEASE_INFO( "Window (%p) Deiconified\n", this );
583     }
584   }
585 }
586
587 void Window::OnFocusChanged( bool focusIn )
588 {
589   mFocusChangedSignal.Emit( focusIn );
590 }
591
592 void Window::OnOutputTransformed()
593 {
594   PositionSize positionSize = mSurface->GetPositionSize();
595   mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
596   mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
597 }
598
599 void Window::OnDeleteRequest()
600 {
601   mDeleteRequestSignal.Emit();
602 }
603
604 void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
605 {
606   if( mIndicator == NULL )
607   {
608     if( mIndicatorVisible != Dali::Window::INVISIBLE )
609     {
610       auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
611       mIndicator = windowFactory->CreateIndicator( mAdaptor, mIndicatorOrientation, this );
612       if( mIndicator )
613       {
614         mIndicator->SetOpacityMode( mIndicatorOpacityMode );
615         Dali::Actor actor = mIndicator->GetActor();
616         SetIndicatorActorRotation();
617         mOverlay->Add(actor);
618       }
619     }
620     // else don't create a hidden indicator
621   }
622   else // Already have indicator
623   {
624     if( mIndicatorVisible == Dali::Window::VISIBLE )
625     {
626       // If we are resuming, and rotation has changed,
627       if( mIndicatorIsShown == false && mIndicatorOrientation != mNextIndicatorOrientation )
628       {
629         // then close current indicator and open new one
630         mShowRotatedIndicatorOnClose = true;
631         mIndicator->Close(); // May synchronously call IndicatorClosed() callback & 1 level of recursion
632         // Don't show actor - will contain indicator for old orientation.
633       }
634     }
635   }
636
637   // set indicator visible mode
638   if( mIndicator != NULL )
639   {
640     mIndicator->SetVisible( mIndicatorVisible );
641   }
642
643   bool show = (mIndicatorVisible != Dali::Window::INVISIBLE );
644   SetIndicatorProperties( show, lastOrientation );
645   mIndicatorIsShown = show;
646 }
647
648 void Window::DoRotateIndicator( Dali::Window::WindowOrientation orientation )
649 {
650   if( mIndicatorIsShown )
651   {
652     mShowRotatedIndicatorOnClose = true;
653     mNextIndicatorOrientation = orientation;
654     if( mIndicator )
655     {
656       mIndicator->Close(); // May synchronously call IndicatorClosed() callback
657     }
658   }
659   else
660   {
661     // Save orientation for when the indicator is next shown
662     mShowRotatedIndicatorOnClose = false;
663     mNextIndicatorOrientation = orientation;
664   }
665 }
666
667 void Window::SetIndicatorActorRotation()
668 {
669   DALI_LOG_TRACE_METHOD( gWindowLogFilter );
670   if( mIndicator )
671   {
672     Dali::Actor actor = mIndicator->GetActor();
673     switch( mIndicatorOrientation )
674     {
675       case Dali::Window::PORTRAIT:
676         actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
677         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
678         actor.SetOrientation( Degree(0), Vector3::ZAXIS );
679         break;
680       case Dali::Window::PORTRAIT_INVERSE:
681         actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
682         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
683         actor.SetOrientation( Degree(180), Vector3::ZAXIS );
684         break;
685       case Dali::Window::LANDSCAPE:
686         actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
687         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
688         actor.SetOrientation( Degree(270), Vector3::ZAXIS );
689         break;
690       case Dali::Window::LANDSCAPE_INVERSE:
691         actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
692         actor.SetAnchorPoint(  AnchorPoint::TOP_CENTER );
693         actor.SetOrientation( Degree(90), Vector3::ZAXIS );
694         break;
695     }
696   }
697 }
698
699 void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
700 {
701   mWindowBase->SetIndicatorProperties( isShow, lastOrientation );
702 }
703
704 void Window::IndicatorTypeChanged( IndicatorInterface::Type type )
705 {
706   mWindowBase->IndicatorTypeChanged( type );
707 }
708
709 void Window::IndicatorClosed( IndicatorInterface* indicator )
710 {
711   DALI_LOG_TRACE_METHOD( gWindowLogFilter );
712
713   if( mShowRotatedIndicatorOnClose )
714   {
715     Dali::Window::WindowOrientation currentOrientation = mIndicatorOrientation;
716     if( mIndicator )
717     {
718       mIndicator->Open( mNextIndicatorOrientation );
719     }
720     mIndicatorOrientation = mNextIndicatorOrientation;
721     SetIndicatorActorRotation();
722     DoShowIndicator( currentOrientation );
723   }
724 }
725
726 void Window::IndicatorVisibilityChanged( bool isVisible )
727 {
728   mIndicatorVisibilityChangedSignal.Emit( isVisible );
729 }
730
731 void Window::OnStart()
732 {
733   DoShowIndicator( mIndicatorOrientation );
734 }
735
736 void Window::OnPause()
737 {
738 }
739
740 void Window::OnResume()
741 {
742   // resume indicator status
743   if( mIndicator != NULL )
744   {
745     // Restore own indicator opacity
746     // Send opacity mode to indicator service when app resumed
747     mIndicator->SetOpacityMode( mIndicatorOpacityMode );
748   }
749 }
750
751 void Window::OnStop()
752 {
753   if( mIndicator )
754   {
755     mIndicator->Close();
756   }
757
758   mIndicator.release();
759 }
760
761 void Window::OnDestroy()
762 {
763   mAdaptor = NULL;
764 }
765
766 } // Adaptor
767
768 } // Internal
769
770 } // Dali