usbmgmt/usbmgr/host/functiondrivers/ms/msmm/server/inc/msmmengine.h
changeset 0 c9bc50fca66e
child 49 93c0009bd947
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2008-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 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef MSMMENGINE_H
       
    24 #define MSMMENGINE_H
       
    25 
       
    26 #include <e32base.h>
       
    27 class TUSBMSDeviceDescription;
       
    28 class TMsmmNodeBase;
       
    29 class TUsbMsInterface;
       
    30 class TUsbMsLogicalUnit;
       
    31 class TUsbMsDevice;
       
    32 
       
    33 NONSHARABLE_CLASS(CMsmmEngine) : public CBase
       
    34     {
       
    35 public:
       
    36     virtual ~CMsmmEngine();
       
    37     static CMsmmEngine* NewL();
       
    38     static CMsmmEngine* NewLC();
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43     Called to add a Usb MS device node
       
    44     @param aDevice The device currently attched
       
    45     */
       
    46     void AddUsbMsDeviceL(const TUSBMSDeviceDescription& aDevice);
       
    47         
       
    48     /**
       
    49     Called to add a Usb MS interface node
       
    50     @param aDevice The device to which current interface belongs
       
    51     @param aInterfaceNode Currently adding interface node
       
    52     */
       
    53     TUsbMsInterface* AddUsbMsInterfaceL(TInt aDeviceId, 
       
    54             TUint8 aInterfaceNumber, TInt32 aInterface);
       
    55     
       
    56     /**
       
    57     Called to add a Usb MS LU node
       
    58     @param aDeviceId The device identifier of the device by which current 
       
    59         logical unit supported
       
    60     @param aInterfaceNumber The interface number value of the interface
       
    61         to which current logical unit belongs
       
    62     @param aLogicalUnitNumber Current LU number value
       
    63     @param aDrive The drive on which current LU mounted
       
    64     */
       
    65     void AddUsbMsLogicalUnitL(TInt aDeviceId, TInt aInterfaceNumber, 
       
    66             TInt aLogicalUnitNumber, TText aDrive);
       
    67     
       
    68     /**
       
    69     Called to remove a Usb MS node
       
    70     @param aNodeToBeRemoved The node to be removed
       
    71     */
       
    72     void RemoveUsbMsNode(TMsmmNodeBase* aNodeToBeRemoved);
       
    73     
       
    74     /**
       
    75     Called to search a particular device in engine
       
    76     @param aDeviceId The related device identifier of the device node
       
    77     @return Pointer to the device node found out in the data engine
       
    78     */
       
    79     TUsbMsDevice* SearchDevice(TInt aDeviceId) const;
       
    80         
       
    81     /**
       
    82     Called to search a particular device in engine. Intends to be used
       
    83     when a parent device node is available.
       
    84     @param aDevice The parent device node of the interface node 
       
    85         currently searched 
       
    86     @param aInterfaceNumber The related interface number value of the 
       
    87         interface node
       
    88     @return Pointer to the device node found out in the data engine
       
    89     */
       
    90     TUsbMsInterface* SearchInterface(TMsmmNodeBase* aDevice, 
       
    91             TInt aInterfaceNumber) const;
       
    92     
       
    93 protected:
       
    94     CMsmmEngine();
       
    95     void ConstructL();
       
    96 
       
    97 private:
       
    98 
       
    99     // Called to add a new USB MS interface node into data engine.
       
   100     TUsbMsInterface* AddUsbMsInterfaceNodeL(TUsbMsDevice* iParent,
       
   101             TInt aInterfaceNumber, TInt aInterfaceToken);
       
   102     
       
   103     // Called to add a new USB MS logical unit node into data engine.
       
   104     TUsbMsLogicalUnit* AddUsbMsLogicalUnitNodeL(TUsbMsInterface* iParent,
       
   105             TInt aLogicalUnitNumber, TText aDrive);
       
   106 
       
   107 private:
       
   108     TMsmmNodeBase* iDataEntrys; // Usb Ms device tree
       
   109     };
       
   110 
       
   111 #endif /*MSMMENGINE_H*/