usbmgmt/usbmgr/usbman/server/INC/CUsbDummyClassControllerLdd.h
changeset 51 eaaed528d5fd
equal deleted inserted replaced
46:613028a7da24 51:eaaed528d5fd
       
     1 /**
       
     2 * Copyright (c) 1997-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:
       
    15 * Adheres to the UsbMan USB Class Controller API.
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24 */
       
    25 
       
    26 #ifndef CUSBDUMMYCLASSCONTROLLERLDD_H__
       
    27 #define CUSBDUMMYCLASSCONTROLLERLDD_H__
       
    28 #include <e32std.h>
       
    29 #include <e32property.h>
       
    30 #include <cusbclasscontrollerplugin.h>
       
    31 
       
    32 NONSHARABLE_CLASS(CUsbDummyClassControllerLdd) : public CUsbClassControllerPlugIn
       
    33 
       
    34 	{
       
    35 public:
       
    36 	static CUsbDummyClassControllerLdd* NewL(MUsbClassControllerNotify& aOwner, TUint aIndex);
       
    37 	~CUsbDummyClassControllerLdd();
       
    38 
       
    39 private:
       
    40 	CUsbDummyClassControllerLdd(MUsbClassControllerNotify& aOwner, TUint aIndex);
       
    41 	CUsbDummyClassControllerLdd(MUsbClassControllerNotify& aOwner,TUint aIndex, TInt aPriority);
       
    42 	void ConstructL();
       
    43 
       
    44 private: // from CActive
       
    45 	void RunL();
       
    46 	void DoCancel();
       
    47 	TInt RunError(TInt aError);
       
    48 
       
    49 private: // from CUsbClassControllerBase
       
    50 	void Start(TRequestStatus& aStatus);
       
    51 	void Stop(TRequestStatus& aStatus);
       
    52 	void GetDescriptorInfo(TUsbDescriptor& aDescriptorInfo) const;
       
    53 
       
    54 private:
       
    55 	enum TSynchronicity 
       
    56 		{
       
    57 		EUndefined = 0,
       
    58 		ESynchronous,
       
    59 		EAsynchronous,
       
    60 		ENever,
       
    61 		};
       
    62 	
       
    63 	NONSHARABLE_STRUCT( TBehaviour )
       
    64 	/** 
       
    65 	 * Defines the behaviour for a startup or a shutdown.
       
    66 	 */
       
    67 		{
       
    68 		TSynchronicity iSynchronicity;
       
    69 		TTimeIntervalMicroSeconds32 iDelay;
       
    70 		TInt iErrorCode;
       
    71 		};
       
    72 
       
    73 private: // utility
       
    74 	void GetConfig();
       
    75 	void DoGetConfigL();
       
    76 
       
    77 private: // unowned
       
    78 	TRequestStatus* iReportStatus;
       
    79 
       
    80 private: // owned
       
    81 	RTimer iTimer;
       
    82 	const TUint iIndex;
       
    83 	RProperty iProperty;
       
    84 	TBool     iPropertyExist;
       
    85 	TBehaviour iStartupBehaviour;
       
    86 	TBehaviour iShutdownBehaviour;
       
    87 	};
       
    88 
       
    89 #endif // CUSBDUMMYCLASSCONTROLLER_H__