os/security/contentmgmt/contentaccessfwfordrm/engineering/dox/RightsManagerAPI.dox
First public contribution.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // The Rights manager API gives simple access to the rights within a CAF agent implementing a DRM scheme.
16 // The rights are represented in a generic form using the <code>ContentAccess::CRightsInfo</code> class. This simple class
17 // just holds a text description of the rights and some simple properties assocaiated with those
19 // The Rights manager also allows applications to determine which content files are assocated with
20 // each Rights object and vice versa.
22 // The <code>ContentAccess::CRightsManager</code> object is created by the <code>ContentAccess::CManager</code> object to look at the rights stored by a
23 // particular content access agent.
24 // // create the CManager object
25 // CManager* manager = CManager::NewL();
26 // //Create RPointerArray to store pointers to the agents
27 // RPointerArray <CAgent> agentArray;
28 // // Get the list of agents
29 // manager->ListAgentsL(agentArray);
30 // // Create a CRightsManager for the first agent
31 // CRightsManager *rightsManager = manager->CreateRightsManagerL(agentArray[0]);
33 // The <code>ContentAccess::CRightsManager::ListAllRightsL()</code> function produces a list of all the rights stored
34 // in the given a DRM agent.
35 // // Create the array to store Rights objects
36 // RStreamablePtrArray<CRightsInfo> myArray;
37 // CleanupClosePushL(myArray);
38 // // Get the Rights objects from the agent
39 // rightsManager->ListAllRightsL(myArray);
40 // // count the number of Rights objects
41 // TInt numRights = myArray.Count();
42 // // clear the contents of the array
43 // CleanupStack::PopAndDestroy();
45 // The <code>ContentAccess::CRightsManager::ListRightsL()</code> function produces a list of all the rights stored
46 // in the given a DRM agent that are associated with the file at a given URI.
47 // // Create the array to store Rights objects
48 // RStreamablePtrArray<CRightsInfo> myArray;
49 // CleanupClosePushL(myArray);
50 // // Get the Rights objects assocated with the content
51 // rightsManager->ListRightsL(myArray, uri);
52 // // Count the number of Rights objects associated with the content
53 // TInt numRights = myArray.Count();
54 // // clear the contents of the array
55 // CleanupStack::PopAndDestroy();
57 // The <code>ContentAccess::CRightsManager::ListRightsL()</code> function produces a list of all the rights stored
58 // in the given a DRM agent that are associated with the content object at a given virtual path
59 // // Create the array to store Rights objects
60 // RStreamablePtrArray<CRightsInfo> myArray;
61 // CleanupClosePushL(myArray);
62 // // Get the Rights objects assocated with the content
63 // rightsManager->ListRightsL(myArray, virtualPath);
64 // // Count the number of Rights objects associated with the content
65 // TInt numRights = myArray.Count();
66 // // clear the contents of the array
67 // CleanupStack::PopAndDestroy();
69 // The <code>ContentAccess::CRightsManager::ListContentL()</code> function produces a list of all the content
70 // that is associated with the given Rights object.
71 // // Create the array to store Rights objects
72 // RStreamablePtrArray<CRightsInfo> rightsArray;
73 // CleanupClosePushL(rightsArray);
74 // rightsManager->ListAllRightsL(rightsArray);
75 // // get the first CRightsInfo object
76 // CRightsInfo* rightsObject = rightsArray[0];
77 // RStreamablePtrArray<CVirtualPath> contentArray;
78 // CleanupClosePushL(contentArray);
79 // // Get the array of content objects associated with the rights
80 // rightsManager->ListContentL(contentArray, rightsObject);
81 // // count the number of content objects
82 // TInt numContentObjects = contentArray.Count();
85 // CleanupStack::PopAndDestroy(2); // rightsArray, contentArray
87 // The <code>ContentAccess::CRightsManager::GetRightsDataL()</code> function allows an application to
88 // retrieve a pointer to a Rights object. The Rights object is derived from <code>MAgentRightsBase</code>.
89 // // Retrieve the full Rights object
90 // // The application will need to cast it to the agent's derived Rights class before using it.
91 // MAgentRightsBase* rightsObject = rightsManager->GetRightsDataL(rightsObject);
93 // The <code>ContentAccess::CRightsManager::DeleteRightsObject()</code> function allows an application to
94 // delete rights stored by the agent.
95 // // Delete the Rights object
96 // TInt result = rightsManager->DeleteRightsObject(rightsObject);
97 // It is also possible to delete all the rights associated with a particular content object.
98 // // Delete all the Rights objects associated with the given content object
99 // TInt result = rightsManager->DeleteAllRights(virtualPath);
105 @page CAFRightsManager Rights Manager API
106 - @ref RightsManagerAPI
107 - @ref CreatingRightsManager
108 - @ref ListingAllRights
109 - @ref ListingRightsURI
110 - @ref ListingRightsVP
111 - @ref ListingContent
112 - @ref RetrievingRights
113 - @ref DeletingRights
114 @section RightsManagerAPI Rights manager API
115 @section CreatingRightsManager Creating a CRightsManager Object
118 @section ListingAllRights Listing all Rights objects
121 @section ListingRightsURI List the rights associated with a content file
124 @section ListingRightsVP List the rights associated with a content object
127 @section ListingContent List the content associated with a Rights object
130 @section RetrievingRights Retrieving a Rights Object
133 @section DeletingRights Deleting a Rights Object