|
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: Blink/show Usb indicator notifier implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_USBINDICATORNOTIFIER_H |
|
20 #define C_USBINDICATORNOTIFIER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <AknNotifyStd.h> // SAknSmallIndicatorParams |
|
24 #include <AknNotifySignature.h> // SAknNotifierPackage |
|
25 #include <avkon.hrh> // EAknIndicatorUSBConnection |
|
26 #include "cusbtimer.h" |
|
27 #include "cusbnotifier.h" |
|
28 |
|
29 |
|
30 /** |
|
31 * Class implements functionality of showing/blinking usb indicator |
|
32 * Class does not provide method to get response from the user |
|
33 */ |
|
34 NONSHARABLE_CLASS( CUsbIndicatorNotifier ): public CUsbNotifier, MUsbTimerObserver |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * @param aNotifManager Owner of the class, will destroy the object when needed |
|
40 * @return Pointer to the new instance of CUsbIndicatorNotifier |
|
41 */ |
|
42 static CUsbIndicatorNotifier* NewL(CUsbNotifManager* aNotifManager); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 virtual ~CUsbIndicatorNotifier(); |
|
48 |
|
49 /** |
|
50 * Show/hide static icon of the indicator. |
|
51 * If the indicator is blinking, stop blinking it and show/hide the static |
|
52 * form of the indicator. |
|
53 * @param aVisible ETrue - Show the indicator, EFalse - Hide the indicator |
|
54 */ |
|
55 void ShowIndicatorL(TBool aVisible); |
|
56 |
|
57 // From base class CUsbNotifier |
|
58 /** |
|
59 * Start to show notifier |
|
60 */ |
|
61 virtual void ShowL(); |
|
62 |
|
63 /** |
|
64 * Stop showing notifier |
|
65 */ |
|
66 virtual void Close(); |
|
67 |
|
68 // From MUsbTimerObserver |
|
69 /** |
|
70 * Timer elapsed |
|
71 * @param Timer id |
|
72 */ |
|
73 void TimerElapsedL(TUsbTimerId aTimerId); |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * Default constructor. |
|
79 * @param aNotifManager Owner |
|
80 */ |
|
81 CUsbIndicatorNotifier(CUsbNotifManager* aNotifManager); |
|
82 |
|
83 /** |
|
84 * 2nd phase constructor. |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 /** |
|
89 * Set USB indicator On or Off |
|
90 * @param aState Indicator states |
|
91 */ |
|
92 void SetIndicatorStateL(const TInt aState); |
|
93 |
|
94 private: |
|
95 // data |
|
96 |
|
97 /** |
|
98 * Switch timer for showing/hiding the usb indicator interleavingly for |
|
99 * animating the indicator. |
|
100 * Own |
|
101 */ |
|
102 CUsbTimer* iIconBlinkingTimer; |
|
103 |
|
104 /** |
|
105 * Current indicator state |
|
106 */ |
|
107 TInt iIndicatorState; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // C_USBINDICATORNOTIFIER_H |