usbclasses/usbobexclasscontroller/inc/CUsbObexClassController.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     1 /*
       
     2 * Copyright (c) 2002-2010 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:  Adheres to the UsbMan USB Class API and manages the class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CUSBOBEXCLASSCONTROLLER_H
       
    20 #define CUSBOBEXCLASSCONTROLLER_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <cusbclasscontrollerplugin.h>
       
    24 #include <usbobex.h>
       
    25 #include <usb/usblogger.h>
       
    26 #include "obexsmwatcher.h"
       
    27 
       
    28 const TInt KObexClassPriority = 2;
       
    29 const TInt KObexNumInterfaces = 2;
       
    30 
       
    31 _LIT(KUsbObexLddName, "eusbc");
       
    32 _LIT(KUsbObexIfc, "OBEX");
       
    33 
       
    34 /**
       
    35  *  This class implements OBEX class controller
       
    36  *
       
    37  *  @since S60 V3.1
       
    38  */
       
    39 NONSHARABLE_CLASS(CUsbObexClassController) : public CUsbClassControllerPlugIn, public MObexSMObserver
       
    40     {
       
    41 public:
       
    42     /**
       
    43      * Constructs a CUsbObexClassController object.
       
    44      *
       
    45      * @since S60 V3.1
       
    46      * @param aOwner USB Device that owns and manages the class.
       
    47      * @return A new CUsbObexClassController object
       
    48      */
       
    49     static CUsbObexClassController* NewL(MUsbClassControllerNotify& aOwner);
       
    50 
       
    51 // from base class CActive.
       
    52 
       
    53     virtual void RunL();
       
    54     virtual void DoCancel();
       
    55     virtual TInt RunError(TInt aError);
       
    56 
       
    57 // from MObexSMObserver    
       
    58     void MosmError(TInt aError);
       
    59 
       
    60 // from base class CUsbClassControllerBase
       
    61     
       
    62     /**
       
    63      * From CUsbClassControllerBase.
       
    64      * Destructor
       
    65      *
       
    66      */ 
       
    67     virtual ~CUsbObexClassController();
       
    68 
       
    69     /**
       
    70      * From CUsbClassControllerBase.
       
    71      * Usbman starts class controller with this method.
       
    72      *
       
    73      * @param aStatus Will be completed either success or failure.
       
    74      */ 
       
    75     virtual void Start(TRequestStatus& aStatus);
       
    76 
       
    77     /**
       
    78      * From CUsbClassControllerBase.
       
    79      * Usbman stops class controller with this method.
       
    80      *
       
    81      * @param aStatus Will be completed either success or failure.
       
    82      */ 
       
    83     virtual void Stop(TRequestStatus& aStatus);
       
    84 
       
    85     /**
       
    86      * From CUsbClassControllerBase.
       
    87      * Returns information about the interfaces supported by this class.
       
    88      *
       
    89      * @param aDescriptorInfo Will be filled in with interface information.
       
    90      */ 
       
    91     virtual void GetDescriptorInfo(TUsbDescriptor& aDescriptorInfo) const;
       
    92 
       
    93 
       
    94 protected:
       
    95     CUsbObexClassController(MUsbClassControllerNotify& aOwner);
       
    96     void DoGetDescriptorInfoL(TUsbDescriptor& aDescriptorInfo) const;
       
    97     void ConstructL();
       
    98 
       
    99 private: // data
       
   100     TRequestStatus* iRequestStatus;
       
   101     CObexUSB* iObexSM; 
       
   102     CObexSMWatcher *iObexSMWatcher;
       
   103     };
       
   104 
       
   105 #endif // CUSBOBEXCLASSCONTROLLER_H