connectivitylayer/usbphonetlink/usbpnserver_exe/inc/cusbpninterface.h
changeset 0 63b37f68c1ce
child 5 8ccc39f9d787
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 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 the License "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 #ifndef USBPNINTERFACE_H
       
    20 #define USBPNINTERFACE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>    // For CBase
       
    24 #include <iscapi.h>     // For RIscApi
       
    25 #include <d32usbc.h>    // For RDevUsbcClient
       
    26 
       
    27 #include "musbpnaltobserver.h"
       
    28 
       
    29 // CONSTANTS
       
    30 // MACROS
       
    31 // DATA TYPES
       
    32 // FUNCTION PROTOTYPES
       
    33 // FORWARD DECLARATIONS
       
    34 class MUsbPnControlObserver;
       
    35 class CUsbPnAlt;
       
    36 class CUsbPnIsaReceiver;
       
    37 class CUsbPnUsbReceiver;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 class CUsbPnInterface : public CBase, public MUsbPnAltObserver
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44 
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CUsbPnInterface* NewL();
       
    49 
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         ~CUsbPnInterface();
       
    54 
       
    55 
       
    56     public: // Functions from base classes
       
    57 
       
    58         /**
       
    59         * Handles device state notifications. Device state or alternate setting change.
       
    60         * @param  TUint aDeviceState USB device's state
       
    61         */
       
    62         void HandleDeviceStateChange( TUint aDeviceState );
       
    63 
       
    64 
       
    65     private:
       
    66 
       
    67         /**
       
    68         * C++ default constructor.
       
    69         */
       
    70         CUsbPnInterface();
       
    71 
       
    72         /**
       
    73         * By default Symbian 2nd phase constructor is private.
       
    74         */
       
    75         void ConstructL();
       
    76 
       
    77         /**
       
    78         * Initialises Phonet interfaces
       
    79         */
       
    80         void InitialiseInterfaceL();
       
    81 
       
    82         /**
       
    83         * Releases Phonet interfaces in opposite order.
       
    84         */
       
    85         void ReleaseInterface();
       
    86 
       
    87         /**
       
    88         * Activates data transfer mode when USB host selects alternate setting.
       
    89         * @since Series ?XX ?SeriesXX_version
       
    90         * @param TUint aAltSetNumber. 0 for altset zero. 1 for data transfer mode.
       
    91         */
       
    92         void SetAltSetting( TUint aAltSetNumber );
       
    93 
       
    94 
       
    95     private:    // Data
       
    96 
       
    97         // Ownership. Alternate setting listening active object
       
    98         CUsbPnAlt*              iAlt;
       
    99 
       
   100         // Ownership. Isa receiver active object
       
   101         CUsbPnIsaReceiver*      iIsaReceiver;
       
   102 
       
   103         // Ownership. USB receiver active object
       
   104         CUsbPnUsbReceiver*      iUsbReceiver;
       
   105 
       
   106         // Ownership.
       
   107         RDevUsbcClient          iCommLdd;
       
   108 
       
   109         // Ownership.
       
   110         RDevUsbcClient          iPnDataLdd;
       
   111 
       
   112         // Ownership.
       
   113         RIscApi                 iIscApi;
       
   114 
       
   115         // Boolean flag for succesful initialisation
       
   116         TBool                   iInitialised;
       
   117 
       
   118     };
       
   119 
       
   120 #endif      // USBPNINTERFACE_H
       
   121 
       
   122 // End of File