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