1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/src/cusbotgwatcher.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,108 @@
1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +#ifndef CUSBOTGWATCHER_H
1.21 +#define CUSBOTGWATCHER_H
1.22 +
1.23 +
1.24 +class CUsbOtg;
1.25 +
1.26 +class CUsbOtgBaseWatcher : public CActive
1.27 + {
1.28 +public:
1.29 + CUsbOtgBaseWatcher(RUsbOtgDriver& aLdd);
1.30 + virtual ~CUsbOtgBaseWatcher();
1.31 +
1.32 + // From CActive
1.33 + virtual void RunL() = 0;
1.34 + virtual void DoCancel() = 0;
1.35 +
1.36 + virtual void Start();
1.37 +
1.38 +protected:
1.39 + virtual void Post() = 0;
1.40 +
1.41 +protected:
1.42 + RUsbOtgDriver& iLdd;
1.43 + };
1.44 +
1.45 +
1.46 +
1.47 +
1.48 +const TUid KUidUsbManCategory = {0x101fe1db};
1.49 +
1.50 +enum TUsbManPropertyKeys
1.51 + {
1.52 + KUsbRequestSessionProperty = 6
1.53 + };
1.54 +
1.55 +enum TUsbManSessionState
1.56 + {
1.57 + KUsbManSessionOpen = 0x1,
1.58 + KUsbManSessionClose
1.59 + };
1.60 +
1.61 +
1.62 +
1.63 +
1.64 +class CRequestSessionWatcher: public CActive
1.65 + {
1.66 +public:
1.67 + static CRequestSessionWatcher* NewL(MUsbRequestSessionObserver& aObserver);
1.68 + ~CRequestSessionWatcher();
1.69 +private:
1.70 + CRequestSessionWatcher(MUsbRequestSessionObserver& aObserver);
1.71 + void ConstructL();
1.72 +
1.73 +private:
1.74 + void RunL();
1.75 + void DoCancel();
1.76 + TInt RunError(TInt aError);
1.77 + //void StartRequestSession();
1.78 +
1.79 +private:
1.80 + MUsbRequestSessionObserver& iObserver;
1.81 + RProperty iProperty;
1.82 + };
1.83 +
1.84 +
1.85 +
1.86 +class CUsbOtgEventWatcher: public CUsbOtgBaseWatcher
1.87 + {
1.88 +public:
1.89 + static CUsbOtgEventWatcher* NewL(RUsbOtgDriver& aLdd,
1.90 + CUsbOtg& iUsbOtg);
1.91 + ~CUsbOtgEventWatcher();
1.92 +private:
1.93 + CUsbOtgEventWatcher(RUsbOtgDriver& aLdd,
1.94 + CUsbOtg& iUsbOtg);
1.95 + void ConstructL();
1.96 +
1.97 +protected:
1.98 + void Post();
1.99 +
1.100 +private:
1.101 + void RunL();
1.102 + void DoCancel();
1.103 + TInt RunError(TInt aError);
1.104 +
1.105 +private:
1.106 + RUsbOtgDriver::TOtgEvent iEvent;
1.107 +
1.108 + CUsbOtg& iUsbOtg;
1.109 + };
1.110 +
1.111 +#endif