usbmgmt/usbmgr/host/fdf/production/server/inc/activewaitforbusevent.h
changeset 0 c9bc50fca66e
child 15 f92a4f87e424
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2007-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 #ifndef ACTIVEWAITFORBUSEVENT_H
       
    19 #define ACTIVEWAITFORBUSEVENT_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #ifdef __OVER_DUMMYUSBDI__
       
    24 #include <usbhost/dummyusbdi/d32usbdi_hubdriver.h>
       
    25 #else
       
    26 #include <d32usbdi_hubdriver.h>
       
    27 #endif
       
    28 
       
    29 NONSHARABLE_CLASS(MBusEventObserver)
       
    30 	{
       
    31 public:
       
    32 	virtual void MbeoBusEvent() = 0;
       
    33 	};
       
    34 
       
    35 NONSHARABLE_CLASS(CActiveWaitForBusEvent) : public CActive
       
    36 	{
       
    37 public:
       
    38 	static CActiveWaitForBusEvent* NewL(RUsbHubDriver& aHubDriver, 
       
    39 		RUsbHubDriver::TBusEvent& aBusEvent,
       
    40 		MBusEventObserver& aObserver);
       
    41 	~CActiveWaitForBusEvent();
       
    42 
       
    43 public:
       
    44 	void Wait();
       
    45 
       
    46 private:
       
    47 	CActiveWaitForBusEvent(RUsbHubDriver& aHubDriver, 
       
    48 		RUsbHubDriver::TBusEvent& aBusEvent,
       
    49 		MBusEventObserver& aObserver);
       
    50 
       
    51 private: // from CActive
       
    52 	void RunL();
       
    53 	void DoCancel();
       
    54 
       
    55 private: // unowned
       
    56 	RUsbHubDriver& iHubDriver;
       
    57 	RUsbHubDriver::TBusEvent& iBusEvent;
       
    58 	MBusEventObserver& iObserver;
       
    59 	};
       
    60 
       
    61 #endif // ACTIVEWAITFORBUSEVENT_H