author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@2 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* |
williamr@2 | 16 |
*/ |
williamr@2 | 17 |
|
williamr@2 | 18 |
|
williamr@2 | 19 |
|
williamr@2 | 20 |
/** |
williamr@2 | 21 |
@file |
williamr@2 | 22 |
|
williamr@2 | 23 |
@publishedPartner |
williamr@2 | 24 |
@released |
williamr@2 | 25 |
*/ |
williamr@2 | 26 |
|
williamr@2 | 27 |
|
williamr@2 | 28 |
#ifndef __RIGHTSMANAGER_H__ |
williamr@2 | 29 |
#define __RIGHTSMANAGER_H__ |
williamr@2 | 30 |
|
williamr@2 | 31 |
#include <e32std.h> |
williamr@2 | 32 |
#include <caf/caftypes.h> |
williamr@2 | 33 |
#include <caf/streamableptrarray.h> |
williamr@2 | 34 |
|
williamr@2 | 35 |
namespace ContentAccess |
williamr@2 | 36 |
{ |
williamr@2 | 37 |
|
williamr@2 | 38 |
class TVirtualPathPtr; |
williamr@2 | 39 |
class CVirtualPath; |
williamr@2 | 40 |
class CRightsInfo; |
williamr@2 | 41 |
class CAgentInfo; |
williamr@2 | 42 |
class CAgentFactory; |
williamr@2 | 43 |
class CAgentRightsManager; |
williamr@2 | 44 |
class MAgentRightsBase; |
williamr@2 | 45 |
|
williamr@2 | 46 |
/** |
williamr@2 | 47 |
Manages and retrieves rights objects from an agent. |
williamr@2 | 48 |
|
williamr@2 | 49 |
@publishedPartner |
williamr@2 | 50 |
@released |
williamr@2 | 51 |
*/ |
williamr@2 | 52 |
class CRightsManager : public CBase |
williamr@2 | 53 |
{ |
williamr@2 | 54 |
public: |
williamr@2 | 55 |
virtual ~CRightsManager(); |
williamr@2 | 56 |
|
williamr@2 | 57 |
public: |
williamr@2 | 58 |
/** List all rights held by the agent. |
williamr@2 | 59 |
@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array. |
williamr@2 | 60 |
@leave KErrPermissionDenied If the agent does not permit the client to access rights information. |
williamr@2 | 61 |
@leave ... One of the CAF error codes defined in \c caferr.h |
williamr@2 | 62 |
or one of the other system-wide error codes |
williamr@2 | 63 |
for any other errors. |
williamr@2 | 64 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 65 |
*/ |
williamr@2 | 66 |
IMPORT_C void ListAllRightsL(RStreamablePtrArray<CRightsInfo>& aArray) const; |
williamr@2 | 67 |
|
williamr@2 | 68 |
/** List all rights associated with a particular file. |
williamr@2 | 69 |
@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array. |
williamr@2 | 70 |
@param aUri The name of the file. |
williamr@2 | 71 |
@leave KErrPermissionDenied If the agent does not permit the client to access rights information. |
williamr@2 | 72 |
@leave ... One of the CAF error codes defined in \c caferr.h |
williamr@2 | 73 |
or one of the other system-wide error codes |
williamr@2 | 74 |
for any other errors. |
williamr@2 | 75 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 76 |
*/ |
williamr@2 | 77 |
IMPORT_C void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, const TDesC& aUri) const; |
williamr@2 | 78 |
|
williamr@2 | 79 |
/** List all rights associated with a particular content object |
williamr@2 | 80 |
@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array. |
williamr@2 | 81 |
@param aVirtualPath The content object. |
williamr@2 | 82 |
@leave KErrPermissionDenied If the agent does not permit the client to access rights information. |
williamr@2 | 83 |
@leave ... One of the CAF error codes defined in \c caferr.h |
williamr@2 | 84 |
or one of the other system-wide error codes |
williamr@2 | 85 |
for any other errors. |
williamr@2 | 86 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 87 |
*/ |
williamr@2 | 88 |
IMPORT_C void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, TVirtualPathPtr& aVirtualPath) const; |
williamr@2 | 89 |
|
williamr@2 | 90 |
/** List all content associated with a particular rights object. |
williamr@2 | 91 |
@param aArray The client supplied array used to store the list of content objects. The agent will add CVirtualPath objects to the supplied array. |
williamr@2 | 92 |
@param aRightsInfo The rights object. |
williamr@2 | 93 |
@leave KErrPermissionDenied If the agent does not permit the client to access rights information. |
williamr@2 | 94 |
@leave ... One of the CAF error codes defined in \c caferr.h |
williamr@2 | 95 |
or one of the other system-wide error codes |
williamr@2 | 96 |
for any other errors. |
williamr@2 | 97 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 98 |
*/ |
williamr@2 | 99 |
IMPORT_C void ListContentL(RStreamablePtrArray<CVirtualPath>& aArray, CRightsInfo& aRightsInfo) const; |
williamr@2 | 100 |
|
williamr@2 | 101 |
/** This will be used by applications to retrieve an agent specific rights object |
williamr@2 | 102 |
@param aRightsInfo The rights object. |
williamr@2 | 103 |
@return An agent specific rights object. |
williamr@2 | 104 |
@leave KErrPermissionDenied If the agent does not permit the client to access rights information. |
williamr@2 | 105 |
@leave ... One of the CAF error codes defined in \c caferr.h |
williamr@2 | 106 |
or one of the other system-wide error codes |
williamr@2 | 107 |
for any other errors. |
williamr@2 | 108 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 109 |
*/ |
williamr@2 | 110 |
IMPORT_C MAgentRightsBase* GetRightsDataL(const CRightsInfo& aRightsInfo) const; |
williamr@2 | 111 |
|
williamr@2 | 112 |
/** Asks the DRM agent to delete a rights object |
williamr@2 | 113 |
|
williamr@2 | 114 |
The agent may display a dialog asking the user to confirm the delete. Execution |
williamr@2 | 115 |
will be blocked until the dialog is complete. Applications can request |
williamr@2 | 116 |
to disable the agents user interface using the SetProperty() command. |
williamr@2 | 117 |
|
williamr@2 | 118 |
@param aRightsInfo The rights object. |
williamr@2 | 119 |
@return The outcome of the delete operation. |
williamr@2 | 120 |
@return KErrNone if the rights were deleted. |
williamr@2 | 121 |
@return KErrCancel if the user cancels an agent supplied confirmation dialog. |
williamr@2 | 122 |
@return KErrNotFound if the rights object does not exist. |
williamr@2 | 123 |
@return KErrPermissionDenied if the agent does not permit the client to access rights information. |
williamr@2 | 124 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 125 |
*/ |
williamr@2 | 126 |
IMPORT_C TInt DeleteRightsObject(const CRightsInfo& aRightsInfo); |
williamr@2 | 127 |
|
williamr@2 | 128 |
/** Deletes all rights associated with a particular content object |
williamr@2 | 129 |
|
williamr@2 | 130 |
The agent may display a dialog asking the user to confirm the delete. Execution |
williamr@2 | 131 |
will be blocked until the dialog is complete. Applications can request |
williamr@2 | 132 |
to disable the agents user interface using the SetProperty() command. |
williamr@2 | 133 |
|
williamr@2 | 134 |
@param aVirtualPathPtr The content object. |
williamr@2 | 135 |
@return KErrNone if the rights were deleted. |
williamr@2 | 136 |
@return KErrNotFound if no rights objects exist for the specified content object. |
williamr@2 | 137 |
@return KErrCancel if the user cancels an agent supplied confirmation dialog. |
williamr@2 | 138 |
@return KErrPermissionDenied if the agent does not permit the client to access rights information. |
williamr@2 | 139 |
@capability DRM Access to DRM rights is not permitted for processes without DRM capability. |
williamr@2 | 140 |
*/ |
williamr@2 | 141 |
IMPORT_C TInt DeleteAllRightsObjects(const TVirtualPathPtr& aVirtualPathPtr); |
williamr@2 | 142 |
|
williamr@2 | 143 |
|
williamr@2 | 144 |
/** Request the agent to set a property value. If the property is set |
williamr@2 | 145 |
it is only set for this CRightsManager session and does not impact other CAF users. |
williamr@2 | 146 |
|
williamr@2 | 147 |
@see ContentAccess::TAgentProperty |
williamr@2 | 148 |
|
williamr@2 | 149 |
@param aProperty The property to set. |
williamr@2 | 150 |
@param aValue The value of the property. |
williamr@2 | 151 |
@return KErrNone if the property was set. |
williamr@2 | 152 |
@return KErrCANotSupported if the agent does not support the property or value. |
williamr@2 | 153 |
@return KErrAccessDenied if the agent does not permit the property to be changed. |
williamr@2 | 154 |
@return KErrPermissionDenied if the application does not have the necessary capability to change the property. |
williamr@2 | 155 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. |
williamr@2 | 156 |
*/ |
williamr@2 | 157 |
IMPORT_C TInt SetProperty(TAgentProperty aProperty, TInt aValue); |
williamr@2 | 158 |
|
williamr@2 | 159 |
private: |
williamr@2 | 160 |
|
williamr@2 | 161 |
friend class CManager; |
williamr@2 | 162 |
|
williamr@2 | 163 |
/** Only created by CManager */ |
williamr@2 | 164 |
static CRightsManager* NewL(TUid aUid); |
williamr@2 | 165 |
|
williamr@2 | 166 |
/** Constructor */ |
williamr@2 | 167 |
CRightsManager(); |
williamr@2 | 168 |
|
williamr@2 | 169 |
/** 2nd phase constructor */ |
williamr@2 | 170 |
virtual void ConstructL(TUid aUid); |
williamr@2 | 171 |
|
williamr@2 | 172 |
private: |
williamr@2 | 173 |
CAgentFactory* iAgentFactory; |
williamr@2 | 174 |
CAgentRightsManager* iAgentRightsManager; |
williamr@2 | 175 |
}; |
williamr@2 | 176 |
} |
williamr@2 | 177 |
#endif |