harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp
changeset 20 6dfc5f825351
parent 0 c53acadfccc6
child 15 3cebc1a84278
child 21 50bf9db68373
equal deleted inserted replaced
3:b73a2e62868f 20:6dfc5f825351
   264     			*iPropDefs->iLastModifiedDatePropertyDef, &aVHD.iModified, aIsAdd );
   264     			*iPropDefs->iLastModifiedDatePropertyDef, &aVHD.iModified, aIsAdd );
   265     	// File size
   265     	// File size
   266     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   266     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   267     			*iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd );
   267     			*iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd );
   268     	}
   268     	}
       
   269     
       
   270     // Item Type
       
   271     if(aVHD.iMimetype.Length() > 0)
       
   272         {
       
   273         TBool isAdd( EFalse );
       
   274         CMdEProperty* prop = NULL;
       
   275         TInt index = mdeObject.Property( *iPropDefs->iItemTypePropertyDef, prop );
       
   276         if( index < 0 )
       
   277             {
       
   278             isAdd = ETrue;
       
   279             }
       
   280         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
       
   281                 *iPropDefs->iItemTypePropertyDef, &aVHD.iMimetype, isAdd );
       
   282         }
       
   283     
   269     // DRM protection
   284     // DRM protection
   270     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   285     CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   271     		*iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd );
   286     		*iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd );
   272     
   287     
   273     // Item Type
       
   274     if(aVHD.iMimetype.Length() > 0)
       
   275     	{
       
   276     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
       
   277     			*iPropDefs->iItemTypePropertyDef, &aVHD.iMimetype, aIsAdd );
       
   278     	}
       
   279     // Title (is set from URI by default)
   288     // Title (is set from URI by default)
   280     if(aVHD.iTitle.Length() > 0)
   289     if(aVHD.iTitle.Length() > 0)
   281     	{
   290     	{
   282     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   291     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
   283     			*iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse );
   292     			*iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse );
   355     	}
   364     	}
   356     
   365     
   357 	WRITELOG1( "CHarvesterOMADRMPlugin::GetObjectType - ERROR: mimetype %S. No object type found", &mime );
   366 	WRITELOG1( "CHarvesterOMADRMPlugin::GetObjectType - ERROR: mimetype %S. No object type found", &mime );
   358 	aObjectType.Zero();
   367 	aObjectType.Zero();
   359 	}
   368 	}
       
   369 
       
   370 // ---------------------------------------------------------------------------
       
   371 // CHarvesterOMADRMPlugin::GetMimeType (from CHarvesterPlugin)
       
   372 // ---------------------------------------------------------------------------
       
   373 //    
       
   374 void CHarvesterOMADRMPlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
       
   375     {
       
   376     aMimeType.Zero();
       
   377     
       
   378     ContentAccess::CContent* content = NULL;
       
   379     
       
   380     TRAPD( err, content = ContentAccess::CContent::NewL( aUri ) );
       
   381     if (err == KErrNone) 
       
   382         {
       
   383         err = content->GetStringAttribute( ContentAccess::EMimeType, aMimeType );
       
   384         delete content;
       
   385         }
       
   386     }
       
   387