sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include "ActiveCallbackWrap.h" sl@0: sl@0: sl@0: CActiveCallbackWrap::CActiveCallbackWrap(TInt aFunctionId, TInt aExpectedAsyncError) sl@0: : iFunctionId(aFunctionId) sl@0: , iActiveCallback(NULL) sl@0: , iExpectedAsyncError(aExpectedAsyncError) sl@0: , iData(NULL) sl@0: , iExpectedData(NULL) sl@0: , iDataPtr(NULL, 0) sl@0: , iExpectedDataPtr(NULL, 0) sl@0: { sl@0: } sl@0: sl@0: void CActiveCallbackWrap::SetDesData(HBufC8* aData) sl@0: { sl@0: if (aData) sl@0: { sl@0: iData = aData; sl@0: iDataPtr.Set(aData->Des()); sl@0: } sl@0: } sl@0: sl@0: void CActiveCallbackWrap::SetExpectedDesData(HBufC8* aData) sl@0: { sl@0: if (aData) sl@0: { sl@0: iExpectedData = aData; sl@0: iExpectedDataPtr.Set(aData->Des()); sl@0: } sl@0: } sl@0: sl@0: CActiveCallbackWrap* CActiveCallbackWrap::NewLC(MActiveCallback& aCallback, TInt aFunctionId, TInt aExpectedAsyncError) sl@0: { sl@0: CActiveCallbackWrap* self = new (ELeave) CActiveCallbackWrap(aFunctionId, aExpectedAsyncError); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCallback); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: CActiveCallbackWrap* CActiveCallbackWrap::NewL(MActiveCallback& aCallback, TInt aFunctionId, TInt aExpectedAsyncError) sl@0: { sl@0: CActiveCallbackWrap* self = CActiveCallbackWrap::NewLC(aCallback, aFunctionId, aExpectedAsyncError); sl@0: CleanupStack::Pop(self); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: CActiveCallbackWrap::~CActiveCallbackWrap() sl@0: { sl@0: delete iActiveCallback; sl@0: delete iData; sl@0: delete iExpectedData; sl@0: } sl@0: sl@0: sl@0: void CActiveCallbackWrap::ConstructL(MActiveCallback& aCallback) sl@0: { sl@0: iActiveCallback = CActiveCallback::NewL(aCallback, CActive::EPriorityStandard); sl@0: }