diff -r 000000000000 -r bde4ae8d615e os/ossrv/lowlevellibsandfws/pluginfw/Framework/frame/RomOnlyResolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/frame/RomOnlyResolver.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,74 @@ +// Copyright (c) 1997-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: +// Implements the CRomOnlyResolver class. +// +// + +/** + @internalComponent + @file +*/ + +#include +#include +#include +#include + +#include "TestUtilities.h" // For __FILE__LINE__ +#include "RomOnlyResolver.h" + +CRomOnlyResolver* CRomOnlyResolver::NewL(MPublicRegistry& aRegistry) + { + return new(ELeave) CRomOnlyResolver(aRegistry); + } + +CRomOnlyResolver::~CRomOnlyResolver() + { + } + +CRomOnlyResolver::CRomOnlyResolver(MPublicRegistry& aRegistry) +: CDefaultResolver(aRegistry) + { + // Do nothing here + } + +TUid CRomOnlyResolver::IdentifyImplementationL(TUid aInterfaceUid, + const TEComResolverParams& aAdditionalParameters) const + { + RImplInfoArray* implementationsInfo = ListAllL(aInterfaceUid, aAdditionalParameters); + TUid found = KNullUid; + if(implementationsInfo->Count()) + { + found = Resolve(*implementationsInfo, aAdditionalParameters); + } + implementationsInfo->Reset(); + delete implementationsInfo; + return found; + } + +RImplInfoArray* CRomOnlyResolver::ListAllL(TUid aInterfaceUid, + const TEComResolverParams& aAdditionalParameters) const + { + // Use the base class version to get the list of matches + RImplInfoArray* retList = CDefaultResolver::ListAllL(aInterfaceUid, aAdditionalParameters); + + // Now remove any from the list that aren't in ROM (or are upgrades of ROM) + const TInt count = retList->Count(); + for(TInt index = count-1; index >=0; --index) + if(!(*retList)[index]->RomBased()) + retList->Remove(index); + + return retList; + } +