usbmgmt/usbmgr/usbman/server/INC/cusbhost.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2008-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 "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  @file
       
    20  @internalComponent
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef CUSBHOST_H
       
    25 #define CUSBHOST_H
       
    26 
       
    27 #include "usbhoststack.h"
       
    28 #include "musbotghostnotifyobserver.h"
       
    29 #include "musbinternalobservers.h"
       
    30 #include "cusbhostwatcher.h"
       
    31 
       
    32 NONSHARABLE_CLASS(CUsbHost) : public CBase, public MUsbHostObserver
       
    33 	{
       
    34 public:
       
    35 	static CUsbHost* NewL();
       
    36 	virtual ~CUsbHost();
       
    37 
       
    38 private:
       
    39 	CUsbHost();
       
    40 	void ConstructL();
       
    41 
       
    42 private:
       
    43 	static CUsbHost* iInstance;
       
    44 	
       
    45 public:
       
    46 	void StartL();
       
    47 	void Stop();
       
    48 	void RegisterObserverL(MUsbOtgHostNotifyObserver& aObserver);
       
    49 	void DeregisterObserver(MUsbOtgHostNotifyObserver& aObserver);
       
    50 	TInt GetProductStringDescriptor(TUint aDeviceId,TUint aLangId,TName& aString);
       
    51 	TInt GetSupportedLanguages(TUint aDeviceId,RArray<TUint>& aLangIds);
       
    52 	TInt GetManufacturerStringDescriptor(TUint aDeviceId,TUint aLangId,TName& aString);
       
    53 	TInt GetOtgDescriptor(TUint aDeviceId, TOtgDescriptor& otgDescriptor);
       
    54 	TInt EnableDriverLoading();
       
    55 	void DisableDriverLoading();
       
    56 
       
    57 public:
       
    58 	// MUsbHostObserver
       
    59 	virtual void NotifyHostEvent(TUint aWatcherId);
       
    60 
       
    61 private:
       
    62 
       
    63 	void UpdateNumOfObservers();
       
    64 
       
    65 private:
       
    66 	TBool iHasBeenStarted;
       
    67 
       
    68 	CActiveUsbHostWatcher* iUsbHostWatcher[2];
       
    69 	TDeviceEventInformation iHostEventInfo;
       
    70 	TInt iHostMessage;
       
    71 	RUsbHostStack iUsbHostStack;
       
    72 	RPointerArray<MUsbOtgHostNotifyObserver> iObservers;
       
    73 	TUint iNumOfObservers;
       
    74 	};
       
    75 
       
    76 #endif //CUSBHOST_H