kerneltest/f32test/shostmassstorage/msman/src/cusbotgwatcher.h
changeset 43 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 43:96e5fb8b040d
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef CUSBOTGWATCHER_H
       
    18 #define CUSBOTGWATCHER_H
       
    19 
       
    20 
       
    21 class CUsbOtg;
       
    22 
       
    23 class CUsbOtgBaseWatcher : public CActive
       
    24 	{
       
    25 public:
       
    26 	CUsbOtgBaseWatcher(RUsbOtgDriver& aLdd);
       
    27 	virtual ~CUsbOtgBaseWatcher();
       
    28 
       
    29 	// From CActive
       
    30 	virtual void RunL() = 0;
       
    31 	virtual void DoCancel() = 0;
       
    32 
       
    33 	virtual void Start();
       
    34 
       
    35 protected:
       
    36 	virtual void Post() = 0;
       
    37 
       
    38 protected:
       
    39 	RUsbOtgDriver& iLdd;
       
    40 	};
       
    41 
       
    42 
       
    43 
       
    44 
       
    45 const TUid KUidUsbManCategory = {0x101fe1db};
       
    46 
       
    47 enum TUsbManPropertyKeys
       
    48     {
       
    49     KUsbRequestSessionProperty = 6
       
    50     };
       
    51 
       
    52 enum TUsbManSessionState
       
    53     {
       
    54     KUsbManSessionOpen = 0x1,
       
    55     KUsbManSessionClose
       
    56     };
       
    57 
       
    58 
       
    59 
       
    60 
       
    61 class CRequestSessionWatcher: public CActive
       
    62     {
       
    63 public:
       
    64     static CRequestSessionWatcher* NewL(MUsbRequestSessionObserver& aObserver);
       
    65     ~CRequestSessionWatcher();
       
    66 private:
       
    67     CRequestSessionWatcher(MUsbRequestSessionObserver& aObserver);
       
    68     void ConstructL();
       
    69 
       
    70 private:
       
    71     void RunL();
       
    72     void DoCancel();
       
    73     TInt RunError(TInt aError);
       
    74     //void StartRequestSession();
       
    75 
       
    76 private:
       
    77     MUsbRequestSessionObserver& iObserver;
       
    78     RProperty iProperty;
       
    79     };
       
    80 
       
    81 
       
    82 
       
    83 class CUsbOtgEventWatcher: public CUsbOtgBaseWatcher
       
    84     {
       
    85 public:
       
    86     static CUsbOtgEventWatcher* NewL(RUsbOtgDriver& aLdd,
       
    87                                      CUsbOtg& iUsbOtg);
       
    88     ~CUsbOtgEventWatcher();
       
    89 private:
       
    90     CUsbOtgEventWatcher(RUsbOtgDriver& aLdd,
       
    91                         CUsbOtg& iUsbOtg);
       
    92     void ConstructL();
       
    93 
       
    94 protected:
       
    95     void Post();
       
    96 
       
    97 private:
       
    98     void RunL();
       
    99     void DoCancel();
       
   100     TInt RunError(TInt aError);
       
   101 
       
   102 private:
       
   103     RUsbOtgDriver::TOtgEvent iEvent;
       
   104 
       
   105     CUsbOtg& iUsbOtg;
       
   106     };
       
   107 
       
   108 #endif