diff -r 000000000000 -r 2f259fa3e83a commonuisupport/uikon/test/tlibs/tloaddll/TLOADDLL.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commonuisupport/uikon/test/tlibs/tloaddll/TLOADDLL.CPP Tue Feb 02 01:00:49 2010 +0200 @@ -0,0 +1,155 @@ +// Copyright (c) 2005-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: +// + +/** + @file + @internalComponent - Internal Symbian test code +*/ + +#include +#include +#include "contentmgr.h" +#include "TLOADDLL.H" + +// Static DLL functions +GLDEF_C TInt E32Dll( + ) + { + return(KErrNone); + } + +// +// +// CTestEikonDllLoading +// +// +CTestEikonDllLoading::CTestEikonDllLoading() + { + } + +// +// +// ~CTestEikonDllLoading +// +// +CTestEikonDllLoading::~CTestEikonDllLoading() + { + delete iContentManager; + } + +// +// +// NewL +// +// +EXPORT_C const CTestEikonDllLoading* CTestEikonDllLoading::NewL() + { + CTestEikonDllLoading* testDll=new(ELeave) CTestEikonDllLoading(); + + return testDll; + } + +// +// +// InitialiseL +// +// +void CTestEikonDllLoading::InitializeL() + { + CEikonEnv* env=CEikonEnv::Static(); + iContentManager=CEikTestContentManager::NewL(env->FsSession()); + env->AddPictureFactoryL(*iContentManager); + } + +// +// +// ResourceFileArray +// +// +CArrayFix* CTestEikonDllLoading::ResourceFileArrayL() const + { + CArrayFix* resFileArray = new(ELeave) CArrayFixFlat(1); + CleanupStack::PushL(resFileArray); + + resFileArray->AppendL(ResourceFile()); + + CleanupStack::Pop(); // resFileArray + return resFileArray; + } + +// +// +// ControlFactoryArray +// +// +CArrayFix* CTestEikonDllLoading::ControlFactoryArrayL() const + { + CArrayFix* ctrlFactoryArray = new(ELeave) CArrayFixFlat(1); + CleanupStack::PushL(ctrlFactoryArray); + + ctrlFactoryArray->AppendL(STATIC_CAST(TCreateByTypeFunction, CreateByTypeL)); + + CleanupStack::Pop(); // ctrlFactoryArray + return ctrlFactoryArray; + } + +// +// +// ResourceFile +// +// +TFileName CTestEikonDllLoading::ResourceFile() const + { + _LIT(KResFileName,"z:\\system\\test\\taddlib\\external.rsc"); + TFileName resourceFile=KResFileName(); + return resourceFile; + } + +// +// +// CreateByTypeL +// +// +SEikControlInfo CTestEikonDllLoading::CreateByTypeL(TInt aControlType) + { + SEikControlInfo controlInfo; + controlInfo.iControl = NULL; + controlInfo.iTrailerTextId = 0; + controlInfo.iFlags = 0; + + switch (aControlType) + { + case CTestEikDllLoadedLabel::ECtTestEikDllLoadedLabel: + controlInfo.iControl = new(ELeave) CTestEikDllLoadedLabel; + break; + } + return controlInfo; + } + +// +// +// CTestEikDllLoadedLabel::Draw +// +// +void CTestEikDllLoadedLabel::Draw(const TRect& aRect) const + { + CWindowGc& gc=SystemGc(); + gc.SetPenColor(KRgbBlack); + CEikLabel::Draw(aRect); + } + +// +// END OF FILE +//