mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectinfo.cpp
branchRCL_3
changeset 23 e42293e811d8
parent 17 6f9f6e99a23e
equal deleted inserted replaced
22:b034b1c214c2 23:e42293e811d8
    93 // Second-phase construction
    93 // Second-phase construction
    94 // -----------------------------------------------------------------------------
    94 // -----------------------------------------------------------------------------
    95 //
    95 //
    96 EXPORT_C void CGetObjectInfo::ConstructL()
    96 EXPORT_C void CGetObjectInfo::ConstructL()
    97     {
    97     {
    98     CActiveScheduler::Add( this );
       
    99     }
    98     }
   100 
    99 
   101 // -----------------------------------------------------------------------------
   100 // -----------------------------------------------------------------------------
   102 // CGetObjectInfo::ServiceL
   101 // CGetObjectInfo::ServiceL
   103 // GetObjectInfo request handler
   102 // GetObjectInfo request handler
   104 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   105 //
   104 //
   106 void CGetObjectInfo::ServiceL()
   105 void CGetObjectInfo::ServiceL()
   107     {
   106     {
   108     PRINT( _L( "MM MTP => CGetObjectInfo::ServiceL" ) );
   107     PRINT( _L( "MM MTP => CGetObjectInfo::ServiceL" ) );
   109     
   108 
   110     MmMtpDpUtility::SetPSStatus(EMtpPSStatusActive);
   109     MmMtpDpUtility::SetPSStatus(EMtpPSStatusActive);
   111 
   110 
   112     delete iObjectInfo;
   111     delete iObjectInfo;
   113     iObjectInfo = NULL;
   112     iObjectInfo = NULL;
   114     iObjectInfo = CMTPTypeObjectInfo::NewL();
   113     iObjectInfo = CMTPTypeObjectInfo::NewL();
   172     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EImagePixHeight, height );
   171     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EImagePixHeight, height );
   173 
   172 
   174     // Image Bit Depth
   173     // Image Bit Depth
   175     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EImageBitDepth, 0 );
   174     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EImageBitDepth, 0 );
   176     // Parent Object
   175     // Parent Object
   177     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EParentObject,
   176     TUint32 parentHandle = object->Uint( CMTPObjectMetaData::EParentHandle );
   178         object->Uint( CMTPObjectMetaData::EParentHandle ) );
   177     // refer to 5.3.1.9 of MTP Spec 1.0
       
   178     if ( parentHandle == KMTPHandleNoParent )
       
   179         {
       
   180         parentHandle = KMTPHandleNone;
       
   181         }
       
   182     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EParentObject, parentHandle );
   179     // Association Type
   183     // Association Type
   180     iObjectInfo->SetUint16L( CMTPTypeObjectInfo::EAssociationType, 0 );
   184     iObjectInfo->SetUint16L( CMTPTypeObjectInfo::EAssociationType, 0 );
   181     // Association Description
   185     // Association Description
   182     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EAssociationDescription, 0 );
   186     iObjectInfo->SetUint32L( CMTPTypeObjectInfo::EAssociationDescription, 0 );
   183     // *Sequence Number
   187     // *Sequence Number