user: kashif.sayed
added contentcontrolsrv/.cproject
added contentcontrolsrv/.project
added contentcontrolsrv/group/ABLD.BAT
added contentpublishingsrv/.cproject
added contentpublishingsrv/.project
added contentpublishingsrv/contentharvester/.cproject
added contentpublishingsrv/contentharvester/.project
added contentpublishingsrv/contentharvester/contentharvesterclient/group/ABLD.BAT
added contentpublishingsrv/contentharvester/contentharvesterserver/group/ABLD.BAT
added contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/ABLD.BAT
added contentpublishingsrv/contentharvester/factorysettingsplugin/group/ABLD.BAT
added contentpublishingsrv/contentharvester/group/ABLD.BAT
added contentpublishingsrv/group/ABLD.BAT
added dependencies/S3libs/cpswrapper.lib
added dependencies/S3libs/hscontentcontrol.lib
added dependencies/S3libs/hspswrapper.lib
added group/ABLD.BAT
added homescreenpluginsrv/group/ABLD.BAT
added homescreensrv_plat/group/ABLD.BAT
added idlefw/group/ABLD.BAT
added inc/ccontentmap.h
added inc/cpdebug.h
added inc/cpglobals.h
added inc/cpliwmap.h
added inc/cpluginvalidator.h
added inc/cpserverdef.h
added inc/cpublisherregistrymap.h
added inc/mcssathandler.h
added menucontentsrv/group/ABLD.BAT
added xcfw/group/ABLD.BAT
changed dependencies/S3libs/bld.inf
/*
* Copyright (c) 2006 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: Window server plug-in manager.
*
*/
#include "aiwspluginmanagerimpl.h"
#include <coemain.h>
#include <apgtask.h>
#include <aiutility.h>
#include <telinformationpskeys.h>
#include <aipspropertyobserver.h>
CAiWsPluginManagerImpl::CAiWsPluginManagerImpl(RWsSession& aWsSession) :
iAnimDll( aWsSession ),
iWnd( aWsSession ),
iAnim( iAnimDll )
{
}
void CAiWsPluginManagerImpl::ConstructL(CCoeEnv& aCoeEnv)
{
User::LeaveIfError( iAnimDll.Load( KAiWsPluginAnimDllName ) );
iCoeEnv = &aCoeEnv;
iPhoneStatusObserver = AiUtility::CreatePSPropertyObserverL
( TCallBack( HandlePhoneEvent, this ),
KPSUidTelInformation, KTelPhoneUid );
TryLoadWsPluginL();
}
CAiWsPluginManagerImpl* CAiWsPluginManagerImpl::NewL( CCoeEnv& aCoeEnv )
{
CAiWsPluginManagerImpl* self =
new(ELeave) CAiWsPluginManagerImpl( aCoeEnv.WsSession() );
CleanupStack::PushL( self );
self->ConstructL( aCoeEnv );
CleanupStack::Pop( self );
return self;
}
CAiWsPluginManagerImpl::~CAiWsPluginManagerImpl()
{
iAnim.Close();
iWnd.Close();
Release( iPhoneStatusObserver );
iAnimDll.Close();
}
EXPORT_C CAiWsPluginManager* CAiWsPluginManager::NewL
(CCoeEnv& aCoeEnv)
{
return CAiWsPluginManagerImpl::NewL(aCoeEnv);
}
TInt CAiWsPluginManagerImpl::HandlePhoneEvent( TAny* aPtr )
{
CAiWsPluginManagerImpl* self =
static_cast<CAiWsPluginManagerImpl*>( aPtr );
TInt err = KErrNone;
if( self )
{
TRAP( err, self->TryLoadWsPluginL() );
}
return err;
}
void CAiWsPluginManagerImpl::TryLoadWsPluginL()
{
TInt phoneUidVal;
iPhoneStatusObserver->Get( phoneUidVal );
const TUid phoneUid = TUid::Uid( phoneUidVal );
if ( phoneUid != KNullUid )
{
RWsSession& wsSession = iCoeEnv->WsSession();
TApaTaskList taskList( wsSession );
TApaTask phoneTask( taskList.FindApp( phoneUid ) );
if ( phoneTask.Exists() )
{
iAnim.Close();
iWnd.Close();
RWindowGroup& aiRootWg = iCoeEnv->RootWin();
// RWindow::Construct requires a unique non-null handle. Active Idle
// does not care about the handle value and just uses this pointer to have
// something non-null.
const TUint32 dummyHandle = reinterpret_cast<TUint32>(this);
User::LeaveIfError( iWnd.Construct(aiRootWg, dummyHandle ) );
const TInt aiWgId = aiRootWg.Identifier();
const TInt phoneWgId = phoneTask.WgId();
User::LeaveIfError( iAnim.Construct( iWnd, aiWgId, phoneWgId ) );
// No need to monitor Phone app status anymore
Release( iPhoneStatusObserver );
iPhoneStatusObserver = NULL;
}
}
}