fep/frontendprocessor/test/feps/TFEP4PlugIn.cpp
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 // Copyright (c) 1997-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 /** @file
       
    17 	@internalComponent
       
    18 */
       
    19 
       
    20 #include <bautils.h>
       
    21 #include <ecom/implementationproxy.h>
       
    22 #include <ecom/ecom.h>
       
    23 
       
    24 #include <tfep4_ui.rsg>
       
    25 
       
    26 #include "TFEP4.H"
       
    27 #include "TFEP4PlugIn.H"
       
    28 #include "TESTFEPRESFILEPATH.H"
       
    29 
       
    30 
       
    31 
       
    32 // CTstFepPlugIn
       
    33 
       
    34 const TInt KTstFepPlugInImplementationValue = 0x1028716D;
       
    35 
       
    36 const TImplementationProxy ImplementationTable[] = 
       
    37 	{
       
    38 	IMPLEMENTATION_PROXY_ENTRY(KTstFepPlugInImplementationValue, CTstFepPlugIn::NewL )
       
    39 	};
       
    40 
       
    41 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    42 	{
       
    43 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    44 	return ImplementationTable;
       
    45 	}
       
    46 
       
    47 
       
    48 CTstFepPlugIn* CTstFepPlugIn::NewL()
       
    49 	{ // static
       
    50 	return new(ELeave) CTstFepPlugIn;
       
    51 	}
       
    52 
       
    53 CCoeFep* CTstFepPlugIn::NewFepL(CCoeEnv& aConeEnvironment, const CCoeFepParameters& aFepParameters)
       
    54 	{
       
    55 	CTstFep* const fep=new(ELeave) CTstFep(aConeEnvironment);
       
    56 	CleanupStack::PushL(fep);
       
    57 	fep->ConstructL(aFepParameters);
       
    58 	CleanupStack::Pop(fep);
       
    59 	return fep;
       
    60 	}
       
    61 
       
    62 void CTstFepPlugIn::SynchronouslyExecuteSettingsDialogL(CCoeEnv& aConeEnvironment)
       
    63 	{
       
    64 	_LIT(KLitResourceFileName, "tfep4_ui.rsc");
       
    65 	
       
    66 	TFileName* resourceFileName=new(ELeave) TFileName;
       
    67 	CleanupStack::PushL(resourceFileName);
       
    68 	Dll::FileName(*resourceFileName); // Get the drive letter
       
    69 
       
    70 	TParse* parse=new(ELeave) TParse;
       
    71 	CleanupStack::PushL(parse);
       
    72 	User::LeaveIfError(parse->SetNoWild(KLitResourceFileName, &KTestFepResFilePath, resourceFileName));
       
    73 	resourceFileName->Copy(parse->FullName());
       
    74 	CleanupStack::PopAndDestroy(parse);
       
    75 	
       
    76 	BaflUtils::NearestLanguageFile(aConeEnvironment.FsSession(), *resourceFileName);
       
    77 	TTstResourceFileId resourceFileId(aConeEnvironment, aConeEnvironment.AddResourceFileL(*resourceFileName)); // object must not be an anonymous temporary passed into CleanupStack::PushL, as its lifetime would be too short
       
    78 	CleanupStack::PopAndDestroy(resourceFileName);
       
    79 	CleanupStack::PushL(resourceFileId);
       
    80 	(new(ELeave) CTstSettingsDialog)->ExecuteLD(R_TFP_SETTINGS_DIALOG);
       
    81 	CleanupStack::PopAndDestroy(&resourceFileId);
       
    82 	}