commonuisupport/uikon/test/tlibs/tloaddll/TLOADDLL.CPP
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 #include <eikenv.h>
       
    22 #include <techview/eiklabel.h>
       
    23 #include "contentmgr.h"
       
    24 #include "TLOADDLL.H"
       
    25 
       
    26 // Static DLL functions
       
    27 GLDEF_C TInt E32Dll(
       
    28 					)
       
    29 	{
       
    30 	return(KErrNone);
       
    31 	}
       
    32 
       
    33 //
       
    34 //
       
    35 // CTestEikonDllLoading
       
    36 //
       
    37 //
       
    38 CTestEikonDllLoading::CTestEikonDllLoading()
       
    39 	{
       
    40 	}
       
    41 
       
    42 //
       
    43 //
       
    44 // ~CTestEikonDllLoading
       
    45 //
       
    46 //
       
    47 CTestEikonDllLoading::~CTestEikonDllLoading()
       
    48 	{
       
    49 	delete iContentManager;
       
    50 	}
       
    51 
       
    52 //
       
    53 //
       
    54 // NewL
       
    55 //
       
    56 //
       
    57 EXPORT_C const CTestEikonDllLoading* CTestEikonDllLoading::NewL()
       
    58 	{
       
    59 	CTestEikonDllLoading* testDll=new(ELeave) CTestEikonDllLoading();
       
    60 
       
    61 	return testDll;
       
    62 	}
       
    63 
       
    64 //
       
    65 //
       
    66 // InitialiseL
       
    67 //
       
    68 //
       
    69 void CTestEikonDllLoading::InitializeL()
       
    70 	{
       
    71 	CEikonEnv* env=CEikonEnv::Static();
       
    72 	iContentManager=CEikTestContentManager::NewL(env->FsSession());
       
    73 	env->AddPictureFactoryL(*iContentManager);
       
    74 	}
       
    75 
       
    76 //
       
    77 //
       
    78 // ResourceFileArray
       
    79 //
       
    80 //
       
    81 CArrayFix<TFileName>* CTestEikonDllLoading::ResourceFileArrayL() const
       
    82 	{
       
    83 	CArrayFix<TFileName>* resFileArray = new(ELeave) CArrayFixFlat<TFileName>(1);
       
    84 	CleanupStack::PushL(resFileArray);
       
    85 	
       
    86 	resFileArray->AppendL(ResourceFile());
       
    87 	
       
    88 	CleanupStack::Pop(); // resFileArray
       
    89 	return resFileArray;
       
    90 	}
       
    91 
       
    92 //
       
    93 //
       
    94 // ControlFactoryArray
       
    95 //
       
    96 //
       
    97 CArrayFix<TCreateByTypeFunction>* CTestEikonDllLoading::ControlFactoryArrayL() const
       
    98 	{
       
    99 	CArrayFix<TCreateByTypeFunction>* ctrlFactoryArray = new(ELeave) CArrayFixFlat<TCreateByTypeFunction>(1);
       
   100 	CleanupStack::PushL(ctrlFactoryArray);
       
   101 
       
   102 	ctrlFactoryArray->AppendL(STATIC_CAST(TCreateByTypeFunction, CreateByTypeL));
       
   103 
       
   104 	CleanupStack::Pop(); // ctrlFactoryArray
       
   105 	return ctrlFactoryArray;
       
   106 	}
       
   107 
       
   108 //
       
   109 //
       
   110 // ResourceFile
       
   111 //
       
   112 //
       
   113 TFileName CTestEikonDllLoading::ResourceFile() const
       
   114 	{
       
   115 	_LIT(KResFileName,"z:\\system\\test\\taddlib\\external.rsc");
       
   116 	TFileName resourceFile=KResFileName();
       
   117 	return resourceFile;
       
   118 	}
       
   119 
       
   120 //
       
   121 //
       
   122 // CreateByTypeL
       
   123 //
       
   124 //
       
   125 SEikControlInfo CTestEikonDllLoading::CreateByTypeL(TInt aControlType)
       
   126 	{	
       
   127 	SEikControlInfo controlInfo;
       
   128 	controlInfo.iControl = NULL;
       
   129 	controlInfo.iTrailerTextId = 0;
       
   130 	controlInfo.iFlags = 0;
       
   131 
       
   132     switch (aControlType)
       
   133         {
       
   134     case CTestEikDllLoadedLabel::ECtTestEikDllLoadedLabel:
       
   135 		controlInfo.iControl = new(ELeave) CTestEikDllLoadedLabel;
       
   136 		break;
       
   137 		}
       
   138 	return controlInfo;
       
   139 	}
       
   140 
       
   141 //
       
   142 //
       
   143 // CTestEikDllLoadedLabel::Draw
       
   144 //
       
   145 //
       
   146 void CTestEikDllLoadedLabel::Draw(const TRect& aRect) const
       
   147 	{
       
   148 	CWindowGc& gc=SystemGc();
       
   149 	gc.SetPenColor(KRgbBlack);
       
   150 	CEikLabel::Draw(aRect);
       
   151 	}
       
   152 
       
   153 //
       
   154 // END OF FILE
       
   155 //