sl@0: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\mmu\d_export.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include "d_import.h" sl@0: sl@0: // sl@0: // Class definitions sl@0: // sl@0: sl@0: class DImportFactory : public DLogicalDevice sl@0: { sl@0: public: sl@0: ~DImportFactory(); sl@0: virtual TInt Install(); sl@0: virtual void GetCaps(TDes8& aDes) const; sl@0: virtual TInt Create(DLogicalChannelBase*& aChannel); sl@0: }; sl@0: sl@0: class DImportChannel : public DLogicalChannelBase sl@0: { sl@0: public: sl@0: DImportChannel(); sl@0: ~DImportChannel(); sl@0: virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer); sl@0: virtual TInt Request(TInt aFunction, TAny* a1, TAny* a2); sl@0: public: sl@0: DImportFactory* iFactory; sl@0: }; sl@0: sl@0: // sl@0: // DImportFactory sl@0: // sl@0: sl@0: TInt DImportFactory::Install() sl@0: { sl@0: return SetName(&KImportTestLddName); sl@0: } sl@0: sl@0: DImportFactory::~DImportFactory() sl@0: { sl@0: } sl@0: sl@0: void DImportFactory::GetCaps(TDes8& /*aDes*/) const sl@0: { sl@0: // Not used but required as DLogicalDevice::GetCaps is pure virtual sl@0: } sl@0: sl@0: TInt DImportFactory::Create(DLogicalChannelBase*& aChannel) sl@0: { sl@0: aChannel = NULL; sl@0: DImportChannel* channel=new DImportChannel; sl@0: if(!channel) sl@0: return KErrNoMemory; sl@0: channel->iFactory = this; sl@0: aChannel = channel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: DECLARE_STANDARD_LDD() sl@0: { sl@0: return new DImportFactory; sl@0: } sl@0: sl@0: // sl@0: // DImportChannel sl@0: // sl@0: sl@0: TInt DImportChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/) sl@0: { sl@0: return KErrNone; sl@0: } sl@0: sl@0: DImportChannel::DImportChannel() sl@0: { sl@0: } sl@0: sl@0: DImportChannel::~DImportChannel() sl@0: { sl@0: } sl@0: sl@0: sl@0: TInt DImportChannel::Request(TInt aFunction, TAny* a1, TAny* a2) sl@0: { sl@0: TInt r=KErrNotSupported; sl@0: sl@0: switch(aFunction) sl@0: { sl@0: case RImportLdd::ERunImport: sl@0: r = ExportMultiplyFunction((TUint)a1, (TUint)a2); sl@0: break; sl@0: } sl@0: return r; sl@0: }