mtpdataproviders/mtpimagedp/src/cmtpimagedpgetobjectpropvalue.cpp
changeset 49 c20dd21d1eb4
parent 29 3ae5cb0b4c02
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    35 #include "mtpimagedpconst.h"
    35 #include "mtpimagedpconst.h"
    36 #include "cmtpimagedpobjectpropertymgr.h"
    36 #include "cmtpimagedpobjectpropertymgr.h"
    37 #include "mtpimagedppanic.h"
    37 #include "mtpimagedppanic.h"
    38 #include "cmtpimagedp.h"
    38 #include "cmtpimagedp.h"
    39 #include "mtpimagedputilits.h"
    39 #include "mtpimagedputilits.h"
    40 
    40 #include "OstTraceDefinitions.h"
    41 
    41 #ifdef OST_TRACE_COMPILER_IN_USE
    42 __FLOG_STMT(_LIT8(KComponent,"GetObjectPropValue");)
    42 #include "cmtpimagedpgetobjectpropvalueTraces.h"
       
    43 #endif
       
    44 
       
    45 
    43 
    46 
    44 /**
    47 /**
    45 Two-phase construction method
    48 Two-phase construction method
    46 @param aPlugin	The data provider plugin
    49 @param aPlugin	The data provider plugin
    47 @param aFramework	The data provider framework
    50 @param aFramework	The data provider framework
    65 CMTPImageDpGetObjectPropValue::~CMTPImageDpGetObjectPropValue()
    68 CMTPImageDpGetObjectPropValue::~CMTPImageDpGetObjectPropValue()
    66     {
    69     {
    67     delete iMTPTypeString;	
    70     delete iMTPTypeString;	
    68     delete iMTPTypeArray;
    71     delete iMTPTypeArray;
    69     delete iObjectMeta;
    72     delete iObjectMeta;
    70     __FLOG_CLOSE;
       
    71     }
    73     }
    72 
    74 
    73 /**
    75 /**
    74 Standard c++ constructor
    76 Standard c++ constructor
    75 */		
    77 */		
    77                                     MMTPDataProviderFramework& aFramework,
    79                                     MMTPDataProviderFramework& aFramework,
    78                                     MMTPConnection& aConnection,CMTPImageDataProvider& aDataProvider)
    80                                     MMTPConnection& aConnection,CMTPImageDataProvider& aDataProvider)
    79     :CMTPRequestProcessor(aFramework, aConnection,0, NULL),
    81     :CMTPRequestProcessor(aFramework, aConnection,0, NULL),
    80     iObjectPropertyMgr(aDataProvider.PropertyMgr())
    82     iObjectPropertyMgr(aDataProvider.PropertyMgr())
    81     {
    83     {
    82     __FLOG_OPEN(KMTPSubsystem, KComponent);	
       
    83     }
    84     }
    84 
    85 
    85 /**
    86 /**
    86 Second-phase construction
    87 Second-phase construction
    87 */                  
    88 */                  
   187         case EMTPObjectPropCodeRepresentativeSampleData:
   188         case EMTPObjectPropCodeRepresentativeSampleData:
   188             ServiceRepresentativeSampleDataL();
   189             ServiceRepresentativeSampleDataL();
   189             break;
   190             break;
   190         case EMTPObjectPropCodeNonConsumable:
   191         case EMTPObjectPropCodeNonConsumable:
   191             ServiceNonConsumableL();
   192             ServiceNonConsumableL();
   192             break;            
   193             break;
       
   194         case EMTPObjectPropCodeHidden:
       
   195             ServiceHiddenL();
       
   196             break;
   193         default:
   197         default:
       
   198             OstTrace1( TRACE_ERROR, CMTPIMAGEDPGETOBJECTPROPVALUE_SERVICEL, "Invalid property code %d", propCode);
   194             User::Leave(KErrGeneral);
   199             User::Leave(KErrGeneral);
   195         }	
   200         }	
   196     }	
   201     }	
   197 
   202 
   198 void CMTPImageDpGetObjectPropValue::ServiceStorageIdL()
   203 void CMTPImageDpGetObjectPropValue::ServiceStorageIdL()
   351     TUint8 nonConsumable;
   356     TUint8 nonConsumable;
   352     iObjectPropertyMgr.GetPropertyL(EMTPObjectPropCodeNonConsumable, nonConsumable);
   357     iObjectPropertyMgr.GetPropertyL(EMTPObjectPropCodeNonConsumable, nonConsumable);
   353     iMTPTypeUint8.Set(nonConsumable);
   358     iMTPTypeUint8.Set(nonConsumable);
   354     SendDataL(iMTPTypeUint8);
   359     SendDataL(iMTPTypeUint8);
   355     }
   360     }
       
   361 
       
   362 void CMTPImageDpGetObjectPropValue::ServiceHiddenL()
       
   363     {
       
   364     TUint16 hiddenStatus;
       
   365     iObjectPropertyMgr.GetPropertyL(EMTPObjectPropCodeHidden, hiddenStatus);
       
   366     iMTPTypeUint16.Set(hiddenStatus);
       
   367     SendDataL(iMTPTypeUint16);
       
   368     }