mtpdataproviders/mtpimagedp/src/mtpimagedpgetformatcapabilities.cpp
branchRCL_3
changeset 3 8b094906a049
parent 2 4843bb5893b6
equal deleted inserted replaced
2:4843bb5893b6 3:8b094906a049
    49     {
    49     {
    50     __FLOG(_L8(">> CMTPPictureDpGetFormatCapabilities::ServiceL"));
    50     __FLOG(_L8(">> CMTPPictureDpGetFormatCapabilities::ServiceL"));
    51     delete iCapabilityList;
    51     delete iCapabilityList;
    52     iCapabilityList = NULL;
    52     iCapabilityList = NULL;
    53     iCapabilityList = CMTPTypeFormatCapabilityList::NewL();
    53     iCapabilityList = CMTPTypeFormatCapabilityList::NewL();
    54     BuildFormatExifJpegL();
    54     
       
    55     if (iFormatCode == KMTPFormatsAll)
       
    56         {
       
    57         TInt count(sizeof(KMTPImageDpSupportFormatCodes) / sizeof(KMTPImageDpSupportFormatCodes[0]));
       
    58         for (TInt i(0); i<count; i++ )
       
    59             {
       
    60             ServiceOneFormatCapabilitiesL(KMTPImageDpSupportFormatCodes[i]);
       
    61             }    
       
    62         }
       
    63     else
       
    64         {
       
    65         ServiceOneFormatCapabilitiesL(iFormatCode);
       
    66         }
       
    67 
    55     SendDataL(*iCapabilityList); 
    68     SendDataL(*iCapabilityList); 
    56     __FLOG(_L8("<< CMTPPictureDpGetFormatCapabilities::ServiceL"));   
    69     __FLOG(_L8("<< CMTPPictureDpGetFormatCapabilities::ServiceL"));   
    57     }
    70     }
    58     
    71     
    59 void CMTPImageDpGetFormatCapabilities::BuildFormatExifJpegL()
    72 void CMTPImageDpGetFormatCapabilities::ServiceOneFormatCapabilitiesL(TUint aFormatCode)
    60     {
    73     {
    61     __FLOG(_L8(">> CMTPPictureDpGetFormatCapabilities::BuildFormatExifJpegL"));
    74     __FLOG(_L8(">> CMTPPictureDpGetFormatCapabilities::BuildFormatExifJpegL"));
    62     CMTPTypeInterdependentPropDesc*  interDesc = CMTPTypeInterdependentPropDesc::NewLC();
    75     CMTPTypeInterdependentPropDesc*  interDesc = CMTPTypeInterdependentPropDesc::NewLC();
    63     CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewLC( EMTPFormatCodeEXIFJPEG ,interDesc );
    76     CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewLC(aFormatCode, interDesc);
    64     
    77     
    65     //EMTPObjectPropCodeStorageID
    78     //EMTPObjectPropCodeStorageID
    66     CMTPTypeObjectPropDesc* desc = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeStorageID);
    79     CMTPTypeObjectPropDesc* desc = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeStorageID);
    67     desc->SetUint32L(CMTPTypeObjectPropDesc::EGroupCode, GetPropertyGroupNumber(EMTPObjectPropCodeStorageID)); 
    80     desc->SetUint32L(CMTPTypeObjectPropDesc::EGroupCode, GetPropertyGroupNumber(EMTPObjectPropCodeStorageID)); 
    68     frmCap->AppendL(desc);
    81     frmCap->AppendL(desc);
   246 
   259 
   247 
   260 
   248 TMTPResponseCode CMTPImageDpGetFormatCapabilities::CheckRequestL()
   261 TMTPResponseCode CMTPImageDpGetFormatCapabilities::CheckRequestL()
   249     {
   262     {
   250     __FLOG(_L8(">> CMTPPictureDpGetFormatCapabilities::CheckRequestL"));
   263     __FLOG(_L8(">> CMTPPictureDpGetFormatCapabilities::CheckRequestL"));
       
   264     TMTPResponseCode response = EMTPRespCodeOK;
   251     iFormatCode = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
   265     iFormatCode = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
   252     if((iFormatCode != EMTPFormatCodeEXIFJPEG) && (iFormatCode != KMTPFormatsAll))
   266     
   253         {
   267     if (iFormatCode != KMTPFormatsAll)
   254         return EMTPRespCodeInvalidObjectFormatCode;
   268         {
   255         }
   269         response = EMTPRespCodeInvalidObjectFormatCode;
   256     __FLOG(_L8("<< CMTPPictureDpGetFormatCapabilities::CheckRequestL"));   
   270         TInt count(sizeof(KMTPImageDpSupportFormatCodes) / sizeof(KMTPImageDpSupportFormatCodes[0]));
   257     return EMTPRespCodeOK; 
   271         for (TInt i(0); i<count; i++ )
       
   272             {
       
   273             if (iFormatCode == KMTPImageDpSupportFormatCodes[i])
       
   274                 {
       
   275                 response = EMTPRespCodeOK;
       
   276                 break;
       
   277                 }
       
   278             }        
       
   279         }
       
   280     __FLOG_VA((_L8("<< CMTPPictureDpGetFormatCapabilities::CheckRequestL - response = 0x%x"), response));   
       
   281     return response; 
   258     }
   282     }
   259     
   283     
   260 
   284 
   261 CMTPImageDpGetFormatCapabilities::CMTPImageDpGetFormatCapabilities(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection) :
   285 CMTPImageDpGetFormatCapabilities::CMTPImageDpGetFormatCapabilities(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection) :
   262     CMTPRequestProcessor(aFramework, aConnection, 0, NULL)
   286     CMTPRequestProcessor(aFramework, aConnection, 0, NULL)