14 * Description: Implement operation: GetObjectInfo |
14 * Description: Implement operation: GetObjectInfo |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <mtp/mmtpdataproviderframework.h> |
|
20 #include <mtp/cmtptypeobjectinfo.h> |
19 #include <mtp/cmtptypeobjectinfo.h> |
21 #include <f32file.h> |
20 #include <f32file.h> |
22 |
21 |
23 #include "mmmtpdputility.h" |
22 #include "mmmtpdputility.h" |
24 #include "cgetobjectinfo.h" |
23 #include "cgetobjectinfo.h" |
25 #include "cmmmtpdpmetadataaccesswrapper.h" |
24 #include "cmmmtpdpmetadataaccesswrapper.h" |
26 #include "tmmmtpdppanic.h" |
25 #include "tmmmtpdppanic.h" |
27 #include "mmmtpdplogger.h" |
26 #include "mmmtpdplogger.h" |
28 #include "mmmtpdpconfig.h" |
27 #include "mmmtpdpconfig.h" |
29 |
28 #include "tobjectdescription.h" |
30 _LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" ); |
29 |
31 const TInt KMtpMaxDateTimeStringLength = 15; |
|
32 |
30 |
33 // ----------------------------------------------------------------------------- |
31 // ----------------------------------------------------------------------------- |
34 // Verification data for GetObjectInfo request |
32 // Verification data for GetObjectInfo request |
35 // ----------------------------------------------------------------------------- |
33 // ----------------------------------------------------------------------------- |
36 // |
34 // |
162 iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EThumbPixHeight, 0 ); |
160 iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EThumbPixHeight, 0 ); |
163 |
161 |
164 TUint32 width(0); |
162 TUint32 width(0); |
165 TUint32 height(0); |
163 TUint32 height(0); |
166 TInt err = KErrNone; |
164 TInt err = KErrNone; |
167 TRAP( err, iDpConfig.GetWrapperL().GetImageObjPropL( suid, width, height ) ); |
165 TRAP( err, iDpConfig.GetWrapperL().GetImageObjPropL( *object, width, height ) ); |
168 if( err != KErrNone ) |
166 if( err != KErrNone ) |
169 PRINT1( _L( "MM MTP <> CGetObjectInfo::BuildObjectInfoL TRAP iWrapper.GetImageObjPropL err = %d" ), err ); |
167 PRINT1( _L( "MM MTP <> CGetObjectInfo::BuildObjectInfoL TRAP iWrapper.GetImageObjPropL err = %d" ), err ); |
170 |
168 |
171 // Image Pix Width |
169 // Image Pix Width |
172 iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EImagePixWidth, width ); |
170 iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EImagePixWidth, width ); |
186 iObjectInfo->SetUint32L( CMTPTypeObjectInfo::ESequenceNumber, 0 ); |
184 iObjectInfo->SetUint32L( CMTPTypeObjectInfo::ESequenceNumber, 0 ); |
187 // Filename |
185 // Filename |
188 TParsePtrC parse( suid ); |
186 TParsePtrC parse( suid ); |
189 iObjectInfo->SetStringL( CMTPTypeObjectInfo::EFilename, parse.NameAndExt() ); |
187 iObjectInfo->SetStringL( CMTPTypeObjectInfo::EFilename, parse.NameAndExt() ); |
190 |
188 |
191 TTime dataModified; |
|
192 dataModified = MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(), suid ); |
|
193 |
|
194 TBuf<KMtpMaxDateTimeStringLength> date; |
189 TBuf<KMtpMaxDateTimeStringLength> date; |
195 dataModified.FormatL( date, KMtpDateTimeFormat ); |
190 MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(), suid, date ); |
|
191 |
196 PRINT1( _L( "MM MTP <> CGetObjectInfo::BuildObjectInfo date is %S" ), &date ); |
192 PRINT1( _L( "MM MTP <> CGetObjectInfo::BuildObjectInfo date is %S" ), &date ); |
197 |
193 |
198 // Date Created |
194 // Date Created |
199 iObjectInfo->SetStringL( CMTPTypeObjectInfo::EDateCreated, date ); |
195 iObjectInfo->SetStringL( CMTPTypeObjectInfo::EDateCreated, date ); |
200 // Date Modified |
196 // Date Modified |