usbengines/usbotgwatcher/inc/cusbstatehostdelaynotattachedhandle.h
changeset 35 9d8b04ca6939
child 63 ef2686f7597e
equal deleted inserted replaced
34:7858bc6ead78 35:9d8b04ca6939
       
     1 /*
       
     2  * Copyright (c) 2008 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:  Implements concrete state
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef C_USBSTATEHOSTDELAYANOTTTACHEDHANDLE_H
       
    19 #define C_USBSTATEHOSTDELAYNOTATTACHEDHANDLE_H
       
    20 
       
    21 #include "cusbstatehostdelayhandle.h"
       
    22 
       
    23 #ifndef STIF
       
    24 #include "cusbtimer.h"
       
    25 #else
       
    26 #include "mockcusbtimer.h"
       
    27 #endif
       
    28 
       
    29 class CUsbOtgWatcher;
       
    30 /**
       
    31  *  problem handling, device is not attached, vbus not dropping
       
    32  *
       
    33  */
       
    34 NONSHARABLE_CLASS( CUsbStateHostDelayNotAttachedHandle ) : public CUsbStateHostDelayHandle,
       
    35 MUsbTimerObserver
       
    36     {
       
    37     friend class CtUsbOtgWatcher;
       
    38     friend class CUsbOtgWatcher;
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      * @param aWatcher owner
       
    45      */
       
    46     static CUsbStateHostDelayNotAttachedHandle* NewL(CUsbOtgWatcher& aWatcher);
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     virtual ~CUsbStateHostDelayNotAttachedHandle();
       
    52 
       
    53 private:
       
    54 
       
    55     // From MUsbTimerObserver
       
    56     /**
       
    57      * Call back when timer expired
       
    58      * @param aTimerId timer id
       
    59      */
       
    60     void TimerElapsedL(TUsbTimerId aTimerId);
       
    61 
       
    62     /**
       
    63      * Device is detached
       
    64      * @param aInfo Device event data
       
    65      */
       
    66     void DeviceDetachedL(TDeviceEventInformation aInfo);
       
    67 
       
    68     // From OTG state observer
       
    69     /**
       
    70      * Became to Idle when A
       
    71      */
       
    72     void AIdleL();
       
    73 
       
    74     //from CUsbState
       
    75     /**
       
    76      * State id
       
    77      * @return state id
       
    78      */
       
    79     TUsbStateIds Id();
       
    80 
       
    81     /**
       
    82      * This is called when leaving this state, 
       
    83      *
       
    84      */
       
    85     void JustBeforeLeavingThisStateL();
       
    86 
       
    87     /**
       
    88      * handles issue
       
    89      */
       
    90     void DoHandleL();
       
    91 
       
    92     /**
       
    93      * Default constructor
       
    94      * @param aWatcher owner
       
    95      */
       
    96     CUsbStateHostDelayNotAttachedHandle(CUsbOtgWatcher& aWatcher);
       
    97 
       
    98     /**
       
    99      * 2nd phase construction
       
   100      */
       
   101     void ConstructL();
       
   102 
       
   103     // data
       
   104 
       
   105     /** 
       
   106      * too much power timer
       
   107      * own
       
   108      */
       
   109     CUsbTimer* iTooMuchPowerTimer;
       
   110 
       
   111     };
       
   112 
       
   113 #endif //  C_USBSTATEHOSTDELAYNOTATTACHEDHANDLE_H