authenticationservices/authenticationserver/test/tAuthSvr/miscPlugins/authplugininterface.cpp
changeset 29 ece3df019add
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21 */
       
    22 
       
    23 #include "authserver_client.h"
       
    24 #include <authserver/authplugininterface.h>
       
    25 
       
    26 using namespace AuthServer;
       
    27 
       
    28 //EXPORT_C CAuthPluginInterface::CAuthPluginInterface()
       
    29 //	{}
       
    30 
       
    31 EXPORT_C CAuthPluginInterface::~CAuthPluginInterface()
       
    32 	{
       
    33 	// Destroy any instance variables and then
       
    34 	// inform the framework that this specific
       
    35 	// instance of the interface has been destroyed.
       
    36 	REComSession::DestroyedImplementation(iDtor_ID_Key);
       
    37 	}
       
    38 /*
       
    39 EXPORT_C CAuthPluginInterface* CAuthPluginInterface::NewL()
       
    40 	{// Hardcoded to be the PIN plugin by default
       
    41 	
       
    42 	const TUid KPINPluginUid = { 0x102740FD };
       
    43 	TAny* defaultPlugin = REComSession::CreateImplementationL(KPINPluginUid, _FOFF(CAuthPluginInterface, iDtor_ID_Key));
       
    44 	return (reinterpret_cast<CAuthPluginInterface*>(defaultPlugin));
       
    45 	}
       
    46 */
       
    47 
       
    48 EXPORT_C CAuthPluginInterface* CAuthPluginInterface::NewL(TPluginId aPluginId)
       
    49 	{// Use the default ECOM resolver
       
    50 /*	
       
    51 	//TDesC8& aCue = aPluginId;
       
    52 	//aCue = aPluginId;
       
    53 	TBuf8<32> cueValue;
       
    54 	//TDes8 cueValue;
       
    55 	_LIT8(KFormatValue2, "%x");
       
    56 	cueValue.Format(KFormatValue2, aPluginId);		
       
    57 
       
    58 	TEComResolverParams resolverParams;
       
    59 	resolverParams.SetDataType(cueValue);	//(aCue);
       
    60 	
       
    61 	resolverParams.SetWildcardMatch(ETrue);	//There might be problems with this
       
    62 	
       
    63 	//TAny* pluginInterface =	REComSession::CreateImplementationL(KCAuthPluginInterfaceUid,
       
    64 	//_FOFF(CAuthPluginInterface,iDtor_ID_Key),NULL,resolverParams);
       
    65 	TAny* pluginInterface =	REComSession::CreateImplementationL(KCAuthPluginInterfaceUid,
       
    66 	_FOFF(CAuthPluginInterface,iDtor_ID_Key),resolverParams);
       
    67 
       
    68 
       
    69 	return (reinterpret_cast<CAuthPluginInterface*>(pluginInterface));
       
    70 */
       
    71   TEComResolverParams resolverParams;
       
    72   TBufC8<16> pluginIdTxt;
       
    73   
       
    74   pluginIdTxt.Des().Format(_L8("%x"), aPluginId);
       
    75   
       
    76   resolverParams.SetDataType(pluginIdTxt);
       
    77   
       
    78   TAny* plugin = 0; 
       
    79 
       
    80   plugin = 
       
    81 	REComSession::CreateImplementationL(KCAuthPluginInterfaceUid,
       
    82 										_FOFF(CAuthPluginInterface,
       
    83 											  iDtor_ID_Key),
       
    84 										resolverParams,
       
    85 										KRomOnlyResolverUid);	
       
    86 	return reinterpret_cast<CAuthPluginInterface*>(plugin);										
       
    87 	}
       
    88 
       
    89 
       
    90 EXPORT_C void CAuthPluginInterface::ListImplementationsL(RImplInfoPtrArray& aImplInfoArray)
       
    91 	{
       
    92 	REComSession::ListImplementationsL(KCAuthPluginInterfaceUid, aImplInfoArray);
       
    93 	}
       
    94 
       
    95 const TPtrC& CAuthPluginInterface::GetName() const
       
    96 	{
       
    97 	return iName;
       
    98 	}
       
    99 	
       
   100 const TPtrC& CAuthPluginInterface::GetDescription() const
       
   101 	{
       
   102 	return iDescription;
       
   103 	}
       
   104 	
       
   105 TAuthPluginType CAuthPluginInterface::GetType() const
       
   106 	{
       
   107 	return iType;
       
   108 	}
       
   109 
       
   110 /** DLL Entry point */
       
   111 //GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
       
   112 //	{
       
   113 //	return(KErrNone);
       
   114 //	}
       
   115 
       
   116 /*
       
   117 //Defined in main.cpp
       
   118 TBool E32Dll()
       
   119 	{
       
   120 	return (ETrue);
       
   121 	}
       
   122 */