--- a/contentmgmt/contentaccessfwfordrm/source/f32agent/f32agentcontent.cpp Thu Aug 19 11:38:48 2010 +0300
+++ b/contentmgmt/contentaccessfwfordrm/source/f32agent/f32agentcontent.cpp Tue Aug 31 17:00:08 2010 +0300
@@ -42,6 +42,16 @@
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()
{
@@ -56,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)
@@ -74,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;
@@ -158,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
@@ -177,7 +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)
{
@@ -199,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
@@ -218,7 +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)
{
@@ -240,6 +376,8 @@
return err;
}
+#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
+
TInt CF32AgentContent::AgentSpecificCommand(TInt , const TDesC8& , TDes8& )
{
return KErrCANotSupported;