contentmgmt/contentaccessfwfordrm/engineering/dox/RightsManagerAPI.dox
changeset 108 ca9a0fc2f082
parent 102 deec7e509f66
equal deleted inserted replaced
102:deec7e509f66 108:ca9a0fc2f082
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // <hr>
       
    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
       
    18 // rights.
       
    19 // The Rights manager also allows applications to determine which content files are assocated with
       
    20 // each Rights object and vice versa.
       
    21 // <hr>
       
    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]);
       
    32 // <hr>
       
    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();
       
    44 // <hr>
       
    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();
       
    56 // <hr>
       
    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();
       
    68 // <hr>
       
    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();
       
    83 // // produce listing
       
    84 // // Finished
       
    85 // CleanupStack::PopAndDestroy(2);		// rightsArray, contentArray
       
    86 // <hr>
       
    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);
       
    92 // <hr>
       
    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);
       
   100 // <hr>
       
   101 // 
       
   102 //
       
   103 
       
   104 /**
       
   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
       
   116  @code
       
   117  @endcode
       
   118  @section ListingAllRights Listing all Rights objects
       
   119  @code
       
   120  @endcode
       
   121  @section ListingRightsURI List the rights associated with a content file
       
   122  @code
       
   123  @endcode
       
   124  @section ListingRightsVP List the rights associated with a content object
       
   125  @code
       
   126  @endcode
       
   127  @section ListingContent List the content associated with a Rights object
       
   128  @code
       
   129  @endcode
       
   130  @section RetrievingRights Retrieving a Rights Object
       
   131  @code
       
   132  @endcode
       
   133  @section DeletingRights Deleting a Rights Object
       
   134  @code
       
   135  @endcode
       
   136  @code
       
   137  @endcode
       
   138 */