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