26 #include "cgetobjectpropvalue.h" |
26 #include "cgetobjectpropvalue.h" |
27 #include "mmmtpdputility.h" |
27 #include "mmmtpdputility.h" |
28 #include "cmmmtpdpmetadataaccesswrapper.h" |
28 #include "cmmmtpdpmetadataaccesswrapper.h" |
29 #include "mmmtpdplogger.h" |
29 #include "mmmtpdplogger.h" |
30 #include "mmmtpdpconfig.h" |
30 #include "mmmtpdpconfig.h" |
31 |
31 #include "tobjectdescription.h" |
32 _LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" ); |
32 |
33 const TInt KMtpMaxDateTimeStringLength = 15; |
|
34 |
33 |
35 // ----------------------------------------------------------------------------- |
34 // ----------------------------------------------------------------------------- |
36 // Verification data for the GetObjectPropValue request |
35 // Verification data for the GetObjectPropValue request |
37 // ----------------------------------------------------------------------------- |
36 // ----------------------------------------------------------------------------- |
38 // |
37 // |
136 |
135 |
137 //Get the request information |
136 //Get the request information |
138 TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); |
137 TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 ); |
139 TUint32 propCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); |
138 TUint32 propCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 ); |
140 PRINT2( _L( "MM MTP <> CGetObjectPropValue::ServiceL objectHandle = 0x%x, propCode = 0x%x" ), |
139 PRINT2( _L( "MM MTP <> CGetObjectPropValue::ServiceL objectHandle = 0x%x, propCode = 0x%x" ), |
141 objectHandle, propCode ); |
140 objectHandle, propCode ); |
142 |
141 |
143 // don't have the ownship of the object |
142 // don't have the ownship of the object |
144 iObjectInfo = iRequestChecker->GetObjectInfo( objectHandle ); |
143 iObjectInfo = iRequestChecker->GetObjectInfo( objectHandle ); |
145 TPtrC suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); |
144 TPtrC suid( iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); |
146 PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL object file name is %S" ), &suid ); |
145 PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL object file name is %S" ), &suid ); |
147 TParsePtrC parse( suid ); |
146 TParsePtrC parse( suid ); |
148 |
147 |
149 iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() ); |
|
150 |
|
151 if ( iMTPTypeString != NULL ) |
148 if ( iMTPTypeString != NULL ) |
152 { |
149 { |
153 delete iMTPTypeString; |
150 delete iMTPTypeString; |
154 iMTPTypeString = NULL; |
151 iMTPTypeString = NULL; |
155 } |
152 } |
180 // ProtectionStatus |
177 // ProtectionStatus |
181 case EMTPObjectPropCodeProtectionStatus: |
178 case EMTPObjectPropCodeProtectionStatus: |
182 { |
179 { |
183 iMTPTypeUint16.Set( 0 ); |
180 iMTPTypeUint16.Set( 0 ); |
184 iMTPTypeUint16 = MmMtpDpUtility::GetProtectionStatusL( iFramework.Fs(), |
181 iMTPTypeUint16 = MmMtpDpUtility::GetProtectionStatusL( iFramework.Fs(), |
185 iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); |
182 iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); |
186 SendDataL( iMTPTypeUint16 ); |
183 SendDataL( iMTPTypeUint16 ); |
187 } |
184 } |
188 break; |
185 break; |
189 |
186 |
190 // Object Size |
187 // Object Size |
230 |
227 |
231 // Name and DataAdded (audio only) fall under the same branch while dateadded(video)/modified/created fall under another |
228 // Name and DataAdded (audio only) fall under the same branch while dateadded(video)/modified/created fall under another |
232 case EMTPObjectPropCodeName: // 0xDC44 |
229 case EMTPObjectPropCodeName: // 0xDC44 |
233 case EMTPObjectPropCodeDateAdded: // 0xDC4E |
230 case EMTPObjectPropCodeDateAdded: // 0xDC4E |
234 { |
231 { |
235 if ( ( propCode == EMTPObjectPropCodeName) |
232 if ( ( propCode == EMTPObjectPropCodeName ) |
236 || ( ( !MmMtpDpUtility::IsVideoL(iObjectInfo->DesC( CMTPObjectMetaData::ESuid ), iFramework ) ) |
233 || ( ( !MmMtpDpUtility::IsVideoL(iObjectInfo->DesC( CMTPObjectMetaData::ESuid ), iFramework ) ) |
237 && ( propCode == EMTPObjectPropCodeDateAdded ) ) ) |
234 && ( propCode == EMTPObjectPropCodeDateAdded ) ) ) |
238 { |
235 { |
239 iMTPTypeString = CMTPTypeString::NewL(); |
236 iMTPTypeString = CMTPTypeString::NewL(); |
240 ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo ); |
237 ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo ); |
241 break; |
238 break; |
242 } |
239 } |