os/boardsupport/haitest/bspsvs/suite/bsp/mmc/ldd/inc/LddAsyncRequest.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/bsp/mmc/ldd/inc/LddAsyncRequest.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,114 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef LDDASYNCREQUEST_H_
    1.23 +#define LDDASYNCREQUEST_H_
    1.24 +
    1.25 +#include <mmc.h>
    1.26 +
    1.27 +
    1.28 +class DLddAsyncRequest ;
    1.29 +
    1.30 +/**
    1.31 + * DLddAsyncRequest observer interface
    1.32 + *
    1.33 + */
    1.34 +class MAsyncRequestObserver
    1.35 +	{
    1.36 +public:
    1.37 +	virtual void Notify(DLddAsyncRequest& aRequest) = 0; 
    1.38 +	};
    1.39 +
    1.40 +/**
    1.41 + * Wraps a TRequestStatus along with a function (command) id
    1.42 + *
    1.43 + */
    1.44 +class DLddAsyncRequest 
    1.45 +	{
    1.46 +public:
    1.47 +	DLddAsyncRequest(TInt aFunctionId, TRequestStatus* aStatus, MAsyncRequestObserver& aObserver);
    1.48 +	virtual ~DLddAsyncRequest();
    1.49 +	TRequestStatus* Status();
    1.50 +	TInt Error();
    1.51 +	TInt FunctionId();
    1.52 +	
    1.53 +protected:
    1.54 +	TInt iFunctionId;	
    1.55 +	TRequestStatus* iStatus;	
    1.56 +	MAsyncRequestObserver& iObserver;
    1.57 +	
    1.58 +	TInt iError;
    1.59 +	};
    1.60 +
    1.61 +/**
    1.62 + * Extends DLddAsyncRequest to add DMMCSession async functionality
    1.63 + *
    1.64 + */
    1.65 +class DMmcSessionAsyncRequest : public DLddAsyncRequest 
    1.66 +	{
    1.67 +public:	
    1.68 +	DMmcSessionAsyncRequest(TInt aFunctionId, TRequestStatus* aStatus, 
    1.69 +			MAsyncRequestObserver& aObserver, TDynamicDfcQue* aDfcQ, DMMCStack& aStack, TMMCard& aCard);
    1.70 +	~DMmcSessionAsyncRequest();
    1.71 +	DMMCSession& Session();	
    1.72 +public:
    1.73 +	static void SessionEndCallBack(TAny *aPtr);
    1.74 +    static void SessionEndDfc(TAny *aPtr);
    1.75 +	void Reset();
    1.76 +
    1.77 +private:
    1.78 +	DMMCSession* iSession;
    1.79 +    TMMCCallBack iSessionEndCallBack;
    1.80 +	TDfc iSessionEndDfc;
    1.81 +	
    1.82 +public:
    1.83 +	TAny* iClientDesPtr;
    1.84 +	TUint32 iBlkOffet;
    1.85 +	TUint8* iBuf;
    1.86 +
    1.87 +private:
    1.88 +	void SessionEndCallBack();
    1.89 +	void SessionEndDfc();
    1.90 +	};
    1.91 +
    1.92 +
    1.93 +/**
    1.94 + * Extends DLddAsyncRequest to add TPBusCallBack (DMMCSocket) async functionality
    1.95 + * used to handle callbacks for Bus events
    1.96 + *
    1.97 + */
    1.98 +class DBusEventRequest : public DMmcSessionAsyncRequest
    1.99 +	{
   1.100 +public:
   1.101 +	DBusEventRequest(TInt aFunctionId, TRequestStatus* aStatus, MAsyncRequestObserver& aObserver, TInt aUnit,
   1.102 +						TDynamicDfcQue* aDfcQ, DMMCStack& aStack, TMMCard& aCard);
   1.103 +	~DBusEventRequest();
   1.104 +	
   1.105 +	TPBusState BusState() const { return (TPBusState) iBusState; }
   1.106 +	TInt BusError() const { return iBusError; }
   1.107 +public:
   1.108 +	static void BusEventCallBack(TAny* aPtr, TInt aReason, TAny* a1, TAny* a2);
   1.109 +private:
   1.110 +	TPBusCallBack	iBusEventCallBack;
   1.111 +private:
   1.112 +	void BusEventCallBack(TInt aReason, TAny* a1, TAny* a2);
   1.113 +	TPBusState iBusState;
   1.114 +	TInt iBusError;	
   1.115 +	};
   1.116 +
   1.117 +#endif /*LDDASYNCREQUEST_H_*/