|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // mw/remoteconn/mtpfws/mtpfw/dataproviders/dputility/inc/mmtpsvcobjecthandler.h |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #ifndef __MMTPSVCOBJHANDLER_H__ |
|
22 #define __MMTPSVCOBJHANDLER_H__ |
|
23 |
|
24 #include <mtp/mtpprotocolconstants.h> |
|
25 |
|
26 class CMTPObjectMetaData; |
|
27 class CMTPTypeArray; |
|
28 class CMTPTypeObjectInfo; |
|
29 class CMTPTypeObjectPropList; |
|
30 class CMTPTypeObjectPropListElement; |
|
31 |
|
32 class MMTPSvcObjectHandler |
|
33 { |
|
34 public: |
|
35 /** |
|
36 Dispatch SendObjectInfoL to object handler |
|
37 @param aObjectInfo The ObjectInfo dataset specifed in the MTP request |
|
38 @param aParentHandle Specify the new object's parent handle, dp can change the handler if necessary. |
|
39 @param aSuid Concrete object handler need set the parameter with new created object suid |
|
40 @return See MTP response code definition |
|
41 @leave One of the system wide error codes, if a general processing error |
|
42 */ |
|
43 IMPORT_C virtual TMTPResponseCode SendObjectInfoL(const CMTPTypeObjectInfo& aObjectInfo, TUint32& aParentHandle, TDes& aSuid); |
|
44 /** |
|
45 Dispatch GetObjectInfoL to object handler |
|
46 @param aObjectMetaData Specify the getting object's metadata, including suid, objecthandle etc. |
|
47 @param aObjectInfo The returned ObjectInfo dataset. |
|
48 @return See MTP response code definition |
|
49 @leave One of the system wide error codes, if a general processing error |
|
50 */ |
|
51 IMPORT_C virtual TMTPResponseCode GetObjectInfoL(const CMTPObjectMetaData& aObjectMetaData, CMTPTypeObjectInfo& aObjectInfo); |
|
52 /** |
|
53 Dispatch SendObjectPropList to object handler |
|
54 @param aObjectSize The new object size specified in the MTP request |
|
55 @param aObjectPropList Provide info for dp to create object |
|
56 @param aParentHandle Specify the new object's parent handle, dp can change the handler if necessary. |
|
57 @param aSuid Concrete object handler need set the parameter with new created object suid |
|
58 @return See MTP response code definition |
|
59 @leave One of the system wide error codes, if a general processing error |
|
60 */ |
|
61 virtual TMTPResponseCode SendObjectPropListL(TUint64 aObjectSize, const CMTPTypeObjectPropList& aObjectPropList, |
|
62 TUint32& aParentHandle, TDes& aSuid) = 0; |
|
63 /** |
|
64 Dispatch GetObjectPropListL to object handler, handler only need append the specified object prop code's info. |
|
65 @param aObjectMetaData Specify the getting object's metadata, including suid, objecthandle etc. |
|
66 @param aPropList The returned ObjectPropList dataset. |
|
67 @param aPropertyCode Specify which object property need to be gotten |
|
68 @return See MTP response code definition |
|
69 @leave One of the system wide error codes, if a general processing error |
|
70 */ |
|
71 virtual TMTPResponseCode GetObjectPropertyL(const CMTPObjectMetaData& aObjectMetaData, TUint16 aPropertyCode, CMTPTypeObjectPropList& aPropList) = 0; |
|
72 /** |
|
73 Set a property value of object with concrete object handler |
|
74 @param aSuid Specify the object's suid which will be used by object handle to find the concrete object |
|
75 @param element include the object's property information, including ObjectHandle, PropertyCode, Datatype and Value |
|
76 @param aOperationCode Used to distinguish if the property can be changed by specified operation or not. |
|
77 @return See MTP response code definition |
|
78 @leave One of the system wide error codes, if a general processing error |
|
79 */ |
|
80 virtual TMTPResponseCode SetObjectPropertyL(const TDesC& aSuid, const CMTPTypeObjectPropListElement& aElement, TMTPOperationCode aOperationCode) = 0; |
|
81 /** |
|
82 Dispatch DeleteObjectPropertyL to object handler |
|
83 @param aObjectMetaData Specify the deleting object's metadata, including suid, objecthandle etc. |
|
84 @param aPropertyCode The property code which need to be deleted. |
|
85 @return See MTP response code definition |
|
86 @leave One of the system wide error codes, if a general processing error |
|
87 */ |
|
88 virtual TMTPResponseCode DeleteObjectPropertyL(const CMTPObjectMetaData& aObjectMetaData, TUint16 aPropertyCode) = 0; |
|
89 /** |
|
90 Dispatch GetBufferForSendObjectL to object handler, the function used to get a buffer which |
|
91 allocated by concrete object handler for the setting object |
|
92 @param aObjectMetaData the new object's metadata, including suid, objecthandle etc. |
|
93 @param aBuffer The new buffer allocated by object handler |
|
94 @return See MTP response code definition |
|
95 @leave One of the system wide error codes, if a general processing error |
|
96 */ |
|
97 virtual TMTPResponseCode GetBufferForSendObjectL(const CMTPObjectMetaData& aObjectMetaData, MMTPType** aBuffer) = 0; |
|
98 /** |
|
99 Dispatch GetObjectL to object handler. the object handler will allocate a new buffer for the object, |
|
100 it will be released by ReleaseObjectBuffer when the request processing is end. |
|
101 @param aObjectMetaData Specify the getting object's metadata, including suid, objecthandle etc. |
|
102 @param aBuffer The object's content. |
|
103 @return See MTP response code definition |
|
104 @leave One of the system wide error codes, if a general processing error |
|
105 */ |
|
106 virtual TMTPResponseCode GetObjectL(const CMTPObjectMetaData& aObjectMetaData, MMTPType** aBuffer) = 0; |
|
107 /** |
|
108 Delete an object with specified parameters |
|
109 @param aObjectMetaData Specify the deleting object's metadata, including suid, objecthandle etc. |
|
110 @return See MTP response code definition |
|
111 @leave One of the system wide error codes, if a general processing error |
|
112 */ |
|
113 virtual TMTPResponseCode DeleteObjectL(const CMTPObjectMetaData& aObjectMetaData) = 0; |
|
114 /** |
|
115 Dispatch SetObjectReferenceL to object handler. the object handler will set reference for specified handle, |
|
116 it will be released by ReleaseObjectBuffer when the request processing is end. |
|
117 @param aObjectMetaData object need to be set refence. |
|
118 @param aReferences reference array. |
|
119 @return See MTP response code definition |
|
120 @leave One of the system wide error codes, if a general processing error |
|
121 */ |
|
122 IMPORT_C virtual TMTPResponseCode SetObjectReferenceL(const CMTPObjectMetaData& aObjectMetaData, const CMTPTypeArray& aReferences); |
|
123 /** |
|
124 Dispatch GetObjectReferenceL to object handler. the object handler will fetch the specified object's reference array, |
|
125 it will be released by ReleaseObjectBuffer when the request processing is end. |
|
126 @param aObjectMetaData object need to get refence. |
|
127 @param aReferences reference array. |
|
128 @return See MTP response code definition |
|
129 @leave One of the system wide error codes, if a general processing error |
|
130 */ |
|
131 IMPORT_C virtual TMTPResponseCode GetObjectReferenceL(const CMTPObjectMetaData& aObjectMetaData, CMTPTypeArray& aReferences); |
|
132 /** |
|
133 Dispatch CopyObject to object handler. This operation causes the device to create a copy of the target object and place |
|
134 that copy in a location that is indicated by the parameters of this operation. |
|
135 @param aObjectMetaData Specify the getting object's metadata, including suid, objecthandle etc. |
|
136 @param aDestStorageId StorageID that the newly copied object should be placed into. |
|
137 @param aNewParentHandle ObjectHandle of newly copied object’s parent. |
|
138 @return See MTP response code definition |
|
139 @leave One of the system wide error codes, if a general processing error |
|
140 */ |
|
141 IMPORT_C virtual TMTPResponseCode CopyObject(const CMTPObjectMetaData& aObjectMetaData, TUint32 aDestStorageId, TUint32 aNewParentHandle); |
|
142 /** |
|
143 Dispatch MoveObject to object handler. This operation changes the location of an object on the device, by changing the storage on |
|
144 which it is stored, changing the location in which it is located, or both. |
|
145 @param aObjectMetaData Specify the getting object's metadata, including suid, objecthandle etc. |
|
146 @param aDestStorageId StorageID of store to move object to. |
|
147 @param aNewParentHandle ObjectHandle of the new ParentObject. |
|
148 @return See MTP response code definition |
|
149 @leave One of the system wide error codes, if a general processing error |
|
150 */ |
|
151 IMPORT_C virtual TMTPResponseCode MoveObject(const CMTPObjectMetaData& aObjectMetaData, TUint32 aDestStorageId, TUint32 aNewParentHandle); |
|
152 /** |
|
153 When dp received UpdateObjectPropList, if the dataset don't include object size value, request |
|
154 processor can use this interface to get object size for the following SendObject. |
|
155 @param aSuid Concrete object handler need set the parameter with new created object suid |
|
156 @param aObjectSize The updating object's size. |
|
157 @return See MTP response code definition |
|
158 */ |
|
159 virtual TMTPResponseCode GetObjectSizeL(const TDesC& aSuid, TUint64& aObjectSize) = 0; |
|
160 /** |
|
161 Commit prevous setted property value |
|
162 @leave One of the system wide error codes, if a general processing error |
|
163 */ |
|
164 IMPORT_C virtual void CommitL(); |
|
165 /** |
|
166 Create a new object and commit all cached property value |
|
167 @param aSuid Concrete object handler need set the parameter with new created object suid |
|
168 @leave One of the system wide error codes, if a general processing error |
|
169 */ |
|
170 IMPORT_C virtual void CommitForNewObjectL(TDes& aSuid); |
|
171 /** |
|
172 Rollback setted value for a object, called when SendObject fail or object handler commit fail |
|
173 */ |
|
174 IMPORT_C virtual void RollBack(); |
|
175 /** |
|
176 After GetObject called, object handler will allocate a buffer and send to initiator. request processor |
|
177 need call this interface to release the existing buffer. |
|
178 */ |
|
179 IMPORT_C virtual void ReleaseObjectBuffer(); |
|
180 /** |
|
181 Get the handler's all supported object prop code with specified group code, if group code is 0, then return |
|
182 all prop codes. |
|
183 @param aGroupId Group id |
|
184 @param aPropCodes Returned object prop code array. |
|
185 @return See MTP response code definition |
|
186 @leave One of the system wide error codes, if a general processing error |
|
187 */ |
|
188 virtual TMTPResponseCode GetAllObjectPropCodeByGroupL(TUint32 aGroupId, RArray<TUint32>& aPropCodes) = 0; |
|
189 |
|
190 protected: |
|
191 IMPORT_C TMTPResponseCode CheckGenObjectPropertyL(const CMTPTypeObjectPropListElement& element, TMTPOperationCode aOperationCode) const; |
|
192 }; |
|
193 |
|
194 #endif // __MMTPSVCOBJHANDLER_H__ |
|
195 |