haitest/bspsvs/suite/bsp/mmc/inc/ActiveCallbackWrap.h
changeset 0 cec860690d41
equal deleted inserted replaced
-1:000000000000 0:cec860690d41
       
     1 /*
       
     2 * Copyright (c) 2005-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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ACTIVECALLBACKWRAP_H_
       
    20 #define ACTIVECALLBACKWRAP_H_
       
    21 
       
    22 
       
    23 //#include <e32base.h>
       
    24 
       
    25 #include "activecallback.h"
       
    26 
       
    27 
       
    28 class CActiveCallbackWrap
       
    29 	{
       
    30 public:
       
    31 
       
    32 	static CActiveCallbackWrap* NewLC(MActiveCallback& aCallback, TInt aFunctionId, TInt aExpectedAsyncError = KErrNone);
       
    33 	static CActiveCallbackWrap* NewL(MActiveCallback& aCallback, TInt aFunctionId, TInt aExpectedAsyncError = KErrNone);
       
    34 	virtual ~CActiveCallbackWrap();
       
    35 
       
    36 
       
    37 	CActiveCallback& ActiveCallback() { return *iActiveCallback ; }
       
    38 	TInt FunctionId() const { return iFunctionId; }
       
    39 	TInt ExpectedAsyncError() const { return iExpectedAsyncError; }
       
    40 	void SetDesData(HBufC8* aData);
       
    41 	void SetExpectedDesData(HBufC8* aData);
       
    42 	HBufC8* Data() { return iData; }
       
    43 	HBufC8* ExpectedData() { return iExpectedData; }
       
    44 	TPtr8& DataPtr() { return iDataPtr; }
       
    45 	TPtr8& ExpectedDataPtr() { return iExpectedDataPtr; }
       
    46 
       
    47 protected:
       
    48 	CActiveCallbackWrap(TInt aFunctionId, TInt aExpectedAsyncError);
       
    49 	void ConstructL(MActiveCallback& aCallback);
       
    50 	
       
    51 private:	
       
    52 	TInt				iFunctionId;
       
    53 	CActiveCallback*	iActiveCallback;
       
    54 	TInt				iExpectedAsyncError;
       
    55 	HBufC8*				iData;
       
    56 	HBufC8*				iExpectedData;
       
    57 	TPtr8				iDataPtr;
       
    58 	TPtr8				iExpectedDataPtr;
       
    59 	};
       
    60 
       
    61 #endif /*ACTIVECALLBACKWRAP_H_*/