photosgallery/viewframework/drmutility/src/glxdrmutility.cpp
branchRCL_3
changeset 32 78ad99c24f08
parent 18 bcb43dc84c44
child 56 b023a8d2866a
--- a/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp	Tue May 25 12:42:31 2010 +0300
@@ -154,6 +154,23 @@
     }
 
 //============================================================================
+// ItemRightsValidityCheckL
+// for checking DRM rights validity for item.
+// is called before right is consumed and for all items (focused or unfocused).
+//============================================================================
+EXPORT_C TBool CGlxDRMUtility::ItemRightsValidityCheckL( RFile& aFileHandle,
+                                                TBool aCheckViewRights )
+    {
+    TRACER("CGlxDRMUtility::ItemRightsValidityCheckL()");
+    TBool rightsValid = EFalse;
+
+    ContentAccess::CContent* content = ContentAccess::CContent::NewLC( aFileHandle );
+    TInt err( content->GetAttribute( ContentAccess::ECanView, rightsValid ) );
+    CleanupStack::PopAndDestroy( content );
+    return rightsValid;
+    }
+
+//============================================================================
 // DisplayItemRightsCheckL
 // is called after right is consumed and for only focused/displayed item.
 //============================================================================
@@ -179,6 +196,19 @@
     }
 
 //============================================================================
+// DisplayItemRightsCheckL
+// is called after right is consumed and for only focused/displayed item.
+//============================================================================
+EXPORT_C TBool CGlxDRMUtility::DisplayItemRightsCheckL( RFile& aFileHandle,
+                                                    TBool aCheckViewRights )
+    {
+    TRACER("CGlxDRMUtility::DisplayItemRightsCheckL()");
+    // Otherwise, check current rights for the URI of newly focused item
+    return ItemRightsValidityCheckL( aFileHandle, aCheckViewRights );
+    }
+
+
+//============================================================================
 // ConsumeRightsL
 //============================================================================    
 EXPORT_C TBool CGlxDRMUtility::ConsumeRightsL(const TDesC& aUri)
@@ -209,6 +239,19 @@
     return (err == KErrNone);
     }
 
+
+//============================================================================
+// ConsumeRightsL
+//============================================================================    
+EXPORT_C TBool CGlxDRMUtility::ConsumeRightsL(RFile& aFileHandle)
+    {
+    TRACER("CGlxDRMUtility::ConsumeRightsL(RFile& aFileHandle)");
+    CData* data = CData::NewLC( aFileHandle, KDefaultContentObject(), EPeek );
+    TInt err = data->ExecuteIntent(ContentAccess::EView);
+    CleanupStack::PopAndDestroy( data );
+    return (err == KErrNone);
+    }
+
 //============================================================================
 //Clears Last Consumed Uri
 //============================================================================
@@ -315,6 +358,21 @@
     }
 
 //============================================================================
+// ShowDRMDetailsPane
+//============================================================================  
+EXPORT_C void CGlxDRMUtility::ShowDRMDetailsPaneL(RFile& aFileHandle)
+    {
+    TRACER("CGlxDRMUtility::ShowDRMDetailsPaneL()");
+    TRAPD( err, iDrmHelper->LaunchDetailsViewEmbeddedL( aFileHandle ) );
+    // if no rights ask user to re-activate
+    if( err == KErrCANoRights )
+        {
+        //need to check if we need to handle.
+        }
+
+    }
+
+//============================================================================
 // IsForwardLockedL
 //============================================================================  
 EXPORT_C TBool CGlxDRMUtility::IsForwardLockedL(const TDesC& aUri)
@@ -339,6 +397,15 @@
     }
 
 //============================================================================
+// ShowRightsInfoL
+//============================================================================    
+EXPORT_C void CGlxDRMUtility::ShowRightsInfoL(RFile& aFileHandle)    
+    {
+    TRACER("CGlxDRMUtility::ShowRightsInfoL(aFileHandle)");
+    iDrmHelper->CheckRightsAmountL( aFileHandle );
+    }
+
+//============================================================================
 // Return size for DRM thumbnail request.
 //============================================================================
 EXPORT_C TSize CGlxDRMUtility::DRMThumbnailSize(TSize& aSize)