usbengines/usbotgwatcher/inc/cusbstatehostahost.h
branchRCL_3
changeset 65 a44cdf4b4bf0
parent 0 1e05558e2206
child 21 ff9df6630274
equal deleted inserted replaced
64:8ecef05bbada 65:a44cdf4b4bf0
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     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  *
     8  *
    16 */
     9  * Initial Contributors:
    17 
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Implementation of the concret state
       
    15  *
       
    16  */
    18 
    17 
    19 #ifndef C_USBSTATEHOSTAHOST_H
    18 #ifndef C_USBSTATEHOSTAHOST_H
    20 #define C_USBSTATEHOSTAHOST_H
    19 #define C_USBSTATEHOSTAHOST_H
    21 
    20 
    22 #include "cusbotgwatcher.h"
       
    23 #include "cusbstatehostabase.h"
    21 #include "cusbstatehostabase.h"
    24 #ifndef STIF
    22 
    25 #include "cusbtimer.h"
    23 class CUsbOtgWatcher;
    26 #else
       
    27 #include "mockcusbtimer.h"
       
    28 #endif
       
    29 
    24 
    30 /**
    25 /**
    31  *  This class implements behaviour in Host state (Drivers loaded, device is in Host role)
    26  *  This class implements behaviour in Host state (Drivers loaded, device is in Host role)
    32  *
    27  *
    33  */
    28  */
    37 
    32 
    38     /**
    33     /**
    39      * Two-phased constructor.
    34      * Two-phased constructor.
    40      * @param aWatcher Owner
    35      * @param aWatcher Owner
    41      */
    36      */
    42     static CUsbStateHostAHost* NewL(CUsbOtgWatcher* aWatcher);
    37     static CUsbStateHostAHost* NewL(CUsbOtgWatcher& aWatcher);
    43 
    38 
    44     /**
    39     /**
    45      * Destructor.
    40      * Destructor.
    46      */
    41      */
    47     virtual ~CUsbStateHostAHost();
    42     virtual ~CUsbStateHostAHost();
    50 
    45 
    51     /**
    46     /**
    52      * Default construction
    47      * Default construction
    53      * @param aWatcher owner
    48      * @param aWatcher owner
    54      */
    49      */
    55     CUsbStateHostAHost(CUsbOtgWatcher* aWatcher);
    50     CUsbStateHostAHost(CUsbOtgWatcher& aWatcher);
    56 
    51 
    57     /**
    52     /**
    58      * 2nd phase construction
    53      * 2nd phase construction
    59      */
    54      */
    60     void ConstructL();
    55     void ConstructL();
    70      * This is called when switched to this state, 
    65      * This is called when switched to this state, 
    71      * because If all conditions for transition to another state exist, nothing will 
    66      * 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.
    67      * trigger it and transition will not happen. This forces the transition in such cases.
    73      *
    68      *
    74      */
    69      */
    75     void JustAdvancedToThisStateL();
    70     virtual void JustAdvancedToThisStateL();
    76 
    71 
    77     /**
    72     /**
    78      * State machine calls this, state object to perform any initial  
    73      * State machine calls this, state object to perform any initial  
    79      * activity, just before leaving this state
    74      * activity, just before leaving this state
    80      *
    75      *
    81      */
    76      */
    82     void JustBeforeLeavingThisStateL();
    77     virtual void JustBeforeLeavingThisStateL();
    83 
    78 
    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
    79     // From Host Event notification observer
    96     /**
    80     /**
    97      * Device is detached
    81      * Device is detached
    98      * @param aInfo Device event data
    82      * @param aInfo Device event data
    99      */
    83      */
   100     void DeviceDetachedL(TDeviceEventInformation aInfo);
    84     virtual void DeviceDetachedL(TDeviceEventInformation aInfo);
   101 
    85 
   102     // From message notification observer
    86     // From message notification observer
   103     /**
    87     /**
   104      * Connected to hub in wrong level 
    88      * Connected to hub in wrong level 
   105      */
    89      */
   106     void BadHubPositionL();
    90     virtual void BadHubPositionL();
   107 
    91 
   108 private:
    92 private:
   109     // data
    93     // data
   110     };
    94     };
   111 
    95