contentmgmt/contentaccessfwfordrm/source/f32agent/f32agentcontent.cpp
changeset 15 da2ae96f639b
parent 8 35751d3474b7
child 33 cf642210ecb7
--- a/contentmgmt/contentaccessfwfordrm/source/f32agent/f32agentcontent.cpp	Fri Oct 02 13:15:59 2009 +0300
+++ b/contentmgmt/contentaccessfwfordrm/source/f32agent/f32agentcontent.cpp	Mon Oct 12 10:17:04 2009 +0300
@@ -42,6 +42,17 @@
 	return self;
 	}
 
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+CF32AgentContent* CF32AgentContent::NewL(const TDesC8& aHeaderData)
+	{
+	CF32AgentContent* self = new (ELeave) CF32AgentContent;
+	CleanupStack::PushL(self);
+	self->ConstructL(aHeaderData);
+	CleanupStack::Pop(self);
+	return self;
+	}
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+	
 CF32AgentContent::CF32AgentContent()
 	{
 	}
@@ -55,6 +66,10 @@
 		iFs.Close();
 		}
 	delete iURI;
+	
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT	
+	delete iHeaderData;
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
 	}
   
 void CF32AgentContent::ConstructL(const TDesC& aURI, TContentShareMode aShareMode)
@@ -73,6 +88,16 @@
 	User::LeaveIfError(iFile.Duplicate(aFile));
 	}
 
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT	
+void CF32AgentContent::ConstructL(const TDesC8& aHeaderData)
+	{
+	if(aHeaderData.Length() > 0)
+		iHeaderData = aHeaderData.AllocL();
+	else
+		User::Leave(KErrMissingWmdrmHeaderData);
+	}
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
 TInt CF32AgentContent::OpenContainer(const TDesC&)
 	{
 	return KErrNotFound;
@@ -157,6 +182,33 @@
 	return err;
 	}
 
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+TInt CF32AgentContent::GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId)
+	{
+	
+	// check that the unique Id exists
+	if(TF32DefaultAttributes::CheckUniqueId(aUniqueId) != KErrNone)
+		{
+		return KErrNotFound;	
+		}
+	
+	TInt err = KErrNone;
+	if(iURI)
+		{
+		err = TF32DefaultAttributes::GetAttribute(aAttribute, aValue, *iURI);
+		}
+	else if(iHeaderData)
+		{
+		err = TF32DefaultAttributes::GetAttribute(*iHeaderData, aAttribute, aValue);
+		}
+	else
+		{
+		err = TF32DefaultAttributes::GetAttribute(aAttribute, aValue, iFile);
+		}
+	return err;
+	}
+
+#else
 TInt CF32AgentContent::GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId)
 	{
 	// check that the unique Id exists
@@ -176,6 +228,35 @@
 		}
 	return err;
 	}
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
+TInt CF32AgentContent::GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId)
+	{
+	// check that the unique Id exists
+	if(TF32DefaultAttributes::CheckUniqueId(aUniqueId) != KErrNone)
+		{
+		return KErrNotFound;	
+		}
+		
+	TInt err = KErrNone;
+	if(iURI)
+		{
+		err = TF32DefaultAttributes::GetAttributeSet(aAttributeSet, *iURI);
+		}
+	else if(iHeaderData)
+		{
+		err = TF32DefaultAttributes::GetAttributeSet(*iHeaderData, aAttributeSet);
+		}
+	else
+		{
+		err = TF32DefaultAttributes::GetAttributeSet(aAttributeSet, iFile);
+		}
+	return err;
+	}
+
+#else
 
 TInt CF32AgentContent::GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId)
 	{
@@ -197,6 +278,35 @@
 	return err;
 	}
 
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
+TInt CF32AgentContent::GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId)
+	{
+	// check that the unique Id exists
+	if(TF32DefaultAttributes::CheckUniqueId(aUniqueId) != KErrNone)
+		{
+		return KErrNotFound;	
+		}
+		
+	TInt err = KErrNone;
+	if(iURI)
+		{
+		err = TF32DefaultAttributes::GetStringAttribute(aAttribute, aValue, *iURI);
+		}
+	else if(iHeaderData)
+		{
+		err = TF32DefaultAttributes::GetStringAttribute(*iHeaderData, aAttribute, aValue);
+		}
+	else
+		{
+		err = TF32DefaultAttributes::GetStringAttribute(aAttribute, aValue, iFile);
+		}
+	return err;
+	}
+
+#else
 TInt CF32AgentContent::GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId)
 	{
 	// check that the unique Id exists
@@ -216,6 +326,35 @@
 		}
 	return err;
 	}
+#endif
+
+#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
+TInt CF32AgentContent::GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId)
+	{
+	// check that the unique Id exists
+	if(TF32DefaultAttributes::CheckUniqueId(aUniqueId) != KErrNone)
+		{
+		return KErrNotFound;	
+		}
+	
+	TInt err = KErrNone;
+	if(iURI)
+		{
+		err = TF32DefaultAttributes::GetStringAttributeSet(aStringAttributeSet, *iURI);
+		}
+	else if(iHeaderData)
+		{
+		err = TF32DefaultAttributes::GetStringAttributeSet(*iHeaderData, aStringAttributeSet);
+		}
+	else
+		{
+		err = TF32DefaultAttributes::GetStringAttributeSet(aStringAttributeSet, iFile);
+		}
+	return err;
+	}
+
+#else
 
 TInt CF32AgentContent::GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId)
 	{
@@ -237,6 +376,8 @@
 	return err;
 	}
 
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
 TInt CF32AgentContent::AgentSpecificCommand(TInt , const TDesC8& , TDes8& )
 	{
 	return KErrCANotSupported;