usbengines/usbotgwatcher/inc/cusbstatehostainitiate.h
changeset 0 1e05558e2206
child 6 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_USBSTATEHOSTAINITIATE_H
       
    20 #define C_USBSTATEHOSTAINITIATE_H
       
    21 
       
    22 #include "cusbotgwatcher.h"
       
    23 #include "cusbstatehostainitiatebase.h"
       
    24 #ifndef STIF
       
    25 #include "cusbtimer.h"
       
    26 #else
       
    27 #include "mockcusbtimer.h"
       
    28 #endif
       
    29 
       
    30 /**
       
    31  *  This class implements behaviour when Id pin just detected (initiating host role, loading drivers)
       
    32  *
       
    33  */
       
    34 NONSHARABLE_CLASS( CUsbStateHostAInitiate ) : public CUsbStateHostAInitiateBase
       
    35     {
       
    36     friend class CtUsbOtgWatcher;
       
    37 
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      * @param aWatcher owner
       
    43      */
       
    44     static CUsbStateHostAInitiate* NewL(CUsbOtgWatcher* aWatcher);
       
    45 
       
    46     /**
       
    47      * Destructor.
       
    48      */
       
    49     virtual ~CUsbStateHostAInitiate();
       
    50 
       
    51 private:
       
    52 
       
    53     /**
       
    54      * default construction
       
    55      * @param aWatcher owner
       
    56      */
       
    57     CUsbStateHostAInitiate(CUsbOtgWatcher* aWatcher);
       
    58 
       
    59     /**
       
    60      * 2nd phase construction
       
    61      */
       
    62     void ConstructL();
       
    63 
       
    64     //from CUsbState
       
    65     /**
       
    66      * state id
       
    67      * @return state id
       
    68      */
       
    69     TUsbStateIds Id();
       
    70 
       
    71     /**
       
    72      * This is called when switched to this state, 
       
    73      * because If all conditions for transition to another state exist, nothing will 
       
    74      * trigger it and transition will not happen. This forces the transition in such cases.
       
    75      *
       
    76      */
       
    77     void JustAdvancedToThisStateL();
       
    78     
       
    79     /**
       
    80      * This is called when switched to this state, 
       
    81      * because If all conditions for transition to another state exist, nothing will 
       
    82      * trigger it and transition will not happen. This forces the transition in such cases.
       
    83      *
       
    84      */
       
    85     virtual void JustBeforeLeavingThisStateL();
       
    86 
       
    87     };
       
    88 
       
    89 #endif //  C_USBSTATEHOSTINITIATE_H