usbengines/usbotgwatcher/inc/cusbindicatornotifier.h
branchRCL_3
changeset 80 e02eb84a14d2
parent 79 25fce757be94
equal deleted inserted replaced
79:25fce757be94 80:e02eb84a14d2
     1 /*
     1 /*
     2  * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 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".
    17 
    17 
    18 #ifndef C_USBINDICATORNOTIFIER_H
    18 #ifndef C_USBINDICATORNOTIFIER_H
    19 #define C_USBINDICATORNOTIFIER_H
    19 #define C_USBINDICATORNOTIFIER_H
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
       
    22 #include <AknNotifyStd.h>       // SAknSmallIndicatorParams
       
    23 #include <AknNotifySignature.h> // SAknNotifierPackage
       
    24 #include <avkon.hrh>            // EAknIndicatorUSBConnection
    22 
    25 
    23 #include "cusbnotifier.h"
    26 #include "cusbnotifier.h"
    24 #include "cusbvbusobserver.h"
    27 #include "cusbvbusobserver.h"
    25 #include "cusbotgwatcher.h"
    28 #include "cusbotgwatcher.h"
    26 
    29 
    27 class CHbIndicatorSymbian;
       
    28 
       
    29 _LIT(KUsbConnectingIndicator, "com.nokia.hb.indicator.usb.device.inprogress/1.0");  
       
    30 
       
    31 // indicator states
       
    32 enum  
       
    33     {
       
    34     EIndicatorStateOff,
       
    35     EIndicatorStateOn,
       
    36     EIndicatorConnecting
       
    37     };
       
    38   
       
    39 /**
    30 /**
    40  * Class implements functionality of showing/blinking usb indicator
    31  * Class implements functionality of showing/blinking usb indicator
    41  * Class does not provide method to get response from the user
    32  * Class does not provide method to get response from the user
    42  */
    33  */
    43 NONSHARABLE_CLASS( CUsbIndicatorNotifier ): public MUsbOtgWatcherStateObserver, MUsbVBusObserver
    34 NONSHARABLE_CLASS( CUsbIndicatorNotifier ): public CUsbNotifier, MUsbOtgWatcherStateObserver, MUsbVBusObserver
    44     {
    35     {
    45 
       
    46     friend class CtUsbOtgWatcher;
       
    47     
       
    48 public:
    36 public:
    49     /**
    37     /**
    50      * Two-phased constructor.
    38      * Two-phased constructor.
    51      * @param aNotifManager parent
    39      * @param aNotifManager parent
    52      * @param aOtgWatcher provides VBus observer and usb otg watcher state notifications
    40      * @param aOtgWatcher provides VBus observer and usb otg watcher state notifications
    79      * error handler
    67      * error handler
    80      * @param aError error code
    68      * @param aError error code
    81      */
    69      */
    82     virtual void VBusObserverErrorL(TInt aError);
    70     virtual void VBusObserverErrorL(TInt aError);
    83 
    71 
       
    72     // From base class CUsbNotifier
       
    73     /**
       
    74      * Start to show notifier
       
    75      */
       
    76     virtual void ShowL();
       
    77 
    84     /**
    78     /**
    85      * Stop showing notifier
    79      * Stop showing notifier
    86      */
    80      */
    87     virtual void Close();
    81     virtual void Close();
    88 
    82 
    99      * 2nd phase constructor.
    93      * 2nd phase constructor.
   100      */
    94      */
   101     void ConstructL();
    95     void ConstructL();
   102 
    96 
   103     /**
    97     /**
   104      * Set USB Connecting indicator On or Off
    98      * Set USB indicator On or Off
   105      * @param aState Indicator states 
    99      * @param aState Indicator states 
   106      */
   100      */
   107     void ToggleConnectingIndicator(TBool aEnable);
   101     void SetIndicatorStateL(const TInt aState);
       
   102 
       
   103     /**
       
   104      * Show/hide static icon of the indicator. 
       
   105      * If the indicator is blinking, stop blinking it and show/hide the static 
       
   106      * form of the indicator.
       
   107      * @param aVisible ETrue - Show the indicator, EFalse - Hide the indicator 
       
   108      */
       
   109     void ShowStaticL(TBool aVisible);
       
   110 
       
   111     /**
       
   112      * Blinks indicator
       
   113      */
       
   114     void BlinkL();
   108 
   115 
   109     /**
   116     /**
   110      * Sets indicator accordingly
   117      * Sets indicator accordingly
   111      */
   118      */
   112     void SetIndicator();
   119     void SetIndicatorL();
   113 
   120 
   114 private:
   121 private:
   115     // data
   122     // data
   116 
   123 
   117     /**
   124     /**
   118      * OtgWatcher
   125      * OtgWatcher
   119      * not own
   126      * not own
   120      */
   127      */
   121     CUsbOtgWatcher& iOtgWatcher;
   128     CUsbOtgWatcher& iOtgWatcher;
   122 
   129 
       
   130     /**
       
   131      * Current indicator state
       
   132      */
       
   133     TInt iIndicatorState;
   123 
   134 
   124     /**    
       
   125     * Pointer to a class for using Orbit indicator framework
       
   126     * Owned  
       
   127     */
       
   128     CHbIndicatorSymbian* iUsbConnectingIndicator;
       
   129     
       
   130     /**    
       
   131     * Whether we have activated the connecting indicator 
       
   132     */    
       
   133     TBool iConnectingIndicatorOn;
       
   134     };
   135     };
   135 
   136 
   136 #endif // C_USBINDICATORNOTIFIER_H
   137 #endif // C_USBINDICATORNOTIFIER_H