diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxwindowvisibilitymonitor.cpp --- a/tvout/src/glxwindowvisibilitymonitor.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class that monitors tv window visibility -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -// CLASS HEADER -#include "glxwindowvisibilitymonitor.h" - -// EXTERNAL INCLUDES -#include // for TWsEvent -#include // for KAknFullOrPartialForegroundLost -#include // for EventMonitor -#include - -// INTERNAL INCLUDES -#include -#include -#include "glxtv.h" // for MGlxWindowVisibilityObserver - - - -//----------------------------------------------------------------------------- -// Return new object -//----------------------------------------------------------------------------- -// -CGlxWindowVisibilityMonitor* CGlxWindowVisibilityMonitor::NewL( - MGlxWindowVisibilityObserver& aVisibilityObserver ) - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor::NewL"); - CGlxWindowVisibilityMonitor* self = new ( ELeave ) - CGlxWindowVisibilityMonitor( aVisibilityObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -//----------------------------------------------------------------------------- -// Destructor -//----------------------------------------------------------------------------- -// -CGlxWindowVisibilityMonitor::~CGlxWindowVisibilityMonitor() - { - GLX_LOG_INFO("~CGlxWindowVisibilityMonitor"); - } - - -//----------------------------------------------------------------------------- -// Close -// To overcome code-scanner high rated warning -//----------------------------------------------------------------------------- -// -void CGlxWindowVisibilityMonitor::Close() - { - iAknEventMonitor->Enable( EFalse ); - iAknEventMonitor->RemoveObserver( this ); - } - -//----------------------------------------------------------------------------- -// Default C++ constructor -//----------------------------------------------------------------------------- -// -CGlxWindowVisibilityMonitor::CGlxWindowVisibilityMonitor - ( MGlxWindowVisibilityObserver& aVisibilityObserver ) - :iVisibilityObserver ( aVisibilityObserver ) - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor"); - } - - -//----------------------------------------------------------------------------- -// Symbian second phase constructor -//----------------------------------------------------------------------------- -// -void CGlxWindowVisibilityMonitor::ConstructL() - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor::ConstructL"); - // Register for visibility events - iAknEventMonitor = - static_cast(CCoeEnv::Static()->AppUi())->EventMonitor(); - iAknEventMonitor->Enable( ETrue ); - iAknEventMonitor->AddObserverL( this ); - } - - -//----------------------------------------------------------------------------- -// From class MAknWsEventObserver -// Propagates window server visibility events to the observer -//----------------------------------------------------------------------------- -// -void CGlxWindowVisibilityMonitor::HandleWsEventL( const TWsEvent& aEvent, - CCoeControl* /*aDestination*/ ) - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor::HandleWsEventL"); - TInt eventType = aEvent.Type(); - - if ( eventType == EEventWindowVisibilityChanged ) - { - // check the state - TUint visible = aEvent.VisibilityChanged()->iFlags; - // notify the observer - if ( visible & TWsVisibilityChangedEvent::EFullyVisible ) - { - GLX_LOG_INFO("Visibility Event - EFullyVisible"); - iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayIsVisible ); - } - else if ( visible & TWsVisibilityChangedEvent::ENotVisible ) - { - GLX_LOG_INFO("Visibility Event - ENotVisible"); - iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayNotVisible ); - } - else if (visible & TWsVisibilityChangedEvent::EPartiallyVisible) - { - GLX_LOG_INFO("Visibility Event - EPartiallyVisible"); - iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayNotVisible ); - } - } - } - - - - -