sl@0: // Copyright (c) 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 the License "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: #ifndef CUSBHOST sl@0: #define CUSBHOST sl@0: sl@0: class TUsbInterfaceDescriptor; sl@0: class TUsbDeviceDescriptor; sl@0: class RUsbInterface; sl@0: class THostMassStorageConfig; sl@0: sl@0: class CUsbMsMountManager; sl@0: class CUsbHostAo; sl@0: sl@0: class MDriveDisplay; sl@0: sl@0: class CUsbHost: public CBase, public MUsbHostBusEventObserver sl@0: { sl@0: public: sl@0: static CUsbHost* NewL(); sl@0: ~CUsbHost(); sl@0: protected: sl@0: void ConstructL(); sl@0: CUsbHost(); sl@0: sl@0: public: sl@0: TInt DevicesNumber() const; sl@0: void DriveMap(TDriveMap& aDriveMap) const; sl@0: void DeviceMap(TInt aDeviceIndex, TDeviceMap& aDeviceMap) const; sl@0: sl@0: void Start(); sl@0: sl@0: protected: sl@0: void ProcessBusEventL(); sl@0: sl@0: private: sl@0: void OpenHubL(); sl@0: void CloseHubL(); sl@0: void LoadFileSystemL(); sl@0: sl@0: void StartUsbHostMs(TRequestStatus& aStatus); sl@0: void Cancel(); sl@0: sl@0: RUsbHubDriver::TBusEvent::TEvent WaitForBusEvent(); sl@0: sl@0: TToken OpenDeviceL(); sl@0: void CloseDeviceL(); sl@0: void CloseAllDevicesL(); sl@0: sl@0: void MountDeviceL(); sl@0: void DismountDeviceL(); sl@0: void DismountAllFileSystemsL(); sl@0: sl@0: private: sl@0: CUsbHostAo* iUsbHostAo; sl@0: sl@0: RUsbHubDriver iHubDriver; sl@0: sl@0: CUsbMsMountManager* iMountManager; sl@0: sl@0: TUint iDeviceHandle; sl@0: sl@0: RUsbHubDriver::TBusEvent iEvent; sl@0: }; sl@0: sl@0: sl@0: class CUsbHostDisp: public CUsbHost sl@0: { sl@0: public: sl@0: static CUsbHostDisp* NewL(MDriveDisplay& aDriveDisplay); sl@0: ~CUsbHostDisp(); sl@0: private: sl@0: void ConstructL(); sl@0: CUsbHostDisp(MDriveDisplay& aDriveDisplay); sl@0: sl@0: private: sl@0: void ProcessBusEventL(); sl@0: sl@0: private: sl@0: MDriveDisplay& iDriveDisplay; sl@0: }; sl@0: sl@0: #endif