usbengines/usbotgwatcher/inc/cusbstatehostahost.h
changeset 0 1e05558e2206
child 20 a15c582fbf97
equal deleted inserted replaced
-1:000000000000 0:1e05558e2206
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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:  Implementation of the concret state
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_USBSTATEHOSTAHOST_H
       
    20 #define C_USBSTATEHOSTAHOST_H
       
    21 
       
    22 #include "cusbotgwatcher.h"
       
    23 #include "cusbstatehostabase.h"
       
    24 #ifndef STIF
       
    25 #include "cusbtimer.h"
       
    26 #else
       
    27 #include "mockcusbtimer.h"
       
    28 #endif
       
    29 
       
    30 /**
       
    31  *  This class implements behaviour in Host state (Drivers loaded, device is in Host role)
       
    32  *
       
    33  */
       
    34 NONSHARABLE_CLASS( CUsbStateHostAHost ) : public CUsbStateHostABase
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Two-phased constructor.
       
    40      * @param aWatcher Owner
       
    41      */
       
    42     static CUsbStateHostAHost* NewL(CUsbOtgWatcher* aWatcher);
       
    43 
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     virtual ~CUsbStateHostAHost();
       
    48 
       
    49 private:
       
    50 
       
    51     /**
       
    52      * Default construction
       
    53      * @param aWatcher owner
       
    54      */
       
    55     CUsbStateHostAHost(CUsbOtgWatcher* aWatcher);
       
    56 
       
    57     /**
       
    58      * 2nd phase construction
       
    59      */
       
    60     void ConstructL();
       
    61 
       
    62     //from CUsbState
       
    63     /**
       
    64      * State id
       
    65      * @return state id
       
    66      */
       
    67     TUsbStateIds Id();
       
    68 
       
    69     /**
       
    70      * This is called when switched to this state, 
       
    71      * because If all conditions for transition to another state exist, nothing will 
       
    72      * trigger it and transition will not happen. This forces the transition in such cases.
       
    73      *
       
    74      */
       
    75     void JustAdvancedToThisStateL();
       
    76 
       
    77     /**
       
    78      * State machine calls this, state object to perform any initial  
       
    79      * activity, just before leaving this state
       
    80      *
       
    81      */
       
    82     void JustBeforeLeavingThisStateL();
       
    83 
       
    84     // From OTG state observer
       
    85     /**
       
    86      * Became a Host when A
       
    87      */
       
    88     void AHostL();
       
    89 
       
    90     /**
       
    91      * Became a Peripheral when A
       
    92      */
       
    93     void APeripheralL();
       
    94     
       
    95     // From Host Event notification observer
       
    96     /**
       
    97      * Device is detached
       
    98      * @param aInfo Device event data
       
    99      */
       
   100     void DeviceDetachedL(TDeviceEventInformation aInfo);
       
   101 
       
   102     // From message notification observer
       
   103     /**
       
   104      * Connected to hub in wrong level 
       
   105      */
       
   106     void BadHubPositionL();
       
   107 
       
   108 private:
       
   109     // data
       
   110     };
       
   111 
       
   112 #endif //  C_USBSTATEHOSTAHOST_H