usbengines/usbwatcher/inc/tusbindicatorhandler.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     1 /*
       
     2 * Copyright (c) 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:  Header file for class TUsbIndicatorHandler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TUSBINDICATORHANDLER_H
       
    20 #define TUSBINDICATORHANDLER_H
       
    21 
       
    22 #include <bldvariant.hrh>
       
    23 #include <usbstates.h>
       
    24 
       
    25 
       
    26 /**
       
    27 *  USB indicator handler class for device side.
       
    28 *
       
    29 *  This class shows USB indicator when device state changes to Configured, 
       
    30 *  and hides USB indicator when device leaves Configured state. Suspended 
       
    31  * state does not change the indicator.
       
    32 *
       
    33 *  @since TB9.2
       
    34 */
       
    35 NONSHARABLE_CLASS( TUsbIndicatorHandler )
       
    36     {
       
    37 
       
    38 public:
       
    39     /**
       
    40      * Constructor
       
    41      */
       
    42     TUsbIndicatorHandler();
       
    43     
       
    44 	/**
       
    45      * Set USB indicator (On/Off, maybe more in future) according to 
       
    46      * the change of USB device state
       
    47      *
       
    48      * @param aStateOld previous USB device state
       
    49      * @param aStateNew current USB device state
       
    50      */
       
    51     void HandleDeviceStateChange( TUsbDeviceState aStateOld, 
       
    52             TUsbDeviceState aStateNew );
       
    53             
       
    54 private:
       
    55 	/**
       
    56      * Show USB indicator (On/Off, maybe more in future)
       
    57      *
       
    58      * @since TB9.2
       
    59      * @param aUsbIndicatorState the state of the indicator, 0: OFF, 1: ON
       
    60      */
       
    61     void ShowUsbIndicator( TInt aUsbIndicatorState );
       
    62 	
       
    63 private:
       
    64     /**
       
    65      * The device state before suspend.
       
    66      * Used to filter out suspend from others;
       
    67      */
       
    68     TUsbDeviceState iDevStateB4Suspend;
       
    69     
       
    70     /////////////////////////////////////////////////////////////////////////
       
    71     // Test code
       
    72     friend class CtTUsbIndicatorHandler;
       
    73     TBool iUsbIndicator; 
       
    74     // 
       
    75     /////////////////////////////////////////////////////////////////////////
       
    76      
       
    77     };
       
    78     
       
    79 
       
    80 #endif   // TUSBINDICATORHANDLER_H
       
    81 
       
    82 // End of File