usbmgmt/usbmgr/host/fdf/production/fdcbase/src/fdcplugin.cpp
changeset 0 c9bc50fca66e
child 15 f92a4f87e424
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2007-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 "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 * Implementation of FDC plugin.
       
    16 *
       
    17 */
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #include <ecom/ecom.h>
       
    25 #include <usbhost/internal/fdcplugin.h>
       
    26 #include <usbhost/internal/fdcpluginobserver.h>
       
    27 #include <usb/usblogger.h>
       
    28 
       
    29 #ifdef __FLOG_ACTIVE
       
    30 _LIT8(KLogComponent, "fdcplugin");
       
    31 #endif
       
    32 
       
    33 EXPORT_C CFdcPlugin::~CFdcPlugin()
       
    34 	{
       
    35 	LOG_FUNC
       
    36 
       
    37 	REComSession::DestroyedImplementation(iInstanceId);
       
    38 	}
       
    39 
       
    40 EXPORT_C CFdcPlugin::CFdcPlugin(MFdcPluginObserver& aObserver)
       
    41 :	iObserver(aObserver)
       
    42 	{
       
    43 	LOG_FUNC
       
    44 	}
       
    45 
       
    46 EXPORT_C CFdcPlugin* CFdcPlugin::NewL(TUid aImplementationUid, MFdcPluginObserver& aObserver)
       
    47 	{
       
    48 	LOG_STATIC_FUNC_ENTRY
       
    49 
       
    50 	LOGTEXT2(_L8("\t\tFDC implementation UID: 0x%08x"), aImplementationUid);
       
    51 
       
    52 	CFdcPlugin* plugin = reinterpret_cast<CFdcPlugin*>(
       
    53 		REComSession::CreateImplementationL(
       
    54 			aImplementationUid, 
       
    55 			_FOFF(CFdcPlugin, iInstanceId),
       
    56 			&aObserver
       
    57 			)
       
    58 		);
       
    59 
       
    60 	LOGTEXT2(_L8("\tplugin = 0x%08x"), plugin);
       
    61 	return plugin;
       
    62 	}
       
    63 
       
    64 EXPORT_C MFdcPluginObserver& CFdcPlugin::Observer()
       
    65 	{
       
    66 	return iObserver;
       
    67 	}
       
    68 
       
    69 EXPORT_C TInt CFdcPlugin::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
       
    70 	{
       
    71 	return CBase::Extension_(aExtensionId, a0, a1);
       
    72 	}