|
1 /* |
|
2 * Copyright (c) 2008-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: Implements concrete state |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_USBSTATEHOSTHANDLEDROPPING_H |
|
19 #define C_USBSTATEHOSTHANDLEDROPPING_H |
|
20 |
|
21 #include "cusbstatehosthandle.h" |
|
22 |
|
23 #ifndef STIF |
|
24 #include "cusbnotifmanager.h" |
|
25 #else |
|
26 #include "mockcusbnotifmanager.h" |
|
27 #endif |
|
28 |
|
29 class CUsbOtgWatcher; |
|
30 |
|
31 /** |
|
32 * problem handling class, dropping vbus |
|
33 * |
|
34 */ |
|
35 NONSHARABLE_CLASS( CUsbStateHostHandleDropping ) : public CUsbStateHostHandle, |
|
36 MWaitNotifierObserver |
|
37 // this means only one wait notifier at a time can be shown by this state, might be redesigned |
|
38 |
|
39 { |
|
40 friend class CtUsbOtgWatcher; |
|
41 friend class CUsbOtgWatcher; |
|
42 |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 * @param aWatcher owner |
|
48 */ |
|
49 static CUsbStateHostHandleDropping* NewL(CUsbOtgWatcher& aWatcher); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CUsbStateHostHandleDropping(); |
|
55 |
|
56 private: |
|
57 |
|
58 // from MWaitNotifierObserver |
|
59 /** |
|
60 * Callback when notifier is completed |
|
61 * @param aFeedback how notifier completed |
|
62 */ |
|
63 void WaitNotifierCompletedL(TInt aFeedback); |
|
64 |
|
65 // From VBus observer |
|
66 /** |
|
67 * VBus up |
|
68 */ |
|
69 void VBusUpL(); |
|
70 |
|
71 /** |
|
72 * VBus down |
|
73 */ |
|
74 void VBusDownL(); |
|
75 |
|
76 // From Host Event notification observer |
|
77 /** |
|
78 * Device is attached |
|
79 * @param aInfo Device event data |
|
80 */ |
|
81 void DeviceAttachedL(TDeviceEventInformation aInfo); |
|
82 |
|
83 /** |
|
84 * Device is detached |
|
85 * @param aInfo Device event data |
|
86 */ |
|
87 void DeviceDetachedL(TDeviceEventInformation aInfo); |
|
88 |
|
89 /** |
|
90 * Drivers successfully loaded |
|
91 * @param aInfo Device event data |
|
92 */ |
|
93 void DriverLoadSuccessL(TDeviceEventInformation aInfo); |
|
94 |
|
95 /** |
|
96 * Drivers loaded partially |
|
97 * @param aInfo Device event data |
|
98 */ |
|
99 void DriverLoadPartialSuccessL(TDeviceEventInformation aInfo); |
|
100 |
|
101 /** |
|
102 * Drivers loading failed |
|
103 * @param aInfo Device event data |
|
104 */ |
|
105 void DriverLoadFailureL(TDeviceEventInformation aInfo); |
|
106 |
|
107 // From message notification observer |
|
108 /** |
|
109 * Message received |
|
110 * @param aMessage message id |
|
111 */ |
|
112 void MessageNotificationReceivedL(TInt aMessage); |
|
113 |
|
114 //from CUsbState |
|
115 /** |
|
116 * State id |
|
117 * @return state id |
|
118 */ |
|
119 virtual TUsbStateIds Id(); |
|
120 |
|
121 /** |
|
122 * This is called when leaving this state, |
|
123 * |
|
124 */ |
|
125 void JustBeforeLeavingThisStateL(); |
|
126 |
|
127 /** |
|
128 * handles issue |
|
129 */ |
|
130 void DoHandleL(); |
|
131 |
|
132 /** |
|
133 * Default constructor |
|
134 * @param aWatcher owner |
|
135 */ |
|
136 CUsbStateHostHandleDropping(CUsbOtgWatcher& aWatcher); |
|
137 |
|
138 /** |
|
139 * 2nd phase construction |
|
140 */ |
|
141 void ConstructL(); |
|
142 |
|
143 }; |
|
144 |
|
145 #endif // C_USBSTATEHOSTDROPPINGHANDLE_H |