1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
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: Implementation of the concret state |
|
15 * |
8 * |
16 */ |
9 * Initial Contributors: |
17 |
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of the concret state |
|
15 * |
|
16 */ |
18 |
17 |
19 #ifndef C_USBSTATEHOSTUNDEFINED_H |
18 #ifndef C_USBSTATEHOSTUNDEFINED_H |
20 #define C_USBSTATEHOSTUNDEFINED_H |
19 #define C_USBSTATEHOSTUNDEFINED_H |
21 |
20 |
22 #include "cusbotgwatcher.h" |
|
23 #include "cusbstatehostabase.h" |
21 #include "cusbstatehostabase.h" |
24 #ifndef STIF |
22 class CUsbOtgWatcher; |
25 |
|
26 #else |
|
27 |
|
28 #endif |
|
29 |
|
30 /** |
23 /** |
31 * This class implements behaviour in undefined state (when host) |
24 * This class implements behaviour in undefined state (when host) |
32 * |
25 * |
33 */ |
26 */ |
34 NONSHARABLE_CLASS( CUsbStateHostUndefined ) : public CUsbStateHostABase |
27 NONSHARABLE_CLASS( CUsbStateHostUndefined ) : public CUsbStateHostABase |
35 { |
28 { |
36 public: |
29 public: |
37 |
30 |
38 /** |
31 /** |
39 * Destruction |
32 * Destruction |
40 */ |
33 */ |
41 virtual ~CUsbStateHostUndefined(); |
34 virtual ~CUsbStateHostUndefined(); |
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aWatcher owner |
|
46 */ |
|
47 static CUsbStateHostUndefined* NewL(CUsbOtgWatcher* aWatcher); |
|
48 |
35 |
49 private: |
36 /** |
50 /** |
37 * Two-phased constructor. |
51 * default constructor is protected to be able to be inherited by child classes |
38 * @param aWatcher owner |
52 * @param aOwner owner of the state |
39 */ |
53 */ |
40 static CUsbStateHostUndefined* NewL(CUsbOtgWatcher& aWatcher); |
54 CUsbStateHostUndefined(CUsbOtgWatcher* aOwner); |
|
55 |
|
56 /** |
|
57 * Second phase construction |
|
58 */ |
|
59 void ConstructL(); |
|
60 |
41 |
61 /** |
42 private: |
62 * This function is needed to find a real state by id |
43 /** |
63 * This might be used in switching states in watcher. New state object searched by its id |
44 * default constructor is protected to be able to be inherited by child classes |
64 * @return Id |
45 * @param aOwner owner of the state |
65 */ |
46 */ |
66 virtual TUsbStateIds Id(); |
47 CUsbStateHostUndefined(CUsbOtgWatcher& aOwner); |
67 |
48 |
68 /** |
49 /** |
69 * Id Pin OFF |
50 * Second phase construction |
70 */ |
51 */ |
71 void IdPinOffL(); |
52 void ConstructL(); |
72 /** |
|
73 * Id Pin On |
|
74 */ |
|
75 void IdPinOnL(); |
|
76 |
53 |
77 // From VBus observer |
54 /** |
78 /** |
55 * This function is needed to find a real state by id |
79 * VBus down |
56 * This might be used in switching states in watcher. New state object searched by its id |
80 */ |
57 * @return Id |
81 void VBusDownL(); |
58 */ |
82 /** |
59 virtual TUsbStateIds Id(); |
83 * VBus UP |
60 |
84 */ |
61 // From VBus observer |
85 void VBusUpL(); |
62 /** |
86 |
63 * VBus down |
87 /** |
64 */ |
88 * VBus error |
65 virtual void VBusDownL(); |
89 */ |
66 |
90 void VBusErrorL(); |
67 /** |
91 |
68 * VBus UP |
92 // From OTG state observer |
69 */ |
93 /** |
70 virtual void VBusUpL(); |
94 * Became to Idle when A |
71 |
95 */ |
72 /** |
96 void AIdleL(); |
73 * VBus error |
97 /** |
74 */ |
98 * AVBus Error |
75 virtual void VBusErrorL(); |
99 */ |
76 |
100 void AVBusErrorL(); |
77 /** |
101 /** |
78 * AVBus Error |
102 * Became to Idle when B |
79 */ |
103 */ |
80 virtual void AVBusErrorL(); |
104 void BIdleL(); |
81 |
105 /** |
82 /** |
106 * Became to Peripheral when B |
83 * Became to Idle when B |
107 */ |
84 */ |
108 void BPeripheralL(); |
85 virtual void BIdleL(); |
109 |
86 |
110 // From Host Event notification observer |
87 /** |
111 /** |
88 * Became to Peripheral when B |
112 * Device is detached |
89 */ |
113 * @param aInfo Device event data |
90 virtual void BPeripheralL(); |
114 */ |
91 |
115 virtual void DeviceDetachedL(TDeviceEventInformation aInfo); |
92 // From Host Event notification observer |
|
93 /** |
|
94 * Device is detached |
|
95 * @param aInfo Device event data |
|
96 */ |
|
97 virtual void DeviceDetachedL(TDeviceEventInformation aInfo); |
|
98 |
|
99 // From message notification observer |
|
100 /** |
|
101 * Message received |
|
102 * @param aMessage message id |
|
103 */ |
|
104 virtual void MessageNotificationReceivedL(TInt aMessage); |
|
105 /** |
|
106 * SRP request received |
|
107 */ |
|
108 virtual void SrpReceivedL(); |
|
109 /** |
|
110 * Connected to hub in wrong level |
|
111 */ |
|
112 virtual void BadHubPositionL(); |
|
113 /** |
|
114 * Session request received |
|
115 */ |
|
116 virtual void SessionRequestedL(); |
116 |
117 |
117 private: |
118 private: |
118 // data |
119 // data |
119 }; |
120 }; |
120 |
121 |