mtpdataproviders/mtpimagedp/src/cmtpimagedpgetobjectreferences.cpp
changeset 49 c20dd21d1eb4
parent 0 d0791faffa3f
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    20 #include <mtp/mmtpreferencemgr.h>
    20 #include <mtp/mmtpreferencemgr.h>
    21 
    21 
    22 #include "cmtpimagedpgetobjectreferences.h"
    22 #include "cmtpimagedpgetobjectreferences.h"
    23 #include "mtpimagedputilits.h"
    23 #include "mtpimagedputilits.h"
    24 #include "cmtpimagedp.h"
    24 #include "cmtpimagedp.h"
       
    25 #include "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "cmtpimagedpgetobjectreferencesTraces.h"
       
    28 #endif
    25 
    29 
    26 __FLOG_STMT(_LIT8(KComponent,"GetObjectReferences");)
       
    27 
    30 
    28 /**
    31 /**
    29 Two-phase construction method
    32 Two-phase construction method
    30 @param aPlugin The data provider plugin
    33 @param aPlugin The data provider plugin
    31 @param aFramework The data provider framework
    34 @param aFramework The data provider framework
    44 /**
    47 /**
    45 Destructor
    48 Destructor
    46 */    
    49 */    
    47 CMTPImageDpGetObjectReferences::~CMTPImageDpGetObjectReferences()
    50 CMTPImageDpGetObjectReferences::~CMTPImageDpGetObjectReferences()
    48     {
    51     {
    49     __FLOG(_L8(">> CMTPImageDpGetObjectReferences::~CMTPImageDpGetObjectReferences"));
    52     OstTraceFunctionEntry0( CMTPIMAGEDPGETOBJECTREFERENCES_CMTPIMAGEDPGETOBJECTREFERENCES_ENTRY );
    50     delete iReferences;
    53     delete iReferences;
    51     __FLOG(_L8("<< CMTPImageDpGetObjectReferences::~CMTPImageDpGetObjectReferences"));
    54     OstTraceFunctionExit0( CMTPIMAGEDPGETOBJECTREFERENCES_CMTPIMAGEDPGETOBJECTREFERENCES_EXIT );
    52     __FLOG_CLOSE;
       
    53     }
    55     }
    54 
    56 
    55 /**
    57 /**
    56 Standard c++ constructor
    58 Standard c++ constructor
    57 */    
    59 */    
    63 /**
    65 /**
    64 Second phase constructor
    66 Second phase constructor
    65 */
    67 */
    66 void CMTPImageDpGetObjectReferences::ConstructL()
    68 void CMTPImageDpGetObjectReferences::ConstructL()
    67     {
    69     {
    68     __FLOG_OPEN(KMTPSubsystem, KComponent);
    70     OstTraceFunctionEntry0( CMTPIMAGEDPGETOBJECTREFERENCES_CONSTRUCTL_ENTRY );
    69     __FLOG(_L8(">> CMTPImageDpGetObjectReferences::ConstructL"));
    71     OstTraceFunctionExit0( CMTPIMAGEDPGETOBJECTREFERENCES_CONSTRUCTL_EXIT );
    70     __FLOG(_L8("<< CMTPImageDpGetObjectReferences::ConstructL"));
       
    71     }
    72     }
    72 
    73 
    73 TMTPResponseCode CMTPImageDpGetObjectReferences::CheckRequestL()
    74 TMTPResponseCode CMTPImageDpGetObjectReferences::CheckRequestL()
    74     {
    75     {
    75     __FLOG(_L8(">> CMTPImageDpGetObjectReferences::CheckRequestL"));
    76     OstTraceFunctionEntry0( CMTPIMAGEDPGETOBJECTREFERENCES_CHECKREQUESTL_ENTRY );
    76     
    77     
    77     TUint32 objectHandle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    78     TUint32 objectHandle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    78     CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC();    
    79     CMTPObjectMetaData* objectInfo = CMTPObjectMetaData::NewLC();    
    79     TMTPResponseCode responseCode = MTPImageDpUtilits::VerifyObjectHandleL(iFramework, objectHandle, *objectInfo);      
    80     TMTPResponseCode responseCode = MTPImageDpUtilits::VerifyObjectHandleL(iFramework, objectHandle, *objectInfo);      
    80     CleanupStack::PopAndDestroy(objectInfo);
    81     CleanupStack::PopAndDestroy(objectInfo);
    81     
    82 
    82     __FLOG_VA((_L8("CheckRequestL - Exit with responseCode = 0x%04X"), responseCode));
    83     OstTrace1( TRACE_NORMAL, CMTPIMAGEDPGETOBJECTREFERENCES_CHECKREQUESTL, "CheckRequestL - Exit with responseCode = 0x%04X", responseCode );
    83     __FLOG(_L8("<< CMTPImageDpGetObjectReferences::CheckRequestL"));
    84     OstTraceFunctionExit0( CMTPIMAGEDPGETOBJECTREFERENCES_CHECKREQUESTL_EXIT );
    84     return responseCode;
    85     return responseCode;
    85     }
    86     }
    86 
    87 
    87 /**
    88 /**
    88 GetReferences request handler
    89 GetReferences request handler
    89 */    
    90 */    
    90 void CMTPImageDpGetObjectReferences::ServiceL()
    91 void CMTPImageDpGetObjectReferences::ServiceL()
    91     {
    92     {
    92     __FLOG(_L8(">> CMTPImageDpCopyObject::ServiceL"));
    93     OstTraceFunctionEntry0( CMTPIMAGEDPGETOBJECTREFERENCES_SERVICEL_ENTRY );
    93     
    94     
    94     TUint32 objectHandle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    95     TUint32 objectHandle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    95     MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr();
    96     MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr();
    96     delete iReferences;
    97     delete iReferences;
    97     iReferences = NULL;
    98     iReferences = NULL;
    98     iReferences = referenceMgr.ReferencesLC(TMTPTypeUint32(objectHandle));
    99     iReferences = referenceMgr.ReferencesLC(TMTPTypeUint32(objectHandle));
    99     CleanupStack::Pop(iReferences);
   100     CleanupStack::Pop(iReferences);
   100     SendDataL(*iReferences);
   101     SendDataL(*iReferences);
   101     __FLOG(_L8("<< CMTPImageDpCopyObject::ServiceL"));
   102     OstTraceFunctionExit0( CMTPIMAGEDPGETOBJECTREFERENCES_SERVICEL_EXIT );
   102     }
   103     }
   103 
   104 
   104 
   105