kerneltest/f32test/shostmassstorage/msman/inc/cusbhost.h
changeset 43 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 43:96e5fb8b040d
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef CUSBHOST
       
    18 #define CUSBHOST
       
    19 
       
    20 class TUsbInterfaceDescriptor;
       
    21 class TUsbDeviceDescriptor;
       
    22 class RUsbInterface;
       
    23 class THostMassStorageConfig;
       
    24 
       
    25 class CUsbMsMountManager;
       
    26 class CUsbHostAo;
       
    27 
       
    28 class MDriveDisplay;
       
    29 
       
    30 class CUsbHost: public CBase, public MUsbHostBusEventObserver
       
    31     {
       
    32 public:
       
    33 	static CUsbHost* NewL();
       
    34 	~CUsbHost();
       
    35 protected:
       
    36     void ConstructL();
       
    37 	CUsbHost();
       
    38 
       
    39 public:
       
    40     TInt DevicesNumber() const;
       
    41     void DriveMap(TDriveMap& aDriveMap) const;
       
    42     void DeviceMap(TInt aDeviceIndex, TDeviceMap& aDeviceMap) const;
       
    43 
       
    44     void Start();
       
    45 
       
    46 protected:
       
    47     void ProcessBusEventL();
       
    48 
       
    49 private:
       
    50     void OpenHubL();
       
    51     void CloseHubL();
       
    52     void LoadFileSystemL();
       
    53 
       
    54     void StartUsbHostMs(TRequestStatus& aStatus);
       
    55     void Cancel();
       
    56 
       
    57     RUsbHubDriver::TBusEvent::TEvent WaitForBusEvent();
       
    58 
       
    59     TToken OpenDeviceL();
       
    60     void CloseDeviceL();
       
    61     void CloseAllDevicesL();
       
    62 
       
    63     void MountDeviceL();
       
    64     void DismountDeviceL();
       
    65     void DismountAllFileSystemsL();
       
    66 
       
    67 private:
       
    68     CUsbHostAo* iUsbHostAo;
       
    69     
       
    70     RUsbHubDriver iHubDriver;
       
    71 
       
    72     CUsbMsMountManager* iMountManager;
       
    73 
       
    74     TUint iDeviceHandle;
       
    75 
       
    76     RUsbHubDriver::TBusEvent iEvent;
       
    77     };
       
    78 
       
    79 
       
    80 class CUsbHostDisp: public CUsbHost
       
    81     {
       
    82 public:
       
    83 	static CUsbHostDisp* NewL(MDriveDisplay& aDriveDisplay);
       
    84 	~CUsbHostDisp();
       
    85 private:
       
    86     void ConstructL();
       
    87 	CUsbHostDisp(MDriveDisplay& aDriveDisplay);
       
    88 
       
    89 private:
       
    90     void ProcessBusEventL();
       
    91 
       
    92 private:
       
    93     MDriveDisplay& iDriveDisplay;
       
    94     };
       
    95 
       
    96 #endif