|
1 /* |
|
2 * Copyright (c) 2009-2010 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 CUsbIndicatorHandler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CUSBINDICATORHANDLER_H |
|
20 #define CUSBINDICATORHANDLER_H |
|
21 |
|
22 #include <bldvariant.hrh> |
|
23 #include <usbstates.h> |
|
24 #include <e32std.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 class CHbIndicatorSymbian; |
|
28 class CHbSymbianVariant; |
|
29 |
|
30 /** |
|
31 * USB indicator handler class for device side. |
|
32 * |
|
33 * This class shows USB indicator when device state changes to Configured, |
|
34 * and hides USB indicator when device leaves Configured state. Suspended |
|
35 * state does not change the indicator. |
|
36 * |
|
37 * @since TB9.2 |
|
38 */ |
|
39 NONSHARABLE_CLASS( CUsbIndicatorHandler ) : public CBase |
|
40 { |
|
41 friend class CtTUsbIndicatorHandler; |
|
42 |
|
43 public: |
|
44 // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CUsbIndicatorHandler(); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 */ |
|
54 static CUsbIndicatorHandler* NewL(); |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 */ |
|
59 static CUsbIndicatorHandler* NewLC(); |
|
60 |
|
61 private: |
|
62 |
|
63 /** |
|
64 * Constructor for performing 1st stage construction |
|
65 */ |
|
66 CUsbIndicatorHandler(); |
|
67 |
|
68 /** |
|
69 * EPOC default constructor for performing 2nd stage construction |
|
70 */ |
|
71 void ConstructL(); |
|
72 |
|
73 |
|
74 public: |
|
75 |
|
76 /** |
|
77 * Set USB indicator (On/Off, maybe more in future) according to |
|
78 * the change of USB device state |
|
79 * |
|
80 * @param aStateOld previous USB device state |
|
81 * @param aStateNew current USB device state |
|
82 */ |
|
83 void HandleDeviceStateChangeL( TUsbDeviceState aStateOld, |
|
84 TUsbDeviceState aStateNew, TInt aPersonality ); |
|
85 |
|
86 private: |
|
87 /** |
|
88 * Show USB connected indicator (On/Off, maybe more in future) |
|
89 * |
|
90 * @since TB9.2 |
|
91 * @param aActivate activate or deactivate the indicator |
|
92 * @param aPersonality the personality id |
|
93 */ |
|
94 void ShowUsbConnectedIndicatorL( TBool aActivate, TInt aPersonality ); |
|
95 |
|
96 /** |
|
97 * Show USB addressed state indicator (On/Off, maybe more in future) |
|
98 * |
|
99 * @since TB9.2 |
|
100 * @param aActivate activate or deactivate the indicator |
|
101 */ |
|
102 void ShowUsbAddressedIndicator( TBool aActivate ); |
|
103 |
|
104 private: |
|
105 /** |
|
106 * The device state before suspend. |
|
107 * Used to filter out suspend from others; |
|
108 */ |
|
109 TUsbDeviceState iDevStateB4Suspend; |
|
110 |
|
111 CHbIndicatorSymbian* iSymbianIndicator; |
|
112 |
|
113 CHbSymbianVariant* iIndicatorParameters; |
|
114 |
|
115 // remember whether indicators are active or not |
|
116 // simplifies little bit the state handling in HandleDeviceStateChange |
|
117 TBool iAddressedIndicatorActive; |
|
118 TBool iConnectedIndicatorActive; |
|
119 |
|
120 }; |
|
121 |
|
122 |
|
123 #endif // CUSBINDICATORHANDLER_H |
|
124 |
|
125 // End of File |