1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/caf/rightsmanager.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,177 @@
1.4 +/*
1.5 +* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +/**
1.24 +@file
1.25 +
1.26 +@publishedPartner
1.27 +@released
1.28 +*/
1.29 +
1.30 +
1.31 +#ifndef __RIGHTSMANAGER_H__
1.32 +#define __RIGHTSMANAGER_H__
1.33 +
1.34 +#include <e32std.h>
1.35 +#include <caf/caftypes.h>
1.36 +#include <caf/streamableptrarray.h>
1.37 +
1.38 +namespace ContentAccess
1.39 + {
1.40 +
1.41 + class TVirtualPathPtr;
1.42 + class CVirtualPath;
1.43 + class CRightsInfo;
1.44 + class CAgentInfo;
1.45 + class CAgentFactory;
1.46 + class CAgentRightsManager;
1.47 + class MAgentRightsBase;
1.48 +
1.49 + /**
1.50 + Manages and retrieves rights objects from an agent.
1.51 +
1.52 + @publishedPartner
1.53 + @released
1.54 + */
1.55 + class CRightsManager : public CBase
1.56 + {
1.57 + public:
1.58 + virtual ~CRightsManager();
1.59 +
1.60 + public:
1.61 + /** List all rights held by the agent.
1.62 + @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1.63 + @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1.64 + @leave ... One of the CAF error codes defined in \c caferr.h
1.65 + or one of the other system-wide error codes
1.66 + for any other errors.
1.67 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.68 + */
1.69 + IMPORT_C void ListAllRightsL(RStreamablePtrArray<CRightsInfo>& aArray) const;
1.70 +
1.71 + /** List all rights associated with a particular file.
1.72 + @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1.73 + @param aUri The name of the file.
1.74 + @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1.75 + @leave ... One of the CAF error codes defined in \c caferr.h
1.76 + or one of the other system-wide error codes
1.77 + for any other errors.
1.78 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.79 + */
1.80 + IMPORT_C void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, const TDesC& aUri) const;
1.81 +
1.82 + /** List all rights associated with a particular content object
1.83 + @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1.84 + @param aVirtualPath The content object.
1.85 + @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1.86 + @leave ... One of the CAF error codes defined in \c caferr.h
1.87 + or one of the other system-wide error codes
1.88 + for any other errors.
1.89 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.90 + */
1.91 + IMPORT_C void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, TVirtualPathPtr& aVirtualPath) const;
1.92 +
1.93 + /** List all content associated with a particular rights object.
1.94 + @param aArray The client supplied array used to store the list of content objects. The agent will add CVirtualPath objects to the supplied array.
1.95 + @param aRightsInfo The rights object.
1.96 + @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1.97 + @leave ... One of the CAF error codes defined in \c caferr.h
1.98 + or one of the other system-wide error codes
1.99 + for any other errors.
1.100 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.101 + */
1.102 + IMPORT_C void ListContentL(RStreamablePtrArray<CVirtualPath>& aArray, CRightsInfo& aRightsInfo) const;
1.103 +
1.104 + /** This will be used by applications to retrieve an agent specific rights object
1.105 + @param aRightsInfo The rights object.
1.106 + @return An agent specific rights object.
1.107 + @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1.108 + @leave ... One of the CAF error codes defined in \c caferr.h
1.109 + or one of the other system-wide error codes
1.110 + for any other errors.
1.111 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.112 + */
1.113 + IMPORT_C MAgentRightsBase* GetRightsDataL(const CRightsInfo& aRightsInfo) const;
1.114 +
1.115 + /** Asks the DRM agent to delete a rights object
1.116 +
1.117 + The agent may display a dialog asking the user to confirm the delete. Execution
1.118 + will be blocked until the dialog is complete. Applications can request
1.119 + to disable the agents user interface using the SetProperty() command.
1.120 +
1.121 + @param aRightsInfo The rights object.
1.122 + @return The outcome of the delete operation.
1.123 + @return KErrNone if the rights were deleted.
1.124 + @return KErrCancel if the user cancels an agent supplied confirmation dialog.
1.125 + @return KErrNotFound if the rights object does not exist.
1.126 + @return KErrPermissionDenied if the agent does not permit the client to access rights information.
1.127 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.128 + */
1.129 + IMPORT_C TInt DeleteRightsObject(const CRightsInfo& aRightsInfo);
1.130 +
1.131 + /** Deletes all rights associated with a particular content object
1.132 +
1.133 + The agent may display a dialog asking the user to confirm the delete. Execution
1.134 + will be blocked until the dialog is complete. Applications can request
1.135 + to disable the agents user interface using the SetProperty() command.
1.136 +
1.137 + @param aVirtualPathPtr The content object.
1.138 + @return KErrNone if the rights were deleted.
1.139 + @return KErrNotFound if no rights objects exist for the specified content object.
1.140 + @return KErrCancel if the user cancels an agent supplied confirmation dialog.
1.141 + @return KErrPermissionDenied if the agent does not permit the client to access rights information.
1.142 + @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1.143 + */
1.144 + IMPORT_C TInt DeleteAllRightsObjects(const TVirtualPathPtr& aVirtualPathPtr);
1.145 +
1.146 +
1.147 + /** Request the agent to set a property value. If the property is set
1.148 + it is only set for this CRightsManager session and does not impact other CAF users.
1.149 +
1.150 + @see ContentAccess::TAgentProperty
1.151 +
1.152 + @param aProperty The property to set.
1.153 + @param aValue The value of the property.
1.154 + @return KErrNone if the property was set.
1.155 + @return KErrCANotSupported if the agent does not support the property or value.
1.156 + @return KErrAccessDenied if the agent does not permit the property to be changed.
1.157 + @return KErrPermissionDenied if the application does not have the necessary capability to change the property.
1.158 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.159 + */
1.160 + IMPORT_C TInt SetProperty(TAgentProperty aProperty, TInt aValue);
1.161 +
1.162 + private:
1.163 +
1.164 + friend class CManager;
1.165 +
1.166 + /** Only created by CManager */
1.167 + static CRightsManager* NewL(TUid aUid);
1.168 +
1.169 + /** Constructor */
1.170 + CRightsManager();
1.171 +
1.172 + /** 2nd phase constructor */
1.173 + virtual void ConstructL(TUid aUid);
1.174 +
1.175 + private:
1.176 + CAgentFactory* iAgentFactory;
1.177 + CAgentRightsManager* iAgentRightsManager;
1.178 + };
1.179 + }
1.180 +#endif