|
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 property value operation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSETOBJECTPROPVALUE_H |
|
20 #define CSETOBJECTPROPVALUE_H |
|
21 |
|
22 #include "crequestprocessor.h" |
|
23 |
|
24 // forward declaration |
|
25 class CMTPTypeString; |
|
26 class CMTPTypeArray; |
|
27 class TMTPTypeUint8; |
|
28 class TMTPTypeUint16; |
|
29 class TMTPTypeUint32; |
|
30 class CMTPObjectMetaData; |
|
31 class MMTPObjectMgr; |
|
32 class MMmMtpDpConfig; |
|
33 |
|
34 /** |
|
35 * Defines SetObjectPropValue request processor for common |
|
36 */ |
|
37 class CSetObjectPropValue : public CRequestProcessor |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Two-phase construction method |
|
42 * @param aFramework The data provider framework |
|
43 * @param aConnection The connection from which the request comes |
|
44 * @param aWrapper medadata access interface |
|
45 * @return a pointer to the created request processor object |
|
46 */ |
|
47 //IMPORT_C static MMmRequestProcessor* NewL(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMmMtpDpMetadataAccessWrapper& aWrapper); |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 */ |
|
52 IMPORT_C virtual ~CSetObjectPropValue(); |
|
53 |
|
54 protected: |
|
55 /** |
|
56 * Standard c++ constructor |
|
57 * @param aFramework The data provider framework |
|
58 * @param aConnection The connection from which the request comes |
|
59 * @param aWrapper medadata access interface |
|
60 */ |
|
61 IMPORT_C CSetObjectPropValue( MMTPDataProviderFramework& aFramework, |
|
62 MMTPConnection& aConnection, |
|
63 MMmMtpDpConfig& aDpConfig ); |
|
64 |
|
65 protected: |
|
66 // from CRequestProcessor |
|
67 /** |
|
68 * Verify the reqeust |
|
69 * @return EMTPRespCodeOK if request is verified, otherwise one of |
|
70 * the error response codes |
|
71 */ |
|
72 IMPORT_C TMTPResponseCode CheckRequestL(); |
|
73 |
|
74 /** |
|
75 * SetObjectPropValue request handler |
|
76 */ |
|
77 IMPORT_C void ServiceL(); |
|
78 |
|
79 /** |
|
80 * Edit the file to update the prop value |
|
81 * @return EFalse |
|
82 */ |
|
83 IMPORT_C TBool DoHandleResponsePhaseL(); |
|
84 |
|
85 /** |
|
86 * Derived from CRequestProcessor, can not be neglected |
|
87 * @return ETrue |
|
88 */ |
|
89 IMPORT_C TBool HasDataphase() const; |
|
90 |
|
91 protected: |
|
92 // new virtuals |
|
93 virtual TBool IsSpecificPropCodeReadOnly( TUint16 aPropCode ) const = 0; |
|
94 |
|
95 virtual void ReceiveDataSpecificObjectPropertyL( TUint16 aPropCode ) = 0; |
|
96 |
|
97 virtual TMTPResponseCode ServiceSpecificObjectPropertyL( TUint16 aPropCode ) = 0; |
|
98 |
|
99 protected: |
|
100 /** |
|
101 * Set MetaData to CMetadataAccessWrapper, for internal use |
|
102 * @param aPropCode, specify property code of aMediaProp |
|
103 * @param aNewData, object property value which will be get from |
|
104 * aObjectMetaData |
|
105 * @param aObjectMetaData, owner of the property which should be |
|
106 * inserted or updated into database |
|
107 * @return response code |
|
108 */ |
|
109 IMPORT_C TMTPResponseCode ServiceMetaDataToWrapperL( const TUint16 aPropCode, |
|
110 MMTPType& aNewData, |
|
111 const CMTPObjectMetaData& aObjectMetaData ); |
|
112 |
|
113 private: |
|
114 /* |
|
115 * Check if property could be set |
|
116 */ |
|
117 TBool IsPropCodeReadonly( TUint16 aPropCode ); |
|
118 |
|
119 protected: |
|
120 //TUint32 iPropCode; |
|
121 TUint16 iPropCode; |
|
122 CMTPTypeString* iMTPTypeString; |
|
123 CMTPTypeArray* iMTPTypeArray; |
|
124 TMTPTypeUint8 iMTPTypeUint8; |
|
125 TMTPTypeUint16 iMTPTypeUint16; |
|
126 TMTPTypeUint32 iMTPTypeUint32; |
|
127 CMTPObjectMetaData* iObjectInfo; |
|
128 MMTPObjectMgr& iObjectMgr; |
|
129 MMmMtpDpConfig& iDpConfig; |
|
130 |
|
131 }; |
|
132 |
|
133 #endif // CSETOBJECTPROPVALUE_H |