1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_USBNOTIFMANAGER_H |
|
19 #define C_USBNOTIFMANAGER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 #include <StifTestModule.h> |
|
24 #include <StifLogger.h> |
|
25 |
|
26 #include "tassertbase.h" |
|
27 #include "cusbnotifier.h" |
|
28 #include "cusbwarningnotifier.h" |
|
29 #include "cusbotgwatcher.h" |
|
30 |
|
31 #define INVALID_VALUE NULL |
|
32 |
|
33 // forward declaration |
|
34 class CUsbWaitNotifier; |
|
35 class CUsbNotifier; |
|
36 |
|
37 class MWaitNotifierObserver |
|
38 { |
|
39 public: |
|
40 |
|
41 // feedback to observer |
|
42 virtual void WaitNotifierCompletedL(TInt aFeedback) = 0; |
|
43 }; |
|
44 |
|
45 /** |
|
46 * Function of the class is own and share RNotifier, own list of CWaitNotifier(s), |
|
47 * show notifiers, which are synchronous, and cancel it with a delay |
|
48 * |
|
49 * @lib ?library |
|
50 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
51 */ |
|
52 class CUsbNotifManager : public TAssertBase |
|
53 { |
|
54 friend class CtUsbOtgWatcher; |
|
55 friend class CUsbOtgWatcherTest; |
|
56 |
|
57 public: |
|
58 static CUsbNotifManager* NewL(CUsbOtgWatcher& aOtgWatcher); |
|
59 |
|
60 virtual ~CUsbNotifManager(); |
|
61 |
|
62 void ShowNotifierL(TUid aCat, TUint aNotifId, MWaitNotifierObserver* aObserver = NULL ); |
|
63 |
|
64 void BlinkIndicatorL(TBool aBlinking = ETrue); |
|
65 |
|
66 void ShowIndicatorL(TBool aVisible = ETrue); |
|
67 |
|
68 void CloseAllNotifiers(); |
|
69 |
|
70 TBool GetUsbIconBlinking() { return iUsbIconBlinking; }; |
|
71 |
|
72 private: |
|
73 |
|
74 CUsbNotifManager(); |
|
75 |
|
76 void ConstructL(); |
|
77 |
|
78 // call back. Notifier show is over |
|
79 void NotifierShowCompletedL(CUsbNotifier& aWaitNotifier, TInt aResult, TInt aFeedback); |
|
80 |
|
81 private: // data |
|
82 TUid iCat; |
|
83 TUint iNotifId; |
|
84 MWaitNotifierObserver* iObserver; |
|
85 |
|
86 TBool iUsbIconBlinking; |
|
87 TBool iUsbIconShown; |
|
88 }; |
|
89 |
|
90 #endif // C_USBNOTIFMANAGER_H |
|