Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #include "usbmsshared.h"
20 #include "cpropertywatch.h"
25 TState(int id) : stateId(id) {}
28 virtual void MoveTo(int aStateId) const = 0;
29 TInt GetStateId() const {return stateId;}
35 //////////////////////////////////////////////////////////////
37 class TDisconnected : public TState
40 TDisconnected() : TState(EUsbMsDriveState_Disconnected){}
43 void MoveTo(TInt aStateId) const;
46 void MoveToConnecting() const;
47 void MoveToConnected() const;
50 //////////////////////////////////////////////////////////////
52 class TConnecting : public TState
55 TConnecting() : TState(EUsbMsDriveState_Connecting){}
58 void MoveTo(TInt aStateId) const;
61 void MoveToWritten() const;
64 //////////////////////////////////////////////////////////////
66 class TConnected : public TState
69 TConnected() : TState(EUsbMsDriveState_Connected){}
72 void MoveTo(TInt aStateId) const;
75 void MoveToActive() const;
78 //////////////////////////////////////////////////////////////
80 class TDisconnecting : public TState
83 TDisconnecting() : TState(EUsbMsDriveState_Disconnecting){}
86 void MoveTo(TInt aStateId) const;
89 void MoveToDisconnected() const;
92 //////////////////////////////////////////////////////////////
94 class TActive : public TState
97 TActive() : TState(EUsbMsDriveState_Active){}
100 void MoveTo(TInt aStateId) const;
103 void MoveToLocked() const;
104 void MoveToDisconnecting() const;
107 //////////////////////////////////////////////////////////////
109 class TLocked : public TState
112 TLocked() : TState(EUsbMsDriveState_Locked){}
115 void MoveTo(TInt aStateId) const;
118 void MoveToDisconnecting() const;
121 //////////////////////////////////////////////////////////////
123 class TWritten : public TState
126 TWritten() : TState(EUsbMsState_Written){}
129 void MoveTo(TInt aStateId) const;
132 void MoveToRead() const;
135 //////////////////////////////////////////////////////////////
137 class TRead : public TState
140 TRead() : TState(EUsbMsState_Read){}
143 void MoveTo(TInt aStateId) const;
146 void MoveToDisconnected() const;
149 #endif // __TSTATE_H__