mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevdpextnmap.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 15:51:48 +0300
changeset 18 1b39655331a3
parent 0 d0791faffa3f
permissions -rw-r--r--
Revision: 201005 Kit: 201015

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

/**
 @file
 @internalComponent
*/

#include "cmtpdevdpextnmap.h"

CDevDpExtnPluginMap* CDevDpExtnPluginMap::NewL(MExtnDevPluginCallback& aDevdp, TUid aUid)
	{
	CDevDpExtnPluginMap* self = new (ELeave) CDevDpExtnPluginMap();
	CleanupStack::PushL(self);
	self->ConstructL(aDevdp, aUid);
	CleanupStack::Pop(self);
	return self;
	}

void CDevDpExtnPluginMap::ConstructL(MExtnDevPluginCallback& aDevdp, TUid aUid)
	{
	CMtpExtnDevicePropPlugin* extnPlugin = CMtpExtnDevicePropPlugin::NewL(aUid);
	extnPlugin->SetCallback(aDevdp);
	SetExtPlugin(extnPlugin);
	}

void CDevDpExtnPluginMap::SetExtPlugin(CMtpExtnDevicePropPlugin* aPlugin)
	{
	iPlugin = aPlugin;
	}


CMtpExtnDevicePropPlugin* CDevDpExtnPluginMap::ExtPlugin()
	{
	return iPlugin;
	}
 	
CDevDpExtnPluginMap::~CDevDpExtnPluginMap()
	{
	iSupportedOpCodes.Close();

	if(NULL != iPlugin)
		{
		delete iPlugin;
		iPlugin = NULL;
		}
	} 	
 	
RArray<TUint>* CDevDpExtnPluginMap::SupportedOpCodes()
	{
	return &iSupportedOpCodes;
	}