sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #ifndef CUSBOTGWATCHER_H sl@0: #define CUSBOTGWATCHER_H sl@0: sl@0: sl@0: class CUsbOtg; sl@0: sl@0: class CUsbOtgBaseWatcher : public CActive sl@0: { sl@0: public: sl@0: CUsbOtgBaseWatcher(RUsbOtgDriver& aLdd); sl@0: virtual ~CUsbOtgBaseWatcher(); sl@0: sl@0: // From CActive sl@0: virtual void RunL() = 0; sl@0: virtual void DoCancel() = 0; sl@0: sl@0: virtual void Start(); sl@0: sl@0: protected: sl@0: virtual void Post() = 0; sl@0: sl@0: protected: sl@0: RUsbOtgDriver& iLdd; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: const TUid KUidUsbManCategory = {0x101fe1db}; sl@0: sl@0: enum TUsbManPropertyKeys sl@0: { sl@0: KUsbRequestSessionProperty = 6 sl@0: }; sl@0: sl@0: enum TUsbManSessionState sl@0: { sl@0: KUsbManSessionOpen = 0x1, sl@0: KUsbManSessionClose sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: class CRequestSessionWatcher: public CActive sl@0: { sl@0: public: sl@0: static CRequestSessionWatcher* NewL(MUsbRequestSessionObserver& aObserver); sl@0: ~CRequestSessionWatcher(); sl@0: private: sl@0: CRequestSessionWatcher(MUsbRequestSessionObserver& aObserver); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: void RunL(); sl@0: void DoCancel(); sl@0: TInt RunError(TInt aError); sl@0: //void StartRequestSession(); sl@0: sl@0: private: sl@0: MUsbRequestSessionObserver& iObserver; sl@0: RProperty iProperty; sl@0: }; sl@0: sl@0: sl@0: sl@0: class CUsbOtgEventWatcher: public CUsbOtgBaseWatcher sl@0: { sl@0: public: sl@0: static CUsbOtgEventWatcher* NewL(RUsbOtgDriver& aLdd, sl@0: CUsbOtg& iUsbOtg); sl@0: ~CUsbOtgEventWatcher(); sl@0: private: sl@0: CUsbOtgEventWatcher(RUsbOtgDriver& aLdd, sl@0: CUsbOtg& iUsbOtg); sl@0: void ConstructL(); sl@0: sl@0: protected: sl@0: void Post(); sl@0: sl@0: private: sl@0: void RunL(); sl@0: void DoCancel(); sl@0: TInt RunError(TInt aError); sl@0: sl@0: private: sl@0: RUsbOtgDriver::TOtgEvent iEvent; sl@0: sl@0: CUsbOtg& iUsbOtg; sl@0: }; sl@0: sl@0: #endif