renamed dlls+exe to prevent conflicts with existing files in emulator; changelog attached.
* renamed dlls/exe:
- aifw.dll to aifw_hs.dll
- cputils to cputils_hs
- aiidleint.dll to aiidleint_hs.dll
- aiutils.dll to aiutils_hs.dll
- MenuInterface.dll to MenuInterface_hs.dll
- XCFW.dll to XCFW_hs.dll
- homescreen.exe to homescreen_hs.exe
- ailaunch.exe to ailaunch_hs.exe
* new UID for Active Idle (aifw_hs.dll, aiidleint_hs.dll and homescreen.exe):
#define AI_UID3_AIFW_COMMON 0xEDFF45C4 (was 0x102750F0 = 271012080)
* new UID for cputils_hs.dll: 0xE3E7134E (was 0x20016B7F = 536963967)
* new UID for AI Utilities Factory (aiutils_hs.dll): 0xEC55106C (was 0x10281865 = 271063141)
* new UID for MenuInterface_hs.dll: 0xEEE24485 (was 0x10210EAB = 270601899)
* new UID for XCFW_hs.dll: 0xEB12332F (was 0x10210EA0 = 270601888)
* new UID for ailaunch_hs.exe: 0xEF5A047A (was 0x200286E3 = 537036515)
/*
* Copyright (c) 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:
* widget manager plugin implementation
*
*/
// INCLUDE FILES
#include <bautils.h>
#include <coemain.h>
#include <aknViewAppUi.h>
#include <eikappui.h>
#include <eikapp.h>
#include <e32property.h>
#include <e32base.h>
#include <activeidle2domainpskeys.h>
#include <widgetmanagerview.rsg>
#include "wmcommon.h"
#include "widgetmanager.hrh"
#include "wmmaincontainer.h"
#include "wmmaincontainerview.h"
#include "wmresourceloader.h"
#include "wmplugin.h"
#include "wmeffectmanager.h"
#include "wmwidgetdata.h"
#include "wminstaller.h"
// ---------------------------------------------------------
// CWmPlugin::NewL
// ---------------------------------------------------------
//
CWmPlugin* CWmPlugin::NewL()
{
CWmPlugin* self = new( ELeave ) CWmPlugin();
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
// ---------------------------------------------------------
// CWmPlugin::~CWmPlugin
// ---------------------------------------------------------
//
CWmPlugin::~CWmPlugin()
{
iPostponedCommand = ENone;
// delete WM UI resources
if ( iViewAppUi )
{
if ( iWmMainContainer && IsActive() )
{
// WM is showing. Hide first!
iWmMainContainer->SetClosingDown( ETrue );
TRAPD( err, iViewAppUi->ActivateLocalViewL(
iPreviousViewUid.iViewUid ); );
if ( KErrNone == err )
{
// wait until previous view is switched on top
// then continue destruction.
iWait->Start();
}
else
{
// try to activate default view
TVwsViewId viewId;
if ( iViewAppUi->GetDefaultViewId( viewId ) != KErrNone )
{
viewId.iAppUid = iViewAppUi->Application()->AppDllUid();
viewId.iViewUid = TUid::Uid( 1 );
}
TRAPD( err, iViewAppUi->ActivateLocalViewL( viewId.iViewUid ); );
if ( KErrNone == err )
{
// wait until previous view is switched on top
// then continue destruction.
iWait->Start();
}
}
}
// remove view from appui (also deletes it)
iViewAppUi->RemoveView(
TUid::Uid( EWmMainContainerViewId ) );
}
// delete other members
delete iResourceLoader;
delete iEffectManager;
delete iPostponedContent;
delete iWait;
delete iWmInstaller;
}
// ---------------------------------------------------------
// CWmPlugin::CWmPlugin
// ---------------------------------------------------------
//
CWmPlugin::CWmPlugin()
{
iPreviousViewUid.iViewUid = KNullUid;
}
// ---------------------------------------------------------
// CWmPlugin::ConstructL
// ---------------------------------------------------------
//
void CWmPlugin::ConstructL()
{
iWmMainContainer = NULL;
// store static view app ui
CEikonEnv* eikonEnv = CEikonEnv::Static();
if ( !eikonEnv ) User::Leave( KErrUnknown );
iViewAppUi = (CAknViewAppUi*)eikonEnv->EikAppUi();
if ( !iViewAppUi ) User::Leave( KErrUnknown );
// create resource loader
iFs = &eikonEnv->FsSession();
iResourceLoader = CWmResourceLoader::NewL( *eikonEnv );
iEffectManager = CWmEffectManager::NewL( *eikonEnv );
// wait object
iWait = new (ELeave) CActiveSchedulerWait();
// main view
CWmMainContainerView* mainView =
CWmMainContainerView::NewL( *this );
CleanupStack::PushL( mainView );
iViewAppUi->AddViewL( mainView );
CleanupStack::Pop( mainView );
iWmInstaller = CWmInstaller::NewL();
}
// ---------------------------------------------------------
// CWmPlugin::Activate
// ---------------------------------------------------------
//
void CWmPlugin::Activate()
{
if ( !IsActive() && iHsContentController )
{
TRAP_IGNORE(
iEffectManager->BeginFullscreenEffectL(
KAppStartCommonDefaultStyle );
iViewAppUi->ActivateLocalViewL(
TUid::Uid( EWmMainContainerViewId ) );
);
}
}
// ---------------------------------------------------------
// CWmPlugin::IsActive
// ---------------------------------------------------------
//
TBool CWmPlugin::IsActive()
{
return ( iPreviousViewUid.iViewUid != KNullUid );
}
// ---------------------------------------------------------
// CWmPlugin::Deactivate
// ---------------------------------------------------------
//
void CWmPlugin::Deactivate()
{
if ( IsActive() )
{
iWmMainContainer->SetClosingDown( ETrue );
TRAP_IGNORE(
iEffectManager->BeginFullscreenEffectL(
KAppExitCommonDefaultStyle );
iViewAppUi->ActivateLocalViewL(
iPreviousViewUid.iViewUid );
);
}
}
// ---------------------------------------------------------
// CWmPlugin::MainViewActivated
// ---------------------------------------------------------
//
void CWmPlugin::MainViewActivated(
const TVwsViewId& aViewId,
CWmMainContainer* aWmMainContainer )
{
iPreviousViewUid = aViewId;
iWmMainContainer = aWmMainContainer;
iEffectManager->UiRendered();
iWmMainContainer->SetClosingDown( EFalse );
// Don't forward numeric keys to phone
ForwardNumericKeysToPhone( EFalse );
}
// ---------------------------------------------------------
// CWmPlugin::MainViewDeactivated
// ---------------------------------------------------------
//
void CWmPlugin::MainViewDeactivated()
{
// Forward numeric keys to phone
ForwardNumericKeysToPhone( ETrue );
iPreviousViewUid.iViewUid = KNullUid;
iWmMainContainer = NULL;
if ( iEffectManager && !iWait->IsStarted() )
{
iEffectManager->UiRendered();
}
TRAP_IGNORE( ExecuteCommandL(); );
if ( iWait->IsStarted() ) { iWait->AsyncStop(); }
}
// ---------------------------------------------------------
// CWmPlugin::ForwardNumericKeysToPhone
// ---------------------------------------------------------
//
void CWmPlugin::ForwardNumericKeysToPhone( TBool aEnabled )
{
TInt value = aEnabled ?
EPSAiForwardNumericKeysToPhone :
EPSAiDontForwardNumericKeysToPhone;
RProperty::Set(
KPSUidAiInformation,
KActiveIdleForwardNumericKeysToPhone,
value );
}
// ---------------------------------------------------------
// CWmPlugin::SetPostponedCommandL
// ---------------------------------------------------------
//
void CWmPlugin::SetPostponedCommandL(
TCommand aCommand, CHsContentInfo& aContentInfo )
{
iPostponedCommand = aCommand;
delete iPostponedContent;
iPostponedContent = NULL;
iPostponedContent = aContentInfo.CloneL();
}
// ---------------------------------------------------------
// CWmPlugin::ExecuteCommandL
// ---------------------------------------------------------
//
void CWmPlugin::ExecuteCommandL()
{
if ( iPostponedCommand == EAddToHomescreen )
{
TInt err = ContentController().AddWidgetL( *iPostponedContent );
if ( err == KHsErrorViewFull ||
err == KHsErrorDoesNotFit )
{
ResourceLoader().InfoPopupL(
R_QTN_HS_ADD_WIDGET_NO_SPACE_NOTE, KNullDesC );
}
else if ( err == KHsErrorMaxInstanceCountExceeded )
{
ResourceLoader().InfoPopupL(
R_QTN_HS_ADD_WIDGET_MAX_COUNT_NOTE, KNullDesC );
}
else if ( err == KErrNoMemory )
{
ResourceLoader().InfoPopupL(
R_QTN_HS_HS_MEMORY_FULL, KNullDesC );
}
else if ( ( err != KErrNone ) && ( err != KErrDiskFull ) )
{
ResourceLoader().ErrorPopup( err );
}
}
iPostponedCommand = ENone;
delete iPostponedContent;
iPostponedContent = NULL;
}
// ---------------------------------------------------------
// CWmPlugin::MainViewDeactivated
// ---------------------------------------------------------
//
CAknViewAppUi& CWmPlugin::ViewAppUi()
{
return *iViewAppUi;
}
// ---------------------------------------------------------
// CWmPlugin::MainViewDeactivated
// ---------------------------------------------------------
//
CWmResourceLoader& CWmPlugin::ResourceLoader()
{
return *iResourceLoader;
}
// ---------------------------------------------------------
// CWmPlugin::MainViewDeactivated
// ---------------------------------------------------------
//
MHsContentController& CWmPlugin::ContentController()
{
return *iHsContentController;
}
// ---------------------------------------------------------
// CWmPlugin::MainViewDeactivated
// ---------------------------------------------------------
//
RFs& CWmPlugin::FileServer()
{
return *iFs;
}
// ---------------------------------------------------------
// CWmPlugin::NotifyWidgetListChanged
// ---------------------------------------------------------
//
void CWmPlugin::NotifyWidgetListChanged()
{
if ( iWmMainContainer && !iWmMainContainer->ClosingDown() )
{
iWmMainContainer->HandleWidgetListChanged();
}
}
// ---------------------------------------------------------
// CWmPlugin::WmInstaller
// ---------------------------------------------------------
//
CWmInstaller& CWmPlugin::WmInstaller()
{
return *iWmInstaller;
}
// End of file