|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** @file |
|
20 @internalComponent |
|
21 */ |
|
22 #ifndef CHARGINGSTATES_H |
|
23 #define CHARGINGSTATES_H |
|
24 |
|
25 #include "CUsbBatteryChargingPlugin.h" |
|
26 |
|
27 class TUsbBatteryChargingPluginStateBase : public MUsbBatteryChargingPluginInterface |
|
28 { |
|
29 friend class CUsbBatteryChargingPlugin; |
|
30 |
|
31 protected: // from MUsbBatteryChargingPluginInterface |
|
32 // from MUsbDeviceNotify |
|
33 virtual void UsbServiceStateChange (TInt aLastError, |
|
34 TUsbServiceState aOldState, TUsbServiceState aNewState); |
|
35 virtual void UsbDeviceStateChange (TInt aLastError, |
|
36 TUsbDeviceState aOldState, TUsbDeviceState aNewState); |
|
37 |
|
38 // from MUsbChargingRepositoryObserver |
|
39 virtual void HandleRepositoryValueChangedL (const TUid& aRepository, |
|
40 TUint aId, TInt aVal); |
|
41 |
|
42 // from MUsbChargingDeviceStateTimerObserver |
|
43 virtual void DeviceStateTimeout(); |
|
44 |
|
45 #ifdef SYMBIAN_ENABLE_USB_OTG_HOST_PRIV // For host OTG enabled charging plug-in |
|
46 // from MOtgPropertiesObserver |
|
47 virtual void MpsoIdPinStateChanged(TInt aValue); |
|
48 virtual void MpsoOtgStateChangedL(TUsbOtgState aNewState); |
|
49 #endif |
|
50 virtual void MpsoVBusStateChanged(TInt aNewState); |
|
51 |
|
52 protected: |
|
53 TUsbBatteryChargingPluginStateBase(CUsbBatteryChargingPlugin& aParentStateMachine); |
|
54 |
|
55 protected: |
|
56 CUsbBatteryChargingPlugin& iParent; // Charging state machine. Not Owned |
|
57 }; |
|
58 |
|
59 class TUsbBatteryChargingPluginStateIdle : public TUsbBatteryChargingPluginStateBase |
|
60 { |
|
61 public: |
|
62 TUsbBatteryChargingPluginStateIdle( |
|
63 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
64 |
|
65 private: |
|
66 void UsbDeviceStateChange( |
|
67 TInt aLastError, TUsbDeviceState aOldState, TUsbDeviceState aNewState); |
|
68 }; |
|
69 |
|
70 class TUsbBatteryChargingPluginStateNoValidCurrent : public TUsbBatteryChargingPluginStateBase |
|
71 { |
|
72 public: |
|
73 TUsbBatteryChargingPluginStateNoValidCurrent( |
|
74 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
75 }; |
|
76 |
|
77 class TUsbBatteryChargingPluginStateCurrentNegotiating : public TUsbBatteryChargingPluginStateBase |
|
78 { |
|
79 public: |
|
80 TUsbBatteryChargingPluginStateCurrentNegotiating( |
|
81 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
82 |
|
83 private: |
|
84 void UsbDeviceStateChange(TInt aLastError, TUsbDeviceState aOldState, |
|
85 TUsbDeviceState aNewState); |
|
86 void DeviceStateTimeout(); |
|
87 }; |
|
88 |
|
89 class TUsbBatteryChargingPluginStateCharging : public TUsbBatteryChargingPluginStateBase |
|
90 { |
|
91 public: |
|
92 TUsbBatteryChargingPluginStateCharging( |
|
93 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
94 |
|
95 private: |
|
96 void UsbDeviceStateChange(TInt aLastError, TUsbDeviceState aOldState, |
|
97 TUsbDeviceState aNewState); |
|
98 }; |
|
99 |
|
100 class TUsbBatteryChargingPluginStateIdleNegotiated : public TUsbBatteryChargingPluginStateBase |
|
101 { |
|
102 public: |
|
103 TUsbBatteryChargingPluginStateIdleNegotiated( |
|
104 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
105 |
|
106 private: |
|
107 void UsbDeviceStateChange(TInt aLastError, TUsbDeviceState aOldState, |
|
108 TUsbDeviceState aNewState); |
|
109 }; |
|
110 |
|
111 class TUsbBatteryChargingPluginStateUserDisabled : public TUsbBatteryChargingPluginStateBase |
|
112 { |
|
113 public: |
|
114 TUsbBatteryChargingPluginStateUserDisabled( |
|
115 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
116 |
|
117 private: |
|
118 void UsbDeviceStateChange(TInt aLastError, TUsbDeviceState aOldState, |
|
119 TUsbDeviceState aNewState); |
|
120 |
|
121 // from MUsbChargingRepositoryObserver |
|
122 void HandleRepositoryValueChangedL (const TUid& aRepository, |
|
123 TUint aId, TInt aVal); |
|
124 |
|
125 #ifdef SYMBIAN_ENABLE_USB_OTG_HOST_PRIV // For host OTG enabled charging plug-in |
|
126 void MpsoIdPinStateChanged(TInt aValue); |
|
127 #endif |
|
128 void MpsoVBusStateChanged(TInt aNewState); |
|
129 }; |
|
130 |
|
131 class TUsbBatteryChargingPluginStateBEndedCableNotPresent : public TUsbBatteryChargingPluginStateBase |
|
132 { |
|
133 public: |
|
134 TUsbBatteryChargingPluginStateBEndedCableNotPresent( |
|
135 CUsbBatteryChargingPlugin& aParentStateMachine); |
|
136 }; |
|
137 |
|
138 #endif // CHARGINGSTATES_H |
|
139 |
|
140 // End of file |