diff -r a0ea99b6fa53 -r 19bd632b5100 btobexprofiles/obexsendservices/obexhighway/src/btsendserviceprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/btobexprofiles/obexsendservices/obexhighway/src/btsendserviceprovider.cpp Fri May 28 17:03:06 2010 +0300 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 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: + * + */ + + +#include "btsendserviceprovider.h" +#include +#include "btsssendlisthandler.h" +#include // For Enterprise security settings +#include // For Enterprise security notifier + + + + +CBtSendServiceProvider* CBtSendServiceProvider::NewL() + { + CBtSendServiceProvider* self = new( ELeave ) CBtSendServiceProvider(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +void CBtSendServiceProvider::ConstructL() + { + // Check features setting - if not completely enabled with enterprise settings then we are not allowed to send anything. + // Fail here at the first fence, otherwise there are a number of other areas that need to be considered. + if(BluetoothFeatures::EnterpriseEnablementL() != BluetoothFeatures::EEnabled) + { + RNotifier notifier; + User::LeaveIfError(notifier.Connect()); + CleanupClosePushL(notifier); + User::LeaveIfError(notifier.StartNotifier(KBTEnterpriseItSecurityInfoNotifierUid, KNullDesC8)); + CleanupStack::PopAndDestroy(¬ifier); + + //@TODO in old code we don't continue further what needs to be done here + } + iBTSendingService = CBTServiceAPI::NewL(); + iConverter = CBTSSSendListHandler::NewL(); + } + +CBtSendServiceProvider::CBtSendServiceProvider() + { + + } + + +CBtSendServiceProvider::~CBtSendServiceProvider() + { + if(iConverter) + { + delete iConverter; + iConverter= NULL; + } + if(iBTSendingService) + { + delete iBTSendingService; + iBTSendingService = NULL; + } + } + + +int CBtSendServiceProvider::send(const QList &arguments) + { + TInt error = KErrNone; + + CBTServiceParameterList* parameterList = NULL; + TRAP(error,parameterList= CBTServiceParameterList::NewL()); + if (error) + return error; + iConverter->ConvertList( &arguments, parameterList); + + delete iConverter; + iConverter = NULL; + + TRAP(error,iBTSendingService->StartSynchronousServiceL( EBTSendingService, parameterList )); + if(error) + return error; + return error; + }