sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: //
sl@0: // The Rights manager API gives simple access to the rights within a CAF agent implementing a DRM scheme. sl@0: // The rights are represented in a generic form using the ContentAccess::CRightsInfo class. This simple class sl@0: // just holds a text description of the rights and some simple properties assocaiated with those sl@0: // rights. sl@0: // The Rights manager also allows applications to determine which content files are assocated with sl@0: // each Rights object and vice versa. sl@0: //
sl@0: // The ContentAccess::CRightsManager object is created by the ContentAccess::CManager object to look at the rights stored by a sl@0: // particular content access agent. sl@0: // // create the CManager object sl@0: // CManager* manager = CManager::NewL(); sl@0: // //Create RPointerArray to store pointers to the agents sl@0: // RPointerArray agentArray; sl@0: // // Get the list of agents sl@0: // manager->ListAgentsL(agentArray); sl@0: // // Create a CRightsManager for the first agent sl@0: // CRightsManager *rightsManager = manager->CreateRightsManagerL(agentArray[0]); sl@0: //
sl@0: // The ContentAccess::CRightsManager::ListAllRightsL() function produces a list of all the rights stored sl@0: // in the given a DRM agent. sl@0: // // Create the array to store Rights objects sl@0: // RStreamablePtrArray myArray; sl@0: // CleanupClosePushL(myArray); sl@0: // // Get the Rights objects from the agent sl@0: // rightsManager->ListAllRightsL(myArray); sl@0: // // count the number of Rights objects sl@0: // TInt numRights = myArray.Count(); sl@0: // // clear the contents of the array sl@0: // CleanupStack::PopAndDestroy(); sl@0: //
sl@0: // The ContentAccess::CRightsManager::ListRightsL() function produces a list of all the rights stored sl@0: // in the given a DRM agent that are associated with the file at a given URI. sl@0: // // Create the array to store Rights objects sl@0: // RStreamablePtrArray myArray; sl@0: // CleanupClosePushL(myArray); sl@0: // // Get the Rights objects assocated with the content sl@0: // rightsManager->ListRightsL(myArray, uri); sl@0: // // Count the number of Rights objects associated with the content sl@0: // TInt numRights = myArray.Count(); sl@0: // // clear the contents of the array sl@0: // CleanupStack::PopAndDestroy(); sl@0: //
sl@0: // The ContentAccess::CRightsManager::ListRightsL() function produces a list of all the rights stored sl@0: // in the given a DRM agent that are associated with the content object at a given virtual path sl@0: // // Create the array to store Rights objects sl@0: // RStreamablePtrArray myArray; sl@0: // CleanupClosePushL(myArray); sl@0: // // Get the Rights objects assocated with the content sl@0: // rightsManager->ListRightsL(myArray, virtualPath); sl@0: // // Count the number of Rights objects associated with the content sl@0: // TInt numRights = myArray.Count(); sl@0: // // clear the contents of the array sl@0: // CleanupStack::PopAndDestroy(); sl@0: //
sl@0: // The ContentAccess::CRightsManager::ListContentL() function produces a list of all the content sl@0: // that is associated with the given Rights object. sl@0: // // Create the array to store Rights objects sl@0: // RStreamablePtrArray rightsArray; sl@0: // CleanupClosePushL(rightsArray); sl@0: // rightsManager->ListAllRightsL(rightsArray); sl@0: // // get the first CRightsInfo object sl@0: // CRightsInfo* rightsObject = rightsArray[0]; sl@0: // RStreamablePtrArray contentArray; sl@0: // CleanupClosePushL(contentArray); sl@0: // // Get the array of content objects associated with the rights sl@0: // rightsManager->ListContentL(contentArray, rightsObject); sl@0: // // count the number of content objects sl@0: // TInt numContentObjects = contentArray.Count(); sl@0: // // produce listing sl@0: // // Finished sl@0: // CleanupStack::PopAndDestroy(2); // rightsArray, contentArray sl@0: //
sl@0: // The ContentAccess::CRightsManager::GetRightsDataL() function allows an application to sl@0: // retrieve a pointer to a Rights object. The Rights object is derived from MAgentRightsBase. sl@0: // // Retrieve the full Rights object sl@0: // // The application will need to cast it to the agent's derived Rights class before using it. sl@0: // MAgentRightsBase* rightsObject = rightsManager->GetRightsDataL(rightsObject); sl@0: //
sl@0: // The ContentAccess::CRightsManager::DeleteRightsObject() function allows an application to sl@0: // delete rights stored by the agent. sl@0: // // Delete the Rights object sl@0: // TInt result = rightsManager->DeleteRightsObject(rightsObject); sl@0: // It is also possible to delete all the rights associated with a particular content object. sl@0: // // Delete all the Rights objects associated with the given content object sl@0: // TInt result = rightsManager->DeleteAllRights(virtualPath); sl@0: //
sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @page CAFRightsManager Rights Manager API sl@0: - @ref RightsManagerAPI sl@0: - @ref CreatingRightsManager sl@0: - @ref ListingAllRights sl@0: - @ref ListingRightsURI sl@0: - @ref ListingRightsVP sl@0: - @ref ListingContent sl@0: - @ref RetrievingRights sl@0: - @ref DeletingRights sl@0: @section RightsManagerAPI Rights manager API sl@0: @section CreatingRightsManager Creating a CRightsManager Object sl@0: @code sl@0: @endcode sl@0: @section ListingAllRights Listing all Rights objects sl@0: @code sl@0: @endcode sl@0: @section ListingRightsURI List the rights associated with a content file sl@0: @code sl@0: @endcode sl@0: @section ListingRightsVP List the rights associated with a content object sl@0: @code sl@0: @endcode sl@0: @section ListingContent List the content associated with a Rights object sl@0: @code sl@0: @endcode sl@0: @section RetrievingRights Retrieving a Rights Object sl@0: @code sl@0: @endcode sl@0: @section DeletingRights Deleting a Rights Object sl@0: @code sl@0: @endcode sl@0: @code sl@0: @endcode sl@0: */