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