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