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_USBBUSACTIVITYOBSERVER_H |
|
19 #define C_USBBUSACTIVITYOBSERVER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 #include "tassertbase.h" |
|
24 |
|
25 class MUsbBusActivityObserver |
|
26 { |
|
27 public: |
|
28 |
|
29 virtual void BusIdleL() = 0; |
|
30 virtual void BusActiveL() = 0; |
|
31 }; |
|
32 |
|
33 /** |
|
34 * Class observes OTG State property, see usbotgdefs.h |
|
35 * |
|
36 * @lib ?library |
|
37 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
38 */ |
|
39 class CUsbBusActivityObserver : public TAssertBase |
|
40 { |
|
41 friend class CtUsbOtgWatcher; |
|
42 friend class CUsbOtgWatcherTest; |
|
43 |
|
44 public: |
|
45 |
|
46 enum TBusActivity |
|
47 { |
|
48 EBusIdle = 0, |
|
49 EBusActive = 1 |
|
50 }; |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @param ?arg1 ?description |
|
55 * @param ?arg2 ?description |
|
56 */ |
|
57 // ?IMPORT_C |
|
58 static CUsbBusActivityObserver* NewL(); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CUsbBusActivityObserver(); |
|
64 |
|
65 /** |
|
66 * ?description |
|
67 * |
|
68 * @since S60 ?S60_version |
|
69 * @param ?arg1 ?description |
|
70 * @param ?arg2 ?description |
|
71 * @return ?description |
|
72 */ |
|
73 // ?IMPORT_C |
|
74 TBusActivity BusActivity(); |
|
75 |
|
76 /** |
|
77 * ?description |
|
78 * |
|
79 * @since S60 ?S60_version |
|
80 * @param ?arg1 ?description |
|
81 * @param ?arg2 ?description |
|
82 * @return ?description |
|
83 */ |
|
84 void SubscribeL(MUsbBusActivityObserver&); |
|
85 |
|
86 void UnsubscribeL(MUsbBusActivityObserver&); |
|
87 |
|
88 void TriggerBusIdleL(); |
|
89 |
|
90 void TriggerBusActiveL(); |
|
91 |
|
92 private: |
|
93 |
|
94 CUsbBusActivityObserver(); |
|
95 |
|
96 void ConstructL(); |
|
97 |
|
98 private: |
|
99 // data |
|
100 |
|
101 // The observer reports state changes to own observers |
|
102 // Owns |
|
103 MUsbBusActivityObserver* iObserver; |
|
104 |
|
105 TInt iBusActivity; |
|
106 }; |
|
107 |
|
108 #endif // C_USBOTGSTATEOBSERVER_H |
|