accesssec_plat/eap_vpn_api/inc/eap_vpn_if.inl
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:23:57 +0100
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201029 Kit: 201035

/*
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "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: EAP and WLAN authentication protocols.
*
*/

/*
* %version: 12 %
*/

// Interface's (abstract base class's) static factory method implementation.
// Asks ECOM plugin framework to instantiate appropriate concret plugin
// implementation.
inline CEapVpnInterface* CEapVpnInterface::NewL(MAbsEapVpnInterface* aCaller, TBool aClient)
	{
    // Parameters for the implementation 
    TAbsEapVpnInterfaceParams params;
    params.iCaller = aCaller;
    params.iClient = aClient;
	// Find implementation for our interface.
    // - KCEapVpnInterfaceUid is the UID of our custom ECOM
    //   interface.
    // - This call will leave, if the plugin architecture cannot find
    //   implementation.
    // - The returned pointer points to one of our interface implementation
    //   instances.
	TAny* interface = REComSession::CreateImplementationL (
		KCEapVpnInterfaceImplementationUid, _FOFF (CEapVpnInterface, iDtor_ID_Key), (TAny*) &params);

	return reinterpret_cast <CEapVpnInterface*> (interface);
	}

// Interface's (abstract base class's) static factory method implementation.
// Asks ECOM plugin framework to instantiate appropriate concret plugin
// implementation.
    inline CEapVpnInterface* CEapVpnInterface::NewL(const TDesC8& aType, MAbsEapVpnInterface* aCaller, TBool aClient)
        {
        TEComResolverParams resolverParams;
        // Only one interface type
        // Remove these lines and uncomment line resolverParams.SetDataType (aType);
        // if you really have many possible intance types
        // ---------------------------------------
        (void) aType;
        _LIT8 (KEapPluginText,"EAPVPNIF");
        resolverParams.SetDataType (KEapPluginText);
        // ---------------------------------------
        // +++++++++++++++++++++++++++++++++++++++
        //resolverParams.SetDataType (aType);
        // +++++++++++++++++++++++++++++++++++++++
        resolverParams.SetWildcardMatch (ETrue);

    // Parameters for the implementation 
        TAbsEapVpnInterfaceParams params;
        params.iCaller = aCaller;
        params.iClient = aClient;
    // Find implementation for our interface.
    // - KCEapVpnInterfaceUid is the UID of our custom ECOM
    //   interface. It is defined in EComInterfaceDefinition.h
    // - This call will leave, if the plugin architecture cannot find
    //   implementation.
    // - The returned pointer points to one of our interface implementation
    //   instances.
        TAny* interface = REComSession::CreateImplementationL (KCEapVpnInterfaceUid,
            _FOFF (CEapVpnInterface, iDtor_ID_Key), (TAny*) &params, resolverParams, KCEapVpnInterfaceResolverUid);

        return reinterpret_cast <CEapVpnInterface*> (interface);
        }

// Interface's (abstract base class's) destructor
inline CEapVpnInterface::~CEapVpnInterface()
	{
	// If in the NewL some memory is reserved for member data, it must be
	// released here. This interface does not have any instance variables so
	// no need to delete anything.

	// Inform the ECOM framework that this specific instance of the
    // interface has been destroyed.
	REComSession::DestroyedImplementation (iDtor_ID_Key);
	}   

// Interface's (abstract base class's) constructor
inline CEapVpnInterface::CEapVpnInterface()
: CActive(CActive::EPriorityStandard)
    {
    iDtor_ID_Key.Uid(0);
    }

// End