|
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: GetParitialObject operation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CGETPARTIALOBJECT_H |
|
20 #define CGETPARTIALOBJECT_H |
|
21 |
|
22 #include "crequestprocessor.h" |
|
23 |
|
24 class MMTPDataProviderFramework; |
|
25 class RFs; |
|
26 class TMTPTypeFlatBase; |
|
27 class CMTPTypeFile; |
|
28 class CMmMtpDpMetadataAccessWrapper; |
|
29 class MMmMtpDpConfig; |
|
30 |
|
31 /** |
|
32 * Defines GetPartialObject request processor |
|
33 */ |
|
34 class CGetPartialObject : public CRequestProcessor |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Two-phase construction method |
|
39 * @param aFramework The data provider framework |
|
40 * @param aConnection The connection from which the request comes |
|
41 * @param aWrapper medadata access interface |
|
42 * @return a pointer to the created request processor object |
|
43 */ |
|
44 IMPORT_C static MMmRequestProcessor* NewL( MMTPDataProviderFramework& aFramework, |
|
45 MMTPConnection& aConnection, |
|
46 MMmMtpDpConfig& aDpConfig ); |
|
47 |
|
48 /** |
|
49 * Destructor |
|
50 */ |
|
51 IMPORT_C virtual ~CGetPartialObject(); |
|
52 |
|
53 protected: |
|
54 /** |
|
55 * Standard c++ constructor |
|
56 * @param aFramework The data provider framework |
|
57 * @param aConnection The connection from which the request comes |
|
58 */ |
|
59 IMPORT_C CGetPartialObject( MMTPDataProviderFramework& aFramework, |
|
60 MMTPConnection& aConnection ); |
|
61 |
|
62 protected: |
|
63 // from CRequestProcessor |
|
64 /** |
|
65 * Check the GetPartialObject reqeust |
|
66 * @return EMTPRespCodeOK if the request is good, otherwise, one of the error response codes |
|
67 */ |
|
68 IMPORT_C TMTPResponseCode CheckRequestL(); |
|
69 |
|
70 /** |
|
71 * GetPartialObject request handler |
|
72 * Send the partial object data to the initiator |
|
73 */ |
|
74 IMPORT_C void ServiceL(); |
|
75 |
|
76 /** |
|
77 * Signal to the initiator how much data has been sent |
|
78 * @return EFalse |
|
79 */ |
|
80 IMPORT_C TBool DoHandleResponsePhaseL(); |
|
81 |
|
82 private: |
|
83 /** |
|
84 * Second-phase construction |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 private: |
|
89 //helper |
|
90 /** |
|
91 * Verify if the parameter of the request (i.e. offset) is good. |
|
92 * @return ETrue if the parameter is good, otherwise, EFalse |
|
93 */ |
|
94 TBool VerifyParametersL(); |
|
95 |
|
96 /** |
|
97 * Populate the partial data object |
|
98 */ |
|
99 void BuildPartialDataL(); |
|
100 |
|
101 private: |
|
102 MMTPDataProviderFramework& iFramework; |
|
103 RFs& iFs; |
|
104 TMTPTypeFlatBase* iPartialData; |
|
105 HBufC8* iBuffer; |
|
106 TPtr8 iBufferPtr8; |
|
107 TInt iOffset; |
|
108 TInt iPartialDataLength; |
|
109 TBool iCompleteFile; |
|
110 CMTPTypeFile* iFileObject; |
|
111 TBuf<KMaxFileName> iFileSuid; |
|
112 TUint32 iObjectHandle; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // CGETPARTIALOBJECT_H |