|
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: Set Object proplist operation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSETOBJECTPROPLIST_H |
|
20 #define CSETOBJECTPROPLIST_H |
|
21 |
|
22 #include "crequestprocessor.h" |
|
23 |
|
24 // forward declaration |
|
25 class CMTPTypeObjectPropList; |
|
26 class CMmMtpDpMetadataAccessWrapper; |
|
27 class MMTPObjectMgr; |
|
28 class CMTPObjectMetaData; |
|
29 class MMmMtpDpConfig; |
|
30 |
|
31 /** |
|
32 * Defines SetObjectPropList request processor |
|
33 */ |
|
34 class CSetObjectPropList : 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 // CMmMtpDpMetadataAccessWrapper& aWrapper ); |
|
47 |
|
48 /** |
|
49 * Destructor |
|
50 */ |
|
51 IMPORT_C virtual ~CSetObjectPropList(); |
|
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 * @param aWrapper medadata access interface |
|
59 */ |
|
60 IMPORT_C CSetObjectPropList( MMTPDataProviderFramework& aFramework, |
|
61 MMTPConnection& aConnection, |
|
62 MMmMtpDpConfig& aDpConfig ); |
|
63 |
|
64 /** |
|
65 * 2nd Phase Constructor |
|
66 */ |
|
67 IMPORT_C void ConstructL(); |
|
68 |
|
69 protected: |
|
70 // from CRequestProcessor |
|
71 /** |
|
72 * SetObjectPropList request handler |
|
73 */ |
|
74 IMPORT_C void ServiceL(); |
|
75 |
|
76 /** |
|
77 * Completing phase for the request handler |
|
78 */ |
|
79 IMPORT_C TBool DoHandleResponsePhaseL(); |
|
80 |
|
81 /** |
|
82 * Derived from CRequestProcessor, can not be neglected |
|
83 * @return ETrue |
|
84 */ |
|
85 IMPORT_C TBool HasDataphase() const; |
|
86 |
|
87 // From CActive |
|
88 /** |
|
89 * Cancel the enumeration process |
|
90 */ |
|
91 IMPORT_C void DoCancel(); |
|
92 |
|
93 /** |
|
94 * Handle completed request |
|
95 */ |
|
96 IMPORT_C void RunL(); |
|
97 |
|
98 /** |
|
99 * Ignore the error, continue with the next one |
|
100 */ |
|
101 IMPORT_C TInt RunError( TInt aError ); |
|
102 |
|
103 protected: |
|
104 // new virtuals |
|
105 /** |
|
106 * Set MetaData to CMetadataAccessWrapper, for internal use |
|
107 * @param aPropCode, specify property code of aMediaProp |
|
108 * @param aNewData, object property value which will be get from |
|
109 * aObjectMetaData |
|
110 * @param aObjectMetaData, owner of the property which should be |
|
111 * inserted or updated into database |
|
112 * @return response code |
|
113 */ |
|
114 IMPORT_C TMTPResponseCode ServiceMetaDataToWrapperL( const TUint16 aPropCode, |
|
115 MMTPType& aNewData, |
|
116 const CMTPObjectMetaData& aObjectMetaData ); |
|
117 |
|
118 virtual TMTPResponseCode ServiceSpecificObjectPropertyL( TUint16 aPropCode, |
|
119 const CMTPObjectMetaData& aObject, |
|
120 const CMTPTypeObjectPropListElement& aElement ) = 0; |
|
121 |
|
122 virtual TInt HandleSpecificWrapperError( TInt aError, |
|
123 const CMTPObjectMetaData& aObject) = 0; |
|
124 |
|
125 private: |
|
126 /* |
|
127 * Handle response phase of SetObjectPropListL operation |
|
128 */ |
|
129 TMTPResponseCode SetObjectPropListL( const CMTPTypeObjectPropListElement& aPropListElement ); |
|
130 |
|
131 protected: |
|
132 MMTPObjectMgr& iObjectMgr; |
|
133 RFs& iFs; |
|
134 CMTPTypeObjectPropList* iPropertyList; |
|
135 MMmMtpDpConfig& iDpConfig; |
|
136 TUint32 iUnprocessedIndex; |
|
137 TInt iElementCount; |
|
138 |
|
139 }; |
|
140 |
|
141 #endif // CSETOBJECTPROPLIST_H |