usbengines/usbotgwatcher/inc/cusbstatehosthandledropping.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     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_USBSTATEHOSTHANDLEDROPPING_H
       
    19 #define C_USBSTATEHOSTHANDLEDROPPING_H
       
    20 
       
    21 #include "cusbstatehosthandle.h"
       
    22 
       
    23 #ifndef STIF
       
    24 #include "cusbnotifmanager.h"
       
    25 #else
       
    26 #include "mockcusbnotifmanager.h"
       
    27 #endif
       
    28 
       
    29 class CUsbOtgWatcher;
       
    30 
       
    31 /**
       
    32  *  problem handling class, dropping vbus
       
    33  *
       
    34  */
       
    35 NONSHARABLE_CLASS( CUsbStateHostHandleDropping ) : public CUsbStateHostHandle,
       
    36 MWaitNotifierObserver
       
    37 // this means only one wait notifier at a time can be shown by this state, might be redesigned
       
    38 
       
    39     {
       
    40     friend class CtUsbOtgWatcher;
       
    41     friend class CUsbOtgWatcher;
       
    42 
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      * @param aWatcher owner
       
    48      */
       
    49     static CUsbStateHostHandleDropping* NewL(CUsbOtgWatcher& aWatcher);
       
    50 
       
    51     /**
       
    52      * Destructor.
       
    53      */
       
    54     virtual ~CUsbStateHostHandleDropping();
       
    55 
       
    56 private:
       
    57 
       
    58     // from MWaitNotifierObserver
       
    59     /**
       
    60      * Callback when notifier is completed
       
    61      * @param aFeedback how notifier completed
       
    62      */
       
    63     void WaitNotifierCompletedL(TInt aFeedback);
       
    64 
       
    65     // From VBus observer
       
    66     /**
       
    67      * VBus up
       
    68      */
       
    69     void VBusUpL();
       
    70 
       
    71     /**
       
    72      * VBus down
       
    73      */
       
    74     void VBusDownL();
       
    75 
       
    76     /**
       
    77      * VBus error happen
       
    78      */
       
    79     void AVBusErrorL();
       
    80 
       
    81     // From Host Event notification observer
       
    82     /**
       
    83      * Device is attached
       
    84      * @param aInfo Device event data
       
    85      */
       
    86     void DeviceAttachedL(TDeviceEventInformation aInfo);
       
    87 
       
    88     /**
       
    89      * Device is detached
       
    90      * @param aInfo Device event data
       
    91      */
       
    92     void DeviceDetachedL(TDeviceEventInformation aInfo);
       
    93 
       
    94     /**
       
    95      * Drivers successfully loaded
       
    96      * @param aInfo Device event data
       
    97      */
       
    98     void DriverLoadSuccessL(TDeviceEventInformation aInfo);
       
    99 
       
   100     /**
       
   101      * Drivers loaded partially
       
   102      * @param aInfo Device event data
       
   103      */
       
   104     void DriverLoadPartialSuccessL(TDeviceEventInformation aInfo);
       
   105 
       
   106     /**
       
   107      * Drivers loading failed
       
   108      * @param aInfo Device event data
       
   109      */
       
   110     void DriverLoadFailureL(TDeviceEventInformation aInfo);
       
   111 
       
   112     // From message notification observer
       
   113     /**
       
   114      * Message received
       
   115      * @param aMessage message id
       
   116      */
       
   117     void MessageNotificationReceivedL(TInt aMessage);
       
   118 
       
   119     /**
       
   120      * VBus error happened
       
   121      */
       
   122     void VBusErrorL();
       
   123 
       
   124     //from CUsbState
       
   125     /**
       
   126      * State id
       
   127      * @return state id
       
   128      */
       
   129     TUsbStateIds Id();
       
   130 
       
   131     /**
       
   132      * This is called when leaving this state, 
       
   133      *
       
   134      */
       
   135     void JustBeforeLeavingThisStateL();
       
   136 
       
   137     /**
       
   138      * handles issue
       
   139      */
       
   140     void DoHandleL();
       
   141 
       
   142     /**
       
   143      * Default constructor
       
   144      * @param aWatcher owner
       
   145      */
       
   146     CUsbStateHostHandleDropping(CUsbOtgWatcher& aWatcher);
       
   147 
       
   148     /**
       
   149      * 2nd phase construction
       
   150      */
       
   151     void ConstructL();
       
   152 
       
   153     };
       
   154 
       
   155 #endif //  C_USBSTATEHOSTDROPPINGHANDLE_H