9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef CREQUESTPROCESSOR_H |
19 #ifndef CREQUESTPROCESSOR_H |
20 #define CREQUESTPROCESSOR_H |
20 #define CREQUESTPROCESSOR_H |
21 |
21 |
22 #include <e32base.h> |
22 |
|
23 #include <mtp/tmtptypenull.h> |
23 #include <mtp/mtpdataproviderapitypes.h> |
24 #include <mtp/mtpdataproviderapitypes.h> |
24 #include <mtp/mtpprotocolconstants.h> |
25 #include <mtp/mtpprotocolconstants.h> |
25 #include <mtp/tmtptyperesponse.h> |
26 #include <mtp/tmtptyperesponse.h> |
26 #include <mtp/tmtptypenull.h> |
27 |
|
28 // for derived processors |
|
29 #include <mtp/mmtpdataproviderframework.h> |
27 |
30 |
28 #include "crequestchecker.h" |
31 #include "crequestchecker.h" |
29 |
32 |
30 class MMTPConnection; |
33 class MMTPConnection; |
31 class TMTPTypeRequest; |
34 class TMTPTypeRequest; |
32 class CMTPDataProviderPlugin; |
|
33 class MMTPDataProviderFramework; |
35 class MMTPDataProviderFramework; |
34 class TMTPTypeEvent; |
36 class TMTPTypeEvent; |
35 class CMTPObjectInfo; |
37 class CMTPObjectInfo; |
36 |
38 |
37 static const TInt KMmMtpRArrayGranularity = 2; |
39 const TInt KMmMtpRArrayGranularity = 2; |
38 |
40 |
39 /** |
41 /** |
40 * Defines a request processor interface |
42 * Defines a request processor interface |
41 */ |
43 */ |
42 class MMmRequestProcessor |
44 class MMmRequestProcessor |
98 */ |
100 */ |
99 virtual void UsbDisconnect() = 0; |
101 virtual void UsbDisconnect() = 0; |
100 |
102 |
101 /* |
103 /* |
102 * Get the session id associated with current request object |
104 * Get the session id associated with current request object |
103 * This interface was added to avoid the case that the data member iRequest |
105 * This interface was added to avoid the case that the data member iRequest |
104 * was sometimes invalid in session close phase, and getting session id from |
106 * was sometimes invalid in session close phase, and getting session id from |
105 * request would cause panic |
107 * request would cause panic |
106 * @return session id |
108 * @return session id |
107 */ |
109 */ |
108 virtual TUint32 SessionId() = 0; |
110 virtual TUint32 SessionId() = 0; |
109 }; |
111 }; |
110 |
112 |
111 /** |
113 /** |
112 * Defines a processor factory function pointer |
114 * Defines a processor factory function pointer |
113 */ |
115 */ |
114 typedef MMmRequestProcessor |
116 typedef MMmRequestProcessor* (*TMTPRequestProcessorCreateFunc)( MMTPDataProviderFramework& aFramework, |
115 * (*TMTPRequestProcessorCreateFunc)( MMTPDataProviderFramework& aFramework, |
117 MMTPConnection& aConnection ); |
116 MMTPConnection& aConnection ); |
|
117 |
118 |
118 /** |
119 /** |
119 * Defines an entry which maps from operation code to the request processor |
120 * Defines an entry which maps from operation code to the request processor |
120 */ |
121 */ |
121 typedef struct |
122 typedef struct |
235 */ |
236 */ |
236 IMPORT_C void UsbDisconnect(); |
237 IMPORT_C void UsbDisconnect(); |
237 |
238 |
238 /* |
239 /* |
239 * Get the session id associated with current request object |
240 * Get the session id associated with current request object |
240 * This interface was added to avoid the case that the data member iRequest |
241 * This interface was added to avoid the case that the data member iRequest |
241 * was sometimes invalid in session close phase, and getting session id from |
242 * was sometimes invalid in session close phase, and getting session id from |
242 * request would cause panic |
243 * request would cause panic |
243 * @return session id |
244 * @return session id |
244 */ |
245 */ |
245 IMPORT_C TUint32 SessionId(); |
246 IMPORT_C TUint32 SessionId(); |
|
247 |
246 protected: |
248 protected: |
247 // from CActive |
249 // from CActive |
248 /** |
250 /** |
249 * part of active object framework, provide default implementation |
251 * part of active object framework, provide default implementation |
250 */ |
252 */ |