os/boardsupport/haitest/bspsvs/suite/bsp/mmc/ldd/inc/LddAsyncRequest.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef LDDASYNCREQUEST_H_
sl@0
    20
#define LDDASYNCREQUEST_H_
sl@0
    21
sl@0
    22
#include <mmc.h>
sl@0
    23
sl@0
    24
sl@0
    25
class DLddAsyncRequest ;
sl@0
    26
sl@0
    27
/**
sl@0
    28
 * DLddAsyncRequest observer interface
sl@0
    29
 *
sl@0
    30
 */
sl@0
    31
class MAsyncRequestObserver
sl@0
    32
	{
sl@0
    33
public:
sl@0
    34
	virtual void Notify(DLddAsyncRequest& aRequest) = 0; 
sl@0
    35
	};
sl@0
    36
sl@0
    37
/**
sl@0
    38
 * Wraps a TRequestStatus along with a function (command) id
sl@0
    39
 *
sl@0
    40
 */
sl@0
    41
class DLddAsyncRequest 
sl@0
    42
	{
sl@0
    43
public:
sl@0
    44
	DLddAsyncRequest(TInt aFunctionId, TRequestStatus* aStatus, MAsyncRequestObserver& aObserver);
sl@0
    45
	virtual ~DLddAsyncRequest();
sl@0
    46
	TRequestStatus* Status();
sl@0
    47
	TInt Error();
sl@0
    48
	TInt FunctionId();
sl@0
    49
	
sl@0
    50
protected:
sl@0
    51
	TInt iFunctionId;	
sl@0
    52
	TRequestStatus* iStatus;	
sl@0
    53
	MAsyncRequestObserver& iObserver;
sl@0
    54
	
sl@0
    55
	TInt iError;
sl@0
    56
	};
sl@0
    57
sl@0
    58
/**
sl@0
    59
 * Extends DLddAsyncRequest to add DMMCSession async functionality
sl@0
    60
 *
sl@0
    61
 */
sl@0
    62
class DMmcSessionAsyncRequest : public DLddAsyncRequest 
sl@0
    63
	{
sl@0
    64
public:	
sl@0
    65
	DMmcSessionAsyncRequest(TInt aFunctionId, TRequestStatus* aStatus, 
sl@0
    66
			MAsyncRequestObserver& aObserver, TDynamicDfcQue* aDfcQ, DMMCStack& aStack, TMMCard& aCard);
sl@0
    67
	~DMmcSessionAsyncRequest();
sl@0
    68
	DMMCSession& Session();	
sl@0
    69
public:
sl@0
    70
	static void SessionEndCallBack(TAny *aPtr);
sl@0
    71
    static void SessionEndDfc(TAny *aPtr);
sl@0
    72
	void Reset();
sl@0
    73
sl@0
    74
private:
sl@0
    75
	DMMCSession* iSession;
sl@0
    76
    TMMCCallBack iSessionEndCallBack;
sl@0
    77
	TDfc iSessionEndDfc;
sl@0
    78
	
sl@0
    79
public:
sl@0
    80
	TAny* iClientDesPtr;
sl@0
    81
	TUint32 iBlkOffet;
sl@0
    82
	TUint8* iBuf;
sl@0
    83
sl@0
    84
private:
sl@0
    85
	void SessionEndCallBack();
sl@0
    86
	void SessionEndDfc();
sl@0
    87
	};
sl@0
    88
sl@0
    89
sl@0
    90
/**
sl@0
    91
 * Extends DLddAsyncRequest to add TPBusCallBack (DMMCSocket) async functionality
sl@0
    92
 * used to handle callbacks for Bus events
sl@0
    93
 *
sl@0
    94
 */
sl@0
    95
class DBusEventRequest : public DMmcSessionAsyncRequest
sl@0
    96
	{
sl@0
    97
public:
sl@0
    98
	DBusEventRequest(TInt aFunctionId, TRequestStatus* aStatus, MAsyncRequestObserver& aObserver, TInt aUnit,
sl@0
    99
						TDynamicDfcQue* aDfcQ, DMMCStack& aStack, TMMCard& aCard);
sl@0
   100
	~DBusEventRequest();
sl@0
   101
	
sl@0
   102
	TPBusState BusState() const { return (TPBusState) iBusState; }
sl@0
   103
	TInt BusError() const { return iBusError; }
sl@0
   104
public:
sl@0
   105
	static void BusEventCallBack(TAny* aPtr, TInt aReason, TAny* a1, TAny* a2);
sl@0
   106
private:
sl@0
   107
	TPBusCallBack	iBusEventCallBack;
sl@0
   108
private:
sl@0
   109
	void BusEventCallBack(TInt aReason, TAny* a1, TAny* a2);
sl@0
   110
	TPBusState iBusState;
sl@0
   111
	TInt iBusError;	
sl@0
   112
	};
sl@0
   113
sl@0
   114
#endif /*LDDASYNCREQUEST_H_*/