mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csetobjectreferences.cpp
branchGCC_SURGE
changeset 47 f3d2589f22d6
parent 35 2ee890d2f7e7
equal deleted inserted replaced
36:3b7506f63335 47:f3d2589f22d6
    68 // Two-phase construction method
    68 // Two-phase construction method
    69 // -----------------------------------------------------------------------------
    69 // -----------------------------------------------------------------------------
    70 //
    70 //
    71 void CSetObjectReferences::ConstructL()
    71 void CSetObjectReferences::ConstructL()
    72     {
    72     {
    73     SetPSStatus();
       
    74     }
    73     }
    75 
    74 
    76 // -----------------------------------------------------------------------------
    75 // -----------------------------------------------------------------------------
    77 // CSetObjectReferences::~CSetObjectReferences
    76 // CSetObjectReferences::~CSetObjectReferences
    78 // Destructor
    77 // Destructor
    87 // -----------------------------------------------------------------------------
    86 // -----------------------------------------------------------------------------
    88 // CSetObjectReferences::CSetObjectReferences
    87 // CSetObjectReferences::CSetObjectReferences
    89 // Standard c++ constructor
    88 // Standard c++ constructor
    90 // -----------------------------------------------------------------------------
    89 // -----------------------------------------------------------------------------
    91 //
    90 //
    92 EXPORT_C CSetObjectReferences::CSetObjectReferences( MMTPDataProviderFramework& aFramework,
    91 CSetObjectReferences::CSetObjectReferences( MMTPDataProviderFramework& aFramework,
    93     MMTPConnection& aConnection,
    92     MMTPConnection& aConnection,
    94     MMmMtpDpConfig& aDpConfig ) :
    93     MMmMtpDpConfig& aDpConfig ) :
    95         CRequestProcessor( aFramework,
    94         CRequestProcessor( aFramework,
    96             aConnection,
    95             aConnection,
    97             sizeof( KMTPSetObjectReferencesPolicy ) / sizeof( TMTPRequestElementInfo ),
    96             sizeof( KMTPSetObjectReferencesPolicy ) / sizeof( TMTPRequestElementInfo ),
   104 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   105 // CSetObjectReferences::DoSetObjectReferencesL
   104 // CSetObjectReferences::DoSetObjectReferencesL
   106 // set references to DB
   105 // set references to DB
   107 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
   108 //
   107 //
   109 EXPORT_C void CSetObjectReferences::DoSetObjectReferencesL( const CMTPObjectMetaData& aObject )
   108 void CSetObjectReferences::DoSetObjectReferencesL( const CMTPObjectMetaData& aObject )
   110     {
   109     {
   111     TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode );
   110     TUint formatCode = aObject.Uint( CMTPObjectMetaData::EFormatCode );
   112     TBool hasReference = MmMtpDpUtility::HasReference( formatCode );
   111     TBool hasReference = MmMtpDpUtility::HasReference( formatCode );
   113 
   112 
   114     if ( hasReference )
   113     if ( hasReference )
   124 // -----------------------------------------------------------------------------
   123 // -----------------------------------------------------------------------------
   125 //
   124 //
   126 EXPORT_C void CSetObjectReferences::ServiceL()
   125 EXPORT_C void CSetObjectReferences::ServiceL()
   127     {
   126     {
   128     PRINT( _L( "MM MTP => CSetObjectReferences::ServiceL" ) );
   127     PRINT( _L( "MM MTP => CSetObjectReferences::ServiceL" ) );
       
   128     
       
   129     MmMtpDpUtility::SetPSStatus(EMtpPSStatusActive);
       
   130     
   129     delete iReferences;
   131     delete iReferences;
   130     iReferences = NULL;
   132     iReferences = NULL;
   131     iReferences = CMTPTypeArray::NewL( EMTPTypeAUINT32 );
   133     iReferences = CMTPTypeArray::NewL( EMTPTypeAUINT32 );
   132     ReceiveDataL( *iReferences );
   134     ReceiveDataL( *iReferences );
   133     PRINT( _L( "MM MTP <= CSetObjectReferences::ServiceL" ) );
   135     PRINT( _L( "MM MTP <= CSetObjectReferences::ServiceL" ) );
   160 
   162 
   161         CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); // + object
   163         CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); // + object
   162         iFramework.ObjectMgr().ObjectL( objectHandle, *object );
   164         iFramework.ObjectMgr().ObjectL( objectHandle, *object );
   163         PRINT1( _L( "MM MTP <> object file name is %S" ), &(object->DesC( CMTPObjectMetaData::ESuid ) ) );
   165         PRINT1( _L( "MM MTP <> object file name is %S" ), &(object->DesC( CMTPObjectMetaData::ESuid ) ) );
   164         DoSetObjectReferencesL( *object );
   166         DoSetObjectReferencesL( *object );
       
   167         
       
   168         // set it to something else other than EMTPSubFormatCodeUnknown to prevent being queried from MPX later in the same session
       
   169         object->SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPSubFormatCodeUndefined );
       
   170         iFramework.ObjectMgr().ModifyObjectL( *object );
   165 
   171 
   166         CleanupStack::PopAndDestroy( object ); // - object
   172         CleanupStack::PopAndDestroy( object ); // - object
   167 
   173 
   168         SendResponseL( EMTPRespCodeOK );
   174         SendResponseL( EMTPRespCodeOK );
   169         }
   175         }