|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef SUBCOMMANDS_H |
|
24 #define SUBCOMMANDS_H |
|
25 |
|
26 #include "subcommandbase.h" |
|
27 #include "usb/hostms/msmm_policy_def.h" |
|
28 #include "msmmnodebase.h" |
|
29 #ifdef __OVER_DUMMYCOMPONENT__ |
|
30 #include <usb/hostms/dummycomponent/rusbhostmsdevice.h> |
|
31 #else |
|
32 #include <rusbhostmsdevice.h> |
|
33 #endif |
|
34 |
|
35 // TRegisterInterface class |
|
36 // Sub-command to regiest a USB MS function to RUsbHostMsDevice |
|
37 NONSHARABLE_CLASS(TRegisterInterface) : public TSubCommandBase |
|
38 { |
|
39 public: |
|
40 TRegisterInterface(THostMsSubCommandParam aParam); |
|
41 |
|
42 // From TSubCommandBase |
|
43 void HandleError(THostMsErrData& aData, TInt aError); |
|
44 |
|
45 private: |
|
46 // From TSubCommandBase |
|
47 void DoExecuteL(); |
|
48 void DoAsyncCmdCompleteL(); |
|
49 void DoCancelAsyncCmd(); |
|
50 |
|
51 private: |
|
52 TUint32 iMaxLogicalUnit; |
|
53 THostMassStorageConfig iMsConfig; |
|
54 TUsbMsDevice* iDeviceNode; // Not owned |
|
55 TUsbMsInterface* iInterfaceNode; // Not owned |
|
56 }; |
|
57 |
|
58 |
|
59 // TRetrieveDriveLetter class |
|
60 // Sub-command to retrieve a drive letter from policy plugin |
|
61 NONSHARABLE_CLASS(TRetrieveDriveLetter) : public TSubCommandBase |
|
62 { |
|
63 public: |
|
64 TRetrieveDriveLetter(THostMsSubCommandParam& aParameter, TInt aLuNumber); |
|
65 |
|
66 // From TSubCommandBase |
|
67 void HandleError(THostMsErrData& aData, TInt aError); |
|
68 |
|
69 private: |
|
70 // From TSubCommandBase |
|
71 void DoExecuteL(); |
|
72 void DoAsyncCmdCompleteL(); |
|
73 void DoCancelAsyncCmd(); |
|
74 |
|
75 private: |
|
76 TPolicyRequestData iRequestData; |
|
77 TInt iLuNumber; |
|
78 TText iDrive; |
|
79 }; |
|
80 |
|
81 |
|
82 // TMountLogicalUnit class |
|
83 // Sub-command to mount a logical unit on a drive letter |
|
84 NONSHARABLE_CLASS(TMountLogicalUnit) : public TSubCommandBase |
|
85 { |
|
86 public: |
|
87 |
|
88 TMountLogicalUnit(THostMsSubCommandParam& aParameter, |
|
89 TText aDrive, TInt aLuNumber); |
|
90 |
|
91 // From TSubCommandBase |
|
92 void HandleError(THostMsErrData& aData, TInt aError); |
|
93 |
|
94 private: |
|
95 // From TSubCommandBase |
|
96 void DoExecuteL(); |
|
97 void DoAsyncCmdCompleteL(); |
|
98 |
|
99 private: |
|
100 TText iDrive; |
|
101 TInt iLuNumber; |
|
102 }; |
|
103 |
|
104 // TSaveLatestMountInfo class |
|
105 // Sub-command to save a mounting record |
|
106 NONSHARABLE_CLASS(TSaveLatestMountInfo) : public TSubCommandBase |
|
107 { |
|
108 public: |
|
109 TSaveLatestMountInfo(THostMsSubCommandParam& aParameter, |
|
110 TText aDrive, TInt aLuNumber); |
|
111 |
|
112 // From TSubCommandBase |
|
113 void HandleError(THostMsErrData& aData, TInt aError); |
|
114 |
|
115 private: |
|
116 // From TSubCommandBase |
|
117 void DoExecuteL(); |
|
118 void DoAsyncCmdCompleteL(); |
|
119 void DoCancelAsyncCmd(); |
|
120 |
|
121 private: |
|
122 TPolicyMountRecord iRecord; |
|
123 TText iDrive; |
|
124 TInt iLuNumber; |
|
125 }; |
|
126 |
|
127 |
|
128 // TDeregisterInterface class |
|
129 // Sub-command to deregister a USB MS function from RUsbHostMsDevice |
|
130 NONSHARABLE_CLASS(TDeregisterInterface) : public TSubCommandBase |
|
131 { |
|
132 public: |
|
133 TDeregisterInterface(THostMsSubCommandParam& aParameter, |
|
134 TUint8 aInterfaceNumber, TUint32 aInterfaceToken); |
|
135 |
|
136 // From TSubCommandBase |
|
137 void HandleError(THostMsErrData& aData, TInt aError); |
|
138 |
|
139 private: |
|
140 // From TSubCommandBase |
|
141 void DoExecuteL(); |
|
142 |
|
143 private: |
|
144 TUint8 iInterfaceNumber; |
|
145 TUint32 iInterfaceToken; |
|
146 THostMassStorageConfig iMsConfig; |
|
147 TUsbMsDevice* iDeviceNode; // Not owned |
|
148 TUsbMsInterface* iInterfaceNode; // Not owned |
|
149 }; |
|
150 |
|
151 |
|
152 // TDismountLogicalUnit class |
|
153 // Sub-command to dismount a logical unit |
|
154 class TUsbMsLogicalUnit; |
|
155 NONSHARABLE_CLASS (TDismountLogicalUnit) : public TSubCommandBase |
|
156 { |
|
157 public: |
|
158 TDismountLogicalUnit(THostMsSubCommandParam& aParameter, |
|
159 const TUsbMsLogicalUnit& aLogicalUnit); |
|
160 |
|
161 // From TSubCommandBase |
|
162 void HandleError(THostMsErrData& aData, TInt aError); |
|
163 |
|
164 private: |
|
165 // From TSubCommandBase |
|
166 void DoExecuteL(); |
|
167 |
|
168 private: |
|
169 const TUsbMsLogicalUnit& iLogicalUnit; |
|
170 }; |
|
171 |
|
172 |
|
173 // TRemoveUsbMsDeviceNode class |
|
174 // Sub-command to dismount a logical unit |
|
175 class TMsmmNodeBase; |
|
176 NONSHARABLE_CLASS(TRemoveUsbMsDeviceNode) : public TSubCommandBase |
|
177 { |
|
178 public: |
|
179 TRemoveUsbMsDeviceNode(THostMsSubCommandParam& aParameter, |
|
180 TMsmmNodeBase* aNodeToBeRemoved); |
|
181 |
|
182 // From TSubCommandBase |
|
183 void HandleError(THostMsErrData& aData, TInt aError); |
|
184 |
|
185 private: |
|
186 // From TSubCommandBase |
|
187 void DoExecuteL(); |
|
188 TMsmmNodeBase* iNodeToBeRemoved; // No ownership |
|
189 }; |
|
190 |
|
191 #endif /*SUBCOMMANDS_H*/ |
|
192 |
|
193 // End of file |