usbengines/usbdevcon/inc/crequestshandler.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     1 /*
       
     2 * Copyright (c) 2007 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:  Handles requests
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CREQUESTSHANDLER_H
       
    20 #define CREQUESTSHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CUsbCMHandler;
       
    25 
       
    26 /**
       
    27  *  Requests handler
       
    28  *
       
    29  *  @lib usbdevcon.lib
       
    30  *  @since S60 v.5.0 
       
    31  */
       
    32  
       
    33 class CRequestsHandler : public CBase
       
    34     {
       
    35 
       
    36 public:
       
    37 
       
    38      /**
       
    39      * Two-phased constructor.
       
    40      *
       
    41      * @since S60 v.5.0
       
    42      * @param aLdd Link to LDD services
       
    43      * @param aUsbWatcher Link to USb Watcher services
       
    44      * @param aUsbManager Link to USB Manager services
       
    45      * @return Constructed instance
       
    46      */ 
       
    47     static CRequestsHandler* NewL(RDevUsbcClient& aLdd, RUsbWatcher& aUsbWatcher, RUsb& aUsbManager);
       
    48     
       
    49     /**
       
    50     * Destructor.
       
    51     *
       
    52     * @since S60 v.5.0
       
    53     */
       
    54     virtual ~CRequestsHandler();
       
    55     
       
    56     /**
       
    57      * Handler
       
    58      *
       
    59      * @since S60 v.5.0
       
    60      * @param aSetupPacket Request to be handled
       
    61      * @param aUsbManager Link to UsbManager services
       
    62      */
       
    63     TInt Handle(const RBuf8& aSetupPacket, RBuf8& aData);
       
    64     
       
    65 private:
       
    66     
       
    67     /**
       
    68      * Default construction
       
    69      *
       
    70      * @since S60 v.5.0
       
    71      * @param aLdd Link to LDD services
       
    72      * @param aUsbWatcher Link to USB Watcher services
       
    73      * @param aUsbManager Link to USB Manager services
       
    74      */
       
    75     CRequestsHandler(RDevUsbcClient& aLdd, RUsbWatcher& aUsbWatcher, RUsb& aUsbManager);
       
    76     
       
    77     /**
       
    78      * Two-phased constructor.
       
    79      *
       
    80      * @since S60 v.5.0
       
    81      */ 
       
    82     void ConstructL();
       
    83 
       
    84 private: // data
       
    85     
       
    86     /**
       
    87      * Request handlers
       
    88      * Own.  
       
    89      */
       
    90     RPointerArray<CUsbCMHandler> iHandlers;
       
    91     
       
    92     /**
       
    93      * LDD
       
    94      * Not own.  
       
    95      */
       
    96     RDevUsbcClient& iLdd;
       
    97     
       
    98     /**
       
    99      * USB Watcher
       
   100      * Not own.  
       
   101      */
       
   102     RUsbWatcher& iUsbWatcher;
       
   103     
       
   104     /**
       
   105      * Usb manager
       
   106      * Not own
       
   107      */
       
   108     RUsb& iUsbManager;
       
   109         
       
   110     };
       
   111 
       
   112 #endif // CREQUESTSHANDLER_H