os/security/contentmgmt/contentaccessfwfordrm/inc/agentinterface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/inc/agentinterface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,1695 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-2009 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 + @file
    1.24 + @publishedPartner
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +#ifndef __AGENTINTERFACE_H__
    1.29 +#define __AGENTINTERFACE_H__
    1.30 +
    1.31 +#include <e32base.h>
    1.32 +#include <ecom/ecom.h>
    1.33 +
    1.34 +#include <caf/caftypes.h>
    1.35 +#include <caf/streamableptrarray.h>
    1.36 +#include <caf/caferr.h>
    1.37 +
    1.38 +class RStringPool;
    1.39 +class RHTTPHeaders;
    1.40 +
    1.41 +namespace ContentAccess
    1.42 +{
    1.43 +	class CEmbeddedObject;
    1.44 +	class CSupplierOutputFile;
    1.45 +	class RAttributeSet;
    1.46 +	class RStringAttributeSet;
    1.47 +	class TVirtualPathPtr;
    1.48 +	class CRightsInfo;
    1.49 +	class CVirtualPath;
    1.50 +	class MAgentRightsBase;
    1.51 +	class CImportFile;
    1.52 +	class CMetaDataArray;
    1.53 +	class CDirStreamable;
    1.54 +
    1.55 +	/**
    1.56 +	 Defines the agent interface for consumer operations such as 
    1.57 +	 reading and seeking within a content object in a file.
    1.58 +
    1.59 +	 @publishedPartner
    1.60 +	 @released
    1.61 +     */
    1.62 +	class CAgentData : public CBase
    1.63 +		{
    1.64 +	public:
    1.65 +		/**
    1.66 +		 Gets the data size in bytes.
    1.67 +		 
    1.68 +		 @param aSize	On return this will contain the size of the plaintext data in bytes.
    1.69 +		 @leave KErrCASizeNotDetermined	Size could not be determined by the managing agent.
    1.70 +		 @leave ...		One of the other CAF error codes defined in \c caferr.h  or one of the 
    1.71 +						system-wide error codes for any other errors.		 
    1.72 +		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
    1.73 +		 */
    1.74 +		virtual void DataSizeL(TInt &aSize) = 0;
    1.75 +		
    1.76 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    1.77 +		/**
    1.78 +		 This is the 64bit version of DataSizeL. Implementing this function should take advantage of 64bit
    1.79 +		 file system and use RFile::Size64(TInt64 &). If this function is not implemented, fallback to 32bit 
    1.80 +		 DataSizeL will be provided by CAF automatically.
    1.81 +		 
    1.82 +		 @see DataSizeL(TInt &aSize)
    1.83 +		*/
    1.84 +		IMPORT_C virtual void DataSize64L(TInt64 &aSize);
    1.85 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    1.86 +		
    1.87 +		/**
    1.88 +		 Allows a client to verify that the intent is supported by the
    1.89 +		 current rights for the data object. 
    1.90 +		 
    1.91 +		 Doing so may cause subsequent reads (or other accesses)
    1.92 +		 to fail. The result of the agent's evaluation
    1.93 +		 of the intent is returned.
    1.94 +		 
    1.95 +		 @note Since the intent is only evaluated the agent will not decrement 
    1.96 +		 any rights-state such as play counts.
    1.97 +		  
    1.98 +		 @param aIntent	The intended way the content will be used.
    1.99 +		 @return Whether rights exist allowing the content to be used for this intent.
   1.100 +		 @return KErrNone if the intent is permitted.
   1.101 +		 @return KErrNoRights if no rights exist for the specified content object.
   1.102 +		 @return KErrCANoPermission	if rights exist but the specified intent is not permitted.
   1.103 +		 @return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
   1.104 +		 @return KErrNoPermission if rights exist but none permit the specified intent.
   1.105 +		 @return KErrPermissionDenied if the client is not allowed to use this content object.
   1.106 +		 @return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.107 +				other system-wide error codes for any other errors.
   1.108 +
   1.109 +		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
   1.110 +		 */
   1.111 +		virtual TInt EvaluateIntent(TIntent aIntent) = 0;
   1.112 +		
   1.113 +		/**
   1.114 +		 Execute intent allows the application to signal it is about to carry out
   1.115 +		 the specified intent on DRM protected content.The agent will decrement applicable 
   1.116 +		 stateful rights such as play counts where necessary.
   1.117 +
   1.118 +  		 Applications should be very careful to use this function correctly.
   1.119 +		 @li If ExecuteIntent() is never called stateful rights will never be decremented. Users will be able to use the content forever
   1.120 +		 @li If ExecuteIntent() is called too often stateful rights may be consumed prematurely. 
   1.121 +
   1.122 +		 Usually it would be best to call ExecuteIntent immediately before the content 
   1.123 +		 is displayed or the instant playback begins. ExecuteIntent should not be considered a 
   1.124 +		 prerequisite for calling the Read functions. It is valid for an application to read from 
   1.125 +		 the file before calling ExecuteIntent. 
   1.126 +
   1.127 +		 @note Since rights are executed here the agent will decrement any rights-state such as 
   1.128 +		 play counts that apply. 
   1.129 +		 
   1.130 +		@param aIntent	The intent indicator.
   1.131 +		@return The result of attempting executing the intent.
   1.132 +		@return KErrNone if the intent is permitted and stateful rights may have been decremented.
   1.133 +		@return KErrNoRights if no rights exist for the specified content object.
   1.134 +		@return KErrCANoPermission	if rights exist but the specified intent is not permitted.
   1.135 +		@return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
   1.136 +		@return KErrNoPermission if rights exist but none permit the specified intent.
   1.137 +		@return KErrPermissionDenied if the client is not allowed to use this content object.
   1.138 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the
   1.139 +				other system-wide error codes for any other errors.
   1.140 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.141 +		*/
   1.142 +		virtual TInt ExecuteIntent(TIntent aIntent) = 0;
   1.143 +
   1.144 +		/** 
   1.145 +		 Reads from a content object up to the maximum length of the
   1.146 +		 descriptor or the end of the content object.
   1.147 +		 	
   1.148 +		 When an attempt is made to read beyond the end of the content,
   1.149 +		 no error is returned. The descriptor’s length is set to the
   1.150 +		 number of bytes that were read into it. Therefore, when reading
   1.151 +		 through content, the end has been reached when the
   1.152 +		 descriptor length (given by TDesC::Length()) is zero.
   1.153 +		 
   1.154 +		 @param aDes	Descriptor into which binary data is read. Any existing
   1.155 +		  				contents are overwritten. On return, its length is set
   1.156 +		 				to the number of bytes read.
   1.157 +		 @return		KErrNone if successful, otherwise another of the
   1.158 +		  				system-wide error codes.
   1.159 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.160 +		*/
   1.161 +		virtual TInt Read(TDes8& aDes) = 0;
   1.162 +
   1.163 +		/**
   1.164 +		 Reads a specified number of bytes of content.
   1.165 +		  
   1.166 +		 @see Read(TDes8& aDes)
   1.167 +		 		 
   1.168 +		 @param aDes	Descriptor into which binary data is read. Any existing
   1.169 +		  				contents are overwritten. On return, its length is set
   1.170 +		 				to the number of bytes read.
   1.171 +		 @param aLength		The number of bytes to read from the file,
   1.172 +		 					or to the end of the file, whichever is encountered first. 
   1.173 +		 					The length of the buffer is set to the number of bytes actually read.
   1.174 +		 @return		KErrNone if successful.
   1.175 +		 @return		Otherwise one of the CAF error codes defined in \c caferr.h  or 
   1.176 +		 				one of the other system-wide error codes.
   1.177 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.178 +		*/
   1.179 +		virtual TInt Read(TDes8& aDes, TInt aLength) = 0;
   1.180 +
   1.181 +		/**
   1.182 +		 Reads content asynchronously.
   1.183 +		 
   1.184 +		 @see Read(TDes8& aDes)
   1.185 +		 
   1.186 +		 @param aDes 		Descriptor into which binary data is read. Any
   1.187 +		  					existing contents are overwritten. On return,
   1.188 +		 					its length is set to the number of bytes read. 
   1.189 +		 @param aStatus		Asynchronous request status. On completion this will contain one 
   1.190 +		 					of the following error codes: KErrNone if the data was 
   1.191 +							successfully read. Otherwise one of the CAF error codes defined in 
   1.192 +							\c caferr.h  or one of the other standard system-wide
   1.193 +							error codes for any other errors.
   1.194 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.195 +		*/
   1.196 +		virtual void Read(TDes8& aDes, TRequestStatus& aStatus) = 0;
   1.197 +
   1.198 +		/**
   1.199 +		 Reads content asynchronously (up to a specified maximum number of bytes)
   1.200 +		 
   1.201 +		 @see Read(TDes8& aDes)
   1.202 +		 
   1.203 +		 @param aDes 		Descriptor into which binary data is read. Any
   1.204 +		  					existing contents are overwritten. On return,
   1.205 +		 					its length is set to the number of bytes read. 
   1.206 +		 @param aLength		The number of bytes to read from the file,
   1.207 +		 					or to the end of the file, whichever is encountered first. 
   1.208 +		 					The length of the buffer is set to the number of bytes actually read.
   1.209 +		 @param aStatus		Asynchronous request status. On completion this will contain one 
   1.210 +		 					of the following error codes: KErrNone if the data was 
   1.211 +							successfully read. Otherwise one of the CAF error codes defined in 
   1.212 +							\c caferr.h  or one of the other standard system-wide
   1.213 +							error codes for any other errors.
   1.214 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.215 +		*/
   1.216 +		virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus) = 0;
   1.217 +		
   1.218 +		/**
   1.219 +		 Cancels asynchronous read.
   1.220 +		 
   1.221 +		 @param aStatus		Asynchronous request status. This parameter should have been supplied earlier to
   1.222 +		 					an asynchronous Read call. If it has not been previously supplied to a Read call,
   1.223 +		 					this function will not have any effect.
   1.224 +		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.225 +		*/
   1.226 +		IMPORT_C virtual void ReadCancel(TRequestStatus& aStatus);
   1.227 +
   1.228 +		/**
   1.229 +		 Changes or retrieves the location of the file pointer within 
   1.230 +		 the content object
   1.231 +		 
   1.232 +		 There are four seek modes used: 
   1.233 +		 
   1.234 +		 @li ESeekStart - Sets the file pointer aPos bytes from the start of the 
   1.235 +		 content object.  aPos is not modified by the call to Seek()
   1.236 +		 @li ESeekEnd - Sets the file pointer aPos bytes from the end of the 
   1.237 +		 content object. The aPos parameter supplied should be zero or negative 
   1.238 +		 when using ESeekEnd. Upon completion aPos is updated with the current 
   1.239 +		 position relative to the start of the content object.
   1.240 +		 @li ESeekCurrent - Moves the file pointer aPos bytes from the current 
   1.241 +		 position. Upon completion aPos is updated with the new position relative 
   1.242 +		 to the start of the content object. Suppling a zero value for the aPos Parameter can be
   1.243 +		 used to retrieve the current file pointer location 
   1.244 +		 @li ESeekAddress Sets the aPos parameter to the address of the byte 
   1.245 +		 aPos bytes from the start of the content object
   1.246 +
   1.247 +		 @see TSeek
   1.248 +		 
   1.249 +		 @param aMode	Seek mode - controls the destination of the
   1.250 +		  				seek operation.
   1.251 +		  
   1.252 +		 @param aPos	Offset from either the start, end or current position depending upon 
   1.253 +		 the seek mode. Negative offsets are used to seek before the current position or
   1.254 +		 relative to the end of the file.
   1.255 +		 
   1.256 +		 @return		KErrNone if successful. 
   1.257 +		 @return		Otherwise one of the CAF error codes defined in \c caferr.h  or one 
   1.258 +		 				of the other system-wide error codes.
   1.259 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.260 +		*/
   1.261 +		virtual TInt Seek(TSeek aMode, TInt& aPos) = 0;
   1.262 +
   1.263 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.264 +		/**
   1.265 +		  This is the 64bit version of Seek. Implementing this function should take advantage of 64bit
   1.266 +		  file system and use RFile::Seek64(TSeek, TInt64 &). If this function is not implemented, fallback to 32bit 
   1.267 +		  Seek will be provided by CAF automatically.
   1.268 +		  
   1.269 +		  @see Seek(TSeek aMode, TInt& aPos)
   1.270 +		*/
   1.271 +		IMPORT_C virtual TInt Seek64(TSeek aMode, TInt64& aPos);
   1.272 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.273 +		
   1.274 +		/** 
   1.275 +		Allows an application to request the modification of a property 
   1.276 +		within the agent handling this content. The agent may or may not
   1.277 +		permit the property to be changed
   1.278 +		 	
   1.279 +		@param aProperty The property to set.
   1.280 +		@param aValue The value of the property.
   1.281 +		@return Whether or not the property was set.
   1.282 +		@return KErrNone if the property was set.
   1.283 +		@return KErrCANotSupported if the agent does not support the property or value.
   1.284 +		@return KErrAccessDenied if the agent does not permit the property to be changed.
   1.285 +		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
   1.286 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.287 +		 */
   1.288 +		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
   1.289 +
   1.290 +		/**  Get the value of an attribute for this content object
   1.291 + 
   1.292 +		@param aAttribute The attribute to query, from ContentAccess::TAttribute.
   1.293 +		@param aValue Used to return the attribute value.
   1.294 +		@return Whether the attribute was updated.
   1.295 +		@return KErrNone if the value of the attribute was updated.
   1.296 +		@return KErrCANotSupported if the requested attribute does not exist.
   1.297 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   1.298 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.299 +				other system-wide error codes for any other errors.
   1.300 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.301 +		*/
   1.302 +		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue)=0;
   1.303 +
   1.304 +		/** Get a set of attributes from a content object
   1.305 +
   1.306 +		@param aAttributeSet The set of attributes to query and update.
   1.307 +		@return Whether the attribute set was updated.
   1.308 +		@return KErrNone if the attributes were retrieved successfully.
   1.309 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   1.310 +		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   1.311 +				other system-wide error codes for any other errors.
   1.312 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 				
   1.313 +		*/
   1.314 +		virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet) = 0;
   1.315 +
   1.316 +		/**  Get text string attributes or meta-data for this content object
   1.317 +
   1.318 +		@param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
   1.319 +		@param aValue Returns the value of the attribute.
   1.320 +		@return Whether the value was updated.
   1.321 +		@return KErrNone if the attribute was retrieved.
   1.322 +		@return KErrOverflow if the buffer was not large enough to return the result.
   1.323 +		@return KErrCANotSupported if the requested attribute does not exist.
   1.324 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   1.325 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.326 +				other system-wide error codes for any other errors.				 
   1.327 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.328 +		*/
   1.329 +		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue)=0;
   1.330 +
   1.331 +	
   1.332 +		/** Used to obtain a set of string attributes 
   1.333 +
   1.334 +		@param aStringAttributeSet The set of attributes to query and update.
   1.335 +		@return Whether the string attribute set was updated.
   1.336 +		@return KErrNone if the attributes were retrieved successfully.
   1.337 +		@return KErrNotFound if the default content object was not found.
   1.338 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   1.339 +		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   1.340 +				other system-wide error codes for any other errors.				 
   1.341 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   1.342 +		*/
   1.343 +		virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet)=0;
   1.344 +		
   1.345 +		/**  
   1.346 +		 Reads content asynchronously. The data is read from a specified offset 
   1.347 +		 up to a specified number of bytes or until the end of the content object 
   1.348 +		 is reached. The data is read into the descriptor buffer supplied.
   1.349 +		 
   1.350 +		 @see Read(TDes8& aDes)
   1.351 +		 
   1.352 +		 @param aPos		Position of first byte to be read. 
   1.353 +		 					This is an offset from the start of the file. 
   1.354 +		 @param aDes 		Descriptor into which binary data is read. Any
   1.355 +		  					existing contents are overwritten. On return,
   1.356 +		 					its length is set to the number of bytes read. 
   1.357 +		 @param aLength		The number of bytes to read from the file,
   1.358 +		 					or to the end of the file, whichever is encountered first. 
   1.359 +		 					The length of the buffer is set to the number of bytes actually read.
   1.360 +		 @param aStatus		Asynchronous request status. On completion this will contain one 
   1.361 +		 					of the following error codes: KErrNone if the data was 
   1.362 +							successfully read. Otherwise one of the CAF error codes defined in 
   1.363 +							\c caferr.h  or one of the other standard system-wide
   1.364 +							error codes for any other errors.
   1.365 +		 @return KErrNone if the async read request was successfully submitted.
   1.366 +		 @return KErrCANotSupported if the agent does not support this operation.
   1.367 +		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.368 +		*/
   1.369 +		IMPORT_C virtual TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
   1.370 +		
   1.371 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.372 +		/**  
   1.373 +		 This is the 64bit version of CAgentData::Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   1.374 +		 Implementing this function should take advantage of 64bit file system and use RFile::Seek64(TSeek, TInt64 &) to get to
   1.375 +		 the position in file specified by aPos. If this function is not implemented, fallback to 32bit 
   1.376 +		 Read will be provided by CAF automatically. 
   1.377 +		 
   1.378 +		 @see Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   1.379 +		*/
   1.380 +		IMPORT_C virtual TInt Read64(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
   1.381 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.382 +
   1.383 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.384 +		/**
   1.385 +		Decrypts the encrypted input data packet.Default implementation of this method returns KErrCANotSupported.
   1.386 +		
   1.387 +		@param aEncryptedInputDataPacket	Buffer descriptor containing the encrypted data packet supplied by client application. 
   1.388 +		@param aDecryptedOutputDataPacket	Buffer descriptor supplied by the client application into which the decrypted data is written.
   1.389 +											The length of this descriptor must be equal to or greater than the input packet.
   1.390 +		@return								KErrNone if successful or KErrInsuffcientDataPacketLength, if a part of input data packet
   1.391 +											is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h  or 
   1.392 +		 									one of the other system-wide error.
   1.393 +		@capability 						DRM Access to DRM protected content is not permitted for processes without DRM capability.
   1.394 +											Access to unprotected content is unrestricted.
   1.395 +		*/
   1.396 +		IMPORT_C virtual TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket);
   1.397 +		
   1.398 +		
   1.399 +		/**
   1.400 +		Decrypts the encrypted input data packet asynchronously.Default implementation of this method returns KErrCANotSupported.
   1.401 +	
   1.402 +		@param aEncryptedInputDataPacket	Buffer descriptor containing the encrypted data packet supplied by client application. 
   1.403 +		@param aDecryptedOutputDataPacket	Buffer descriptor supplied by the client application into which the decrypted data is written.
   1.404 +											The length of this descriptor must be equal to or greater than the input packet.
   1.405 +		@param aStatus						Asynchronous request status. On completion this will contain one of the following error codes:
   1.406 +											KErrNone if the data packet was successfully decrypted or KErrInsuffcientDataPacketLength, if a part of input data packet
   1.407 +											is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h  or 
   1.408 +		 									one of the other system-wide error codes.
   1.409 +		@capability 						DRM Access to DRM protected content is not permitted for processes without DRM capability.
   1.410 +										    Access to unprotected content is unrestricted. 
   1.411 +		*/
   1.412 +		IMPORT_C virtual void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus);
   1.413 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.414 +		};
   1.415 +
   1.416 +	/**	Defines the agent interface allowing clients to browse the objects 
   1.417 +	within a file
   1.418 +
   1.419 +	@publishedPartner
   1.420 +	@released
   1.421 +	*/
   1.422 +	class CAgentContent : public CBase
   1.423 +		{
   1.424 +	public:
   1.425 + 		/** Open a Container object within the file.
   1.426 + 		
   1.427 + 		Allows an application to access the content objects and 
   1.428 + 		any nested container objects within the specified container.
   1.429 +  		
   1.430 + 		@param aUniqueId The container object's unique ID.
   1.431 +		@return Whether the container was opened.
   1.432 + 		@return KErrNone if the container was opened successfully.
   1.433 + 		@return KErrNotFound if the container does not exist.
   1.434 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   1.435 +		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   1.436 +				other system-wide error codes for any other errors.
   1.437 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.438 + 		*/
   1.439 +		virtual TInt OpenContainer(const TDesC& aUniqueId) = 0;
   1.440 +
   1.441 + 		/** Close the current container object and go back to previous enclosing
   1.442 + 		container within the file.
   1.443 + 		
   1.444 + 		Allows an application to access the content objects and 
   1.445 + 		any nested container objects within parent container
   1.446 +  		
   1.447 +		@return Whether the container was closed.
   1.448 +  		@return KErrNone if the container was closed.
   1.449 +  		@return KErrNotFound if there is no enclosing container.
   1.450 +  		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 		
   1.451 +  		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.452 + 		*/
   1.453 +		virtual  TInt CloseContainer() = 0;
   1.454 +
   1.455 +		/** List all the embedded container objects and content objects within the 
   1.456 +		current container
   1.457 + 		 		
   1.458 +		The UniqueId() member of CEmbeddedObject can be used to refer directly to 
   1.459 +		a particular object within the file.
   1.460 +
   1.461 +		@param aArray The array to be populated with the embedded objects. 
   1.462 +		@leave KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   1.463 +		@leave ...			One of the CAF error codes defined in \c caferr.h  or one of the 
   1.464 +							other system-wide error codes for any other errors.
   1.465 +  		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.466 + 		*/
   1.467 +		virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray) = 0;
   1.468 +		
   1.469 +		/** List all the embedded objects within the current container that
   1.470 +		are of the specified type
   1.471 + 		 		
   1.472 +		@param aArray The array to be populated with the embedded objects. 
   1.473 +		@param aType The type of objects to list.
   1.474 +		@leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.		 
   1.475 +		@leave ...			One of the CAF error codes defined in \c caferr.h  or one of the 
   1.476 +							other system-wide error codes for any other errors.
   1.477 +  		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.478 + 		*/
   1.479 +		virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray, TEmbeddedType aType) = 0;
   1.480 +
   1.481 +		/** Search the current container for content objects with a particular mime type
   1.482 +
   1.483 +  		@param aArray The array to store the results of the search. The agent will add CEmbeddedObject objects to the supplied array.
   1.484 +		@param aMimeType The mime type to search for.
   1.485 +		@param aRecursive ETrue to search inside containers embedded within the current container, EFalse to search only the current container.
   1.486 +		@return The result of the search.
   1.487 +		@return KErrNone if the search was successful, even if no content objects were found.
   1.488 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   1.489 +		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   1.490 +				other system-wide error codes for any other errors.
   1.491 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.492 +		*/
   1.493 +		virtual TInt Search(RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8& aMimeType, TBool aRecursive) = 0;
   1.494 +		
   1.495 +		/**  Get an attribute for an object within the file
   1.496 +	
   1.497 +		@param aAttribute The attribute to query, from ContentAccess::TAttribute.
   1.498 +		@param aValue Used to return the attribute value.
   1.499 +		@param aUniqueId The UniqueId of the object within the file.
   1.500 +		@return Whether the attribute value was updated.
   1.501 +		@return KErrNone if the value of the attribute was updated.
   1.502 +		@return KErrNotFound if the object with the given UniqueId was not found.
   1.503 +		@return KErrCANotSupported if the requested attribute does not exist.
   1.504 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.	 
   1.505 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.506 +				other system-wide error codes for any other errors.
   1.507 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   1.508 +		*/
   1.509 +		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId) = 0;
   1.510 +
   1.511 +		/** Get a set of attributes for an object within the file
   1.512 +
   1.513 +		@param aAttributeSet The set of attributes to query and update.
   1.514 +		@param aUniqueId The unique ID of the object within the file.
   1.515 +		@return Whether that attribute set was updated.
   1.516 +		@return KErrNone if the attributes were retrieved successfully.
   1.517 +		@return KErrNotFound if the default content object was not found.
   1.518 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   1.519 +		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   1.520 +				other system-wide error codes for any other errors.
   1.521 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   1.522 +		*/
   1.523 +		virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId) = 0;
   1.524 +
   1.525 +		/**  Get text string attributes or meta-data for an object within the file
   1.526 +
   1.527 +		@param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
   1.528 +		@param aValue Returns the value of the attribute.
   1.529 +		@param aUniqueId The UniqueId of the object within the file. 
   1.530 +		@return Whether the attribute value was updated.
   1.531 +		@return KErrNone if the attribute was retrieved.
   1.532 +		@return KErrNotFound if the object with the given UniqueId was not found.
   1.533 +		@return KErrOverflow if the buffer was not large enough to return the result.
   1.534 +		@return KErrCANotSupported if the requested attribute does not exist.
   1.535 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.	 
   1.536 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.537 +				other system-wide error codes for any other errors.
   1.538 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   1.539 +		*/
   1.540 +		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId) = 0;
   1.541 +
   1.542 +		/** Used to obtain a set of string attributes for an object within the file
   1.543 +
   1.544 +		@param aStringAttributeSet The set of attributes to query and update.
   1.545 +		@param aUniqueId The UniqueId of the container or content. 
   1.546 +		@return Whether the attribute set was updated.
   1.547 +		@return KErrNone if the attributes were retrieved successfully.
   1.548 +		@return KErrNotFound if the object with the given UniqueId was not found.
   1.549 +		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   1.550 +		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   1.551 +				other system-wide error codes for any other errors.
   1.552 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   1.553 +		*/
   1.554 +		virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId)=0;
   1.555 +
   1.556 +		/** Allows extended synchronous calls to the CAF agent handling this file
   1.557 +		
   1.558 +		Applications familiar with the agent can pass objects in and out using serialization.
   1.559 +
   1.560 +		@param aCommand The agent defined command.
   1.561 +		@param aInputBuffer Non modifyable input data buffer.
   1.562 +		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
   1.563 +		@return The outcome of the agent specific command.
   1.564 +		@return KErrCANotSupported if the agent does not recognize the command.
   1.565 +		@return KErrOverflow if the output buffer supplied is too small.
   1.566 +		@return KErrPermissionDenied if the agent does not allow the client to execute the command.
   1.567 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.568 +				other system-wide error codes for any other errors.
   1.569 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.570 +		*/
   1.571 +		virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer) = 0;
   1.572 +
   1.573 +		/** Allows extended synchronous calls to the CAF agent handling this file.
   1.574 +		Applications familiar with the agent can pass objects in and out using serialization.
   1.575 +		NB: No assumption should be made about the scope of the descriptor 
   1.576 +		passed to aInputBuffer for asynchronous IPC.
   1.577 +
   1.578 +		@param aCommand The agent defined command.
   1.579 +		@param aInputBuffer Non modifyable input data buffer.
   1.580 +		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
   1.581 +		@param aStatus Asynchronous request status. On completion this will contain 
   1.582 +						one of the following error codes:
   1.583 +						KErrNone if the command was successfully executed.
   1.584 +						KErrCANotSupported  if the agent does not recognize the command.
   1.585 +						KErrOverflow if the output buffer supplied is too small.
   1.586 +						KErrPermissionDenied if the agent does not allow the client 
   1.587 +						to execute the command. Otherwise one of the other CAF error codes defined 
   1.588 +						in \c caferr.h  or one of the other system-wide error codes 
   1.589 +						for any other errors.
   1.590 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.591 +		*/
   1.592 +		virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus) = 0;
   1.593 +
   1.594 +		/** Request notification for an event for an object within the file.
   1.595 +		NB: No assumption should be made about the scope of the descriptor 
   1.596 +		passed to aUniqueId for asynchronous IPC.
   1.597 +
   1.598 +		@param aMask Bitmask of events the caller is interested in.
   1.599 +		@param aStatus The TRequestStatus object to complete if the event occurs.
   1.600 +		@param aUniqueId The UniqueId of the container or content. 
   1.601 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.602 +		*/
   1.603 +		virtual void NotifyStatusChange(TEventMask aMask, TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
   1.604 +		
   1.605 +		/** Cancel a previous notification request
   1.606 +
   1.607 +		@param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
   1.608 +		@param aUniqueId The UniqueId of the content object within the file.
   1.609 +		@return The outcome of the cancel request.
   1.610 +		@return KErrNone if the request was cancelled.
   1.611 +		@return KErrNotFound if there was no matching request outstanding.
   1.612 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.613 +		*/
   1.614 +		virtual TInt CancelNotifyStatusChange(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
   1.615 +
   1.616 +		/** Request the agent to obtain rights for a protected content object.
   1.617 +		NB: No assumption should be made about the scope of the descriptor 
   1.618 +		passed to aUniqueId for asynchronous IPC.
   1.619 +
   1.620 +		This request may be handled differently by different agents. 
   1.621 +		Some agents may open a browser and direct the user to a URL. Others may 
   1.622 +		download and install the rights in the background.
   1.623 +
   1.624 +		The call should not block execution, applications can wait for a notification 
   1.625 +		if they are interested in the outcome. 
   1.626 +		
   1.627 +		If a rights request completes sucessfully it does not necessarily mean rights 
   1.628 +		are available. It just means the request is complete.
   1.629 +
   1.630 +		@param aStatus Asynchronous request status. On completion this will contain 
   1.631 +						one of the following error codes:
   1.632 +						KErrNone if the rights request was successful.
   1.633 +						KErrCANotSupported  if the agent does not allow rights requests.
   1.634 +						Otherwise one of the other CAF error codes defined in \c caferr.h  
   1.635 +						or one of the other system-wide error codes 
   1.636 +						for any other errors.
   1.637 +
   1.638 +		@param aUniqueId The unique id of the object within the file.
   1.639 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.		
   1.640 +		*/
   1.641 +		virtual void RequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0; 
   1.642 +
   1.643 +		/** Cancel a previous RequestRights() request
   1.644 +
   1.645 +		@param aStatus The TRequestStatus that was supplied to the RequestRights() function.
   1.646 +		@param aUniqueId The objects Unique Id that was supplied to the RequestRights() function.
   1.647 +		@return The result of the cancel rights request.
   1.648 +		@return KErrNone if the rights request was cancelled.
   1.649 +		@return KErrNotFound if there was no matching rights request outstanding.
   1.650 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.651 +		*/
   1.652 +		virtual TInt CancelRequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
   1.653 +
   1.654 +		/** View information associated with a single content object
   1.655 +		
   1.656 +		This call blocks execution and only returns once the display is dismissed 
   1.657 +		by the user.
   1.658 +
   1.659 +		@param aInfo The information to display.
   1.660 +		@param aUniqueId The unique id of the object within the file.
   1.661 +		@leave KErrCANotSupported if information cannot be displayed or does not exist.
   1.662 +		@leave ...			One of the other CAF error codes defined in \c caferr.h  
   1.663 +							or one of the system-wide error codes for 
   1.664 +							any other errors.
   1.665 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   1.666 +		*/
   1.667 +		virtual void DisplayInfoL(TDisplayInfo aInfo, const TDesC& aUniqueId) = 0;
   1.668 +
   1.669 +		/** 
   1.670 +		Allows an application to request the modification of a property 
   1.671 +		within the agent handling this content. The agent may or may not
   1.672 +		permit the property to be changed
   1.673 +		 	
   1.674 +		@param aProperty The property to set.
   1.675 +		@param aValue The value of the property.
   1.676 +		@return Whether the property was set.
   1.677 +		@return KErrNone if the property was set.
   1.678 +		@return KErrCANotSupported if the agent does not support the property or value.
   1.679 +		@return KErrAccessDenied if the agent does not permit the property to be changed.
   1.680 +		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
   1.681 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   1.682 +		*/
   1.683 +		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
   1.684 +		
   1.685 +		};
   1.686 +
   1.687 +	/**
   1.688 +	 Defines the interface for importing files into a Content access agent. 
   1.689 +
   1.690 +	The agent should treat the import as a transaction and either import the
   1.691 +	entire file or revert to the state before the import if the import is cancelled.
   1.692 +	
   1.693 +	The client cancels an import by deleting the CAgentImportFile object 
   1.694 +	before WriteDataComplete() is called. 
   1.695 +	 
   1.696 +	 @publishedPartner
   1.697 +	 @released
   1.698 +	 */
   1.699 +	class CAgentImportFile : public CBase
   1.700 +		{
   1.701 +	public:
   1.702 +
   1.703 +		/** Writes a block of data from a file to the agent
   1.704 +		
   1.705 +		@param aData The block of data.
   1.706 +		@return	The result of the write operation.
   1.707 +		@return KErrNone if the data was written successfully.
   1.708 +		@return	KErrCANewFileHandleRequired if the agent requires the client to provide a new file handle before proceeding. The agent must save its state and continue processing when the new handle is supplied by ContinueWithNewOutputFile().
   1.709 +		@return KErrNotReady if the agent was not expecting WriteData() to be called at this point.
   1.710 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.711 +				other system-wide error codes for any other errors.
   1.712 +		*/
   1.713 +		virtual TInt WriteData(const TDesC8& aData)=0;
   1.714 +
   1.715 +		/** Signals to the agent that the entire file has now been transferred to the agent.
   1.716 +		
   1.717 +		@return The result of the write operation. 
   1.718 +		@return KErrNone if the data was written successfully.
   1.719 +		@return	KErrCANewFileHandleRequired if the agent requires the client to provide a new file handle before proceeding. The agent must save its state and continue processing when the new handle is supplied by ContinueWithNewOutputFile().
   1.720 +		@return KErrNotReady if the agent was not expecting WriteDataComplete() to be called at this point.
   1.721 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.722 +				other system-wide error codes for any other errors.		
   1.723 +		*/
   1.724 +		virtual TInt WriteDataComplete()=0;
   1.725 +
   1.726 +		/** Asynchronously writes a block of data from a file the agent
   1.727 +		 
   1.728 +		Notifies the client when the write operation is complete.
   1.729 +		
   1.730 +		@param aData 	The block of data.
   1.731 +		@param aStatus 	Asynchronous request status. On completion this will 
   1.732 +						contain one of the following error codes: KErrNone if the data was written successfully. 
   1.733 +						KErrCANewFileHandleRequired if the agent requires a new 
   1.734 +						file handle before proceeding - the agent must save its 
   1.735 +						state and continue processing when the new handle 
   1.736 +						is supplied by ContinueWithNewOutputFile().
   1.737 +						KErrNotReady if the agent was not expecting WriteDataComplete() 
   1.738 +						to be called at this point. Otherwise one of the other CAF error codes 
   1.739 +						defined in \c caferr.h  or one of the other standard system-wide 
   1.740 +						error codes for any other errors.
   1.741 +		*/
   1.742 +		virtual void WriteData(const TDesC8& aData, TRequestStatus& aStatus)=0;
   1.743 +
   1.744 +		/** Signals to the agent that the entire file has now been transferred to the agent
   1.745 +		
   1.746 +		Notifies the client when any final processing operation is complete.
   1.747 +		
   1.748 +		@param aStatus 	Asynchronous request status. On completion this will 
   1.749 +						contain one of the following error codes: KErrNone if the data was written successfully. 
   1.750 +						KErrCANewFileHandleRequired if the agent requires a new 
   1.751 +						file handle before proceeding - the agent must save its 
   1.752 +						state and continue processing when the new handle 
   1.753 +						is supplied by ContinueWithNewOutputFile().
   1.754 +						KErrNotReady if the agent was not expecting WriteDataComplete() 
   1.755 +						to be called at this point. Otherwise one of the other CAF error codes 
   1.756 +						defined in \c caferr.h  or one of the other standard system-wide 
   1.757 +						error codes for any other errors.
   1.758 +		*/
   1.759 +		virtual void WriteDataComplete(TRequestStatus& aStatus)=0;
   1.760 +
   1.761 +		/** Gets the number of output files produced so far. 
   1.762 +		@return The number of output files.
   1.763 +		*/
   1.764 +		virtual TInt OutputFileCountL() const = 0;
   1.765 +
   1.766 +		/** Return information about an output file generated by the import operation. 
   1.767 +		
   1.768 +		 It is possible that the output file does not have the same name 
   1.769 +		 as the one suggested at the beginning of the import. An agent may
   1.770 +		 need to use a particular file extension or a particular name.
   1.771 +
   1.772 +		The agent may decide not to store the output file in the output directory 
   1.773 +		suggested at the start of the import. eg. it may store the file in its private 
   1.774 +		server directory.
   1.775 +
   1.776 +		The output files may only appear in this array after the WriteDataComplete() 
   1.777 +		function has been called. 
   1.778 +
   1.779 +		@param aIndex The zero-based index of the file (must be less than the value returned by OutputFileCountL().
   1.780 +		@return The CSupplierOutputFile for this object.
   1.781 +		*/
   1.782 +		virtual CSupplierOutputFile& OutputFileL(TInt aIndex) = 0;
   1.783 +
   1.784 +		/** Retrieve the import status
   1.785 +
   1.786 +		Used to indicate non fatal problems encountered during the import operation.
   1.787 +		Provides feedback to the client in case any problems are encountered.
   1.788 +
   1.789 +		The client can then decide whether or not to continue the import.
   1.790 +		 
   1.791 +		@return	The state of the import operation.
   1.792 +		*/
   1.793 +		virtual TImportStatus GetImportStatus() const = 0;
   1.794 +
   1.795 +		
   1.796 +		/** Get the agents suggestion for the file extension of the output file required by the agent
   1.797 +
   1.798 +		This function should only be called when the agent has returned KErrCANewFileHandleRequired from
   1.799 +		WriteData() or WriteDataComplete().
   1.800 +
   1.801 +		The extension must include the dot '.' character.
   1.802 +
   1.803 +		@param aFileExtension On completion this will contain the appropriate file extension.
   1.804 +		@return The result of the request for a file extension.
   1.805 +		@return KErrNone if the agent populated aFileExtension with the correct file extension.
   1.806 +		@return KErrNotReady if the agent is not waiting for another file handle to be provided.
   1.807 +		@return KErrUnknown if the agent does not know what extension should be used.
   1.808 +		*/
   1.809 +		virtual TInt GetSuggestedOutputFileExtension(TDes& aFileExtension) = 0;
   1.810 +
   1.811 +		/** Get the agents suggestion for the file name (with extension) of the output file required by the agent
   1.812 +
   1.813 +		This function should only be called when the agent has returned KErrCANewFileHandleRequired from
   1.814 +		WriteData() or WriteDataComplete().
   1.815 +
   1.816 +		The file name is of the form filename.extension.
   1.817 +
   1.818 +		@param aFileName On completion this will contain the appropriate filename.
   1.819 +		@return KErrNone if the agent populated aFileName with the correct file name.
   1.820 +		@return KErrNotReady if the agent is not waiting for another file handle to be provided.
   1.821 +		@return KErrUnknown if the agent does not know what file name should be used.
   1.822 +		*/
   1.823 +		virtual TInt GetSuggestedOutputFileName(TDes& aFileName) = 0;
   1.824 +
   1.825 +		/** Continue the last write operation with a new file handle as requested by the agent
   1.826 +
   1.827 +		@param aFile A new file handle opened with write permission.
   1.828 +		@param aFileName The name of the file handle that has  been supplied. This is used by the agent when creating CSupplierOutputFile objects. It should include the full path and filename in order to be consistent with files generated by the agent.
   1.829 +		@return The result of the continuing write operation.
   1.830 +		@return KErrNone if the WriteData() or WriteDataComplete() operation is now complete.
   1.831 +		@return KErrCANewFileHandleRequired if the agent requires a new 
   1.832 +						file handle before proceeding - the agent must save its 
   1.833 +						state and continue processing when the new handle 
   1.834 +						is supplied by ContinueWithNewOutputFile().
   1.835 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.836 +				other system-wide error codes for any other errors.		
   1.837 +		*/
   1.838 +		virtual TInt ContinueWithNewOutputFile(RFile& aFile, const TDesC& aFileName) = 0;
   1.839 +
   1.840 +		/** Continue the last write operation with a new file handle and return the result asynchronously.
   1.841 +
   1.842 +		@param aFile A new file handle opened with write permission
   1.843 +		@param aFileName The name of the file handle that has  been supplied. This is used by the agent when creating CSupplierOutputFile objects. It should include the full path and filename in order to be consistent with files generated by the agent
   1.844 +		
   1.845 +		@param aStatus 	Asynchronous request status. On completion this will 
   1.846 +						contain one of the following error codes: KErrNone if the 
   1.847 +						WriteData() or WriteDataComplete() operation is now complete.
   1.848 +						KErrCANewFileHandleRequired if the agent requires a new 
   1.849 +						file handle before proceeding - the agent must save its 
   1.850 +						state and continue processing when the new handle 
   1.851 +						is supplied by ContinueWithNewOutputFile(). Otherwise one of the 
   1.852 +						other CAF error codes defined in \c caferr.h  or one of the 
   1.853 +						other system-wide error codes for any other errors.
   1.854 +		*/
   1.855 +		virtual void ContinueWithNewOutputFile(RFile& aFile, const TDesC& aFileName, TRequestStatus& aStatus) = 0;
   1.856 +		
   1.857 +		/** Cancel an outstanding asynchronous WriteData() request.
   1.858 +		*/
   1.859 +		IMPORT_C virtual void Cancel();
   1.860 +		
   1.861 +		/** Retrieve the content MIME type based on available data
   1.862 +		
   1.863 +		This function should only be called when the agent has returned KErrCANewFileHandleRequired from WriteData()
   1.864 +		If the agent cannot return a content MIME type, the importer should assume that no content type
   1.865 +		will be available until after the import session has been finished 
   1.866 +
   1.867 +		@param aContentMime On return this will contain the appropriate content MIME type.
   1.868 +		@return The result of the request for a content MIME type.
   1.869 +		@return ETrue if the agent populated aContentMime with the correct content MIME type.
   1.870 +		@return EFalse if the agent cannot return the content MIME type (for example, there 
   1.871 +					is not enough data, or the content is multi-part)
   1.872 +		*/
   1.873 +		IMPORT_C virtual TBool ContentMimeTypeL(TDes8& aContentMime);
   1.874 +				
   1.875 +		};
   1.876 +
   1.877 +	/**
   1.878 +	 Defines the agent interface for manager operations. 
   1.879 +	 
   1.880 +	 The CAgentManager is not related to any particular content object but 
   1.881 +	 used to manage files and settings belonging to this agent
   1.882 +	 
   1.883 +	All operations performed by the agent manager should be implemented in a 
   1.884 +	transactional manner by either completing or reverting to the state before
   1.885 +	the function was called.
   1.886 +	 
   1.887 + 	 @publishedPartner
   1.888 +	 @released
   1.889 +	 */	
   1.890 +	class CAgentManager : public CBase
   1.891 +		{
   1.892 +	public:
   1.893 +		/** 
   1.894 +		 Delete a file belonging to this agent
   1.895 +
   1.896 +		 The agent implementation may delete rights that were associated with 
   1.897 +		 the content at the same time. If an agent does delete rights at the same
   1.898 +		 time as the content it should display a confirmation dialog that makes it
   1.899 +		 clear to the user the rights they paid for will be also deleted. 
   1.900 +
   1.901 +		 Execution will be blocked until any dialog displayed is complete. Applications 
   1.902 +		 can request to disable the agents user interface using the SetProperty() command
   1.903 +		 
   1.904 +		 Access to the agents private directory is permitted at the 
   1.905 +		 agents discretion.
   1.906 +
   1.907 +		 @param aFileName The full pathname of the file to delete.
   1.908 +		 @return The outcome of the delete operation.
   1.909 +		 @return KErrNone if the file was deleted successfully.
   1.910 +		 @return KErrCancel if the user selects cancel in an agent supplied confirmation screen.
   1.911 +		 @return KErrAccessDenied if the agent does not allow the file to be deleted.
   1.912 +		 @return KErrCANotSupported if the agent does not support file deletion
   1.913 +		 @return KErrPermissionDenied if the client does not have the necessary capabilities to delete the file.
   1.914 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.915 +				other system-wide error codes for any other errors.
   1.916 +		 @capability DRM Deleting DRM protected content is not permitted for processes without DRM capability. 
   1.917 +		 */
   1.918 +		virtual TInt DeleteFile(const TDesC &aFileName) = 0;
   1.919 +
   1.920 +		/**
   1.921 +		Make a copy of the content file (eg to removable media) belonging to this agent
   1.922 +
   1.923 +		Access to the agents private directory is permitted at the 
   1.924 +		agents discretion.
   1.925 +
   1.926 +  		@param aSource The full pathname of the source file.
   1.927 +		@param aDestination The full pathname of the destination file.
   1.928 +		@return The outcome of the copy operation.
   1.929 +		@return KErrNone if the file was copied successfully.
   1.930 +		@return KErrAccessDenied if the agent does not allow the file to be copied.
   1.931 +		@return KErrCANotSupported if the agent does not support file copying.
   1.932 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
   1.933 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.934 +				other system-wide error codes for any other errors.
   1.935 +  		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
   1.936 +		*/
   1.937 +		virtual TInt CopyFile(const TDesC& aSource, const TDesC& aDestination) = 0;
   1.938 +
   1.939 +		/**
   1.940 +		Rename or move the content file (eg to removable media) belonging to this agent
   1.941 +
   1.942 +		Access to the agent private directories is permitted at the 
   1.943 +		agents discretion.
   1.944 +
   1.945 +		@param aSource The full pathname of the source file.
   1.946 +		@param aDestination The full pathname of the destination file.
   1.947 +		@return The outcome of the Rename operation.
   1.948 +		@return KErrNone if the file was moved or renamed successfully.
   1.949 +		@return KErrAccessDenied if the agent does not allow the file to be moved or renamed.
   1.950 +		@return KErrCANotSupported if the agent does not support file renaming.
   1.951 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to move or rename the file.
   1.952 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.953 +				other system-wide error codes for any other errors.
   1.954 +  		@capability DRM Moving DRM protected files is not permitted for processes without DRM capability. Moving unprotected files is permitted
   1.955 +		*/
   1.956 +		virtual TInt RenameFile(const TDesC& aSource, const TDesC& aDestination) = 0;
   1.957 +
   1.958 +		/** Create a directory
   1.959 +
   1.960 +		This function can be used to create a directory within in the agent's 
   1.961 +		private directory. Access to the agents private directory is permitted at the 
   1.962 +		agents discretion. 
   1.963 +
   1.964 +		@param aPath The full pathname of the directory to create.
   1.965 +		@return The outcome of the MkDir operation.
   1.966 +		@return KErrNone if the directory was created successfully.
   1.967 +		@return KErrAccessDenied if the agent does not allow the directory to be created.
   1.968 +		@return KErrCANotSupported if the agent does not support directory creation.
   1.969 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
   1.970 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.971 +				other system-wide error codes for any other errors.
   1.972 +		
   1.973 +		@capability DRM Required when attempting to access an agents private directory
   1.974 +		*/
   1.975 +		virtual TInt MkDir(const TDesC& aPath) = 0;
   1.976 +
   1.977 +		/** Create all directories in the given path if they do not exist
   1.978 +
   1.979 +		This function can be used to create directories within in the agent's 
   1.980 +		private directory. Access to the agents private directory is permitted at the 
   1.981 +		agents discretion. 
   1.982 +		
   1.983 +		@param aPath The full pathname of the directory to create.
   1.984 +		@return The outcome of the MkDirAll operation.
   1.985 +		@return KErrNone if the directory was created successfully.
   1.986 +		@return KErrAccessDenied if the agent does not allow the directory to be created.
   1.987 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
   1.988 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   1.989 +				other system-wide error codes for any other errors.
   1.990 +		@capability DRM Required when attempting to access an agents private directory
   1.991 +		*/
   1.992 +		virtual TInt MkDirAll(const TDesC& aPath) = 0;
   1.993 +
   1.994 +		/** Remove a directory
   1.995 +
   1.996 +		This function can be used to remove a directory from within the agent's 
   1.997 +		private directory. Access to the agents private directory is permitted 
   1.998 +		at the agents discretion. 
   1.999 +		
  1.1000 +		@param aPath The full pathname of the directory to remove.
  1.1001 +		@return The outcome of the RmDir operation.
  1.1002 +		@return KErrNone if the directory was removed successfully.
  1.1003 +		@return KErrAccessDenied if the agent does not allow the directory to be removed.
  1.1004 +		@return KErrCANotSupported if the agent does not support directory removal.
  1.1005 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
  1.1006 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1007 +				other system-wide error codes for any other errors.
  1.1008 +		@capability DRM Required when attempting to access an agents private directory
  1.1009 +		*/
  1.1010 +		virtual TInt RmDir(const TDesC& aPath) = 0;
  1.1011 +
  1.1012 +		/**  Gets a filtered list of a directory's contents. 
  1.1013 +
  1.1014 +		The bitmask determines which file and directory entry types should be listed. The sort key determines the order in which they are listed.
  1.1015 +
  1.1016 +		Notes:
  1.1017 +		-# If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.
  1.1018 +		-# The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.
  1.1019 +		-# The caller of this function is responsible for deleting aFileList after the function has returned.
  1.1020 +
  1.1021 +
  1.1022 +		This function can be used to list the contents of the agent's 
  1.1023 +		private directory. Access to the agents private directory is permitted at 
  1.1024 +		the agents discretion. 
  1.1025 +		
  1.1026 +		Agents can just return KErrCANotSupported if they do not wish to publish their
  1.1027 +		private directory. Alternatively they can just populate the CDir object
  1.1028 +		with the entries they wish to show.
  1.1029 +	
  1.1030 +  		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files.
  1.1031 +		@param aEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in the listing. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes 
  1.1032 +		@param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey. 
  1.1033 +		@param aEntryList On return contains a filtered list of directory and file entries.
  1.1034 +		@return The outcome of the GetDir operation.
  1.1035 +		@return KErrNone if the directory contents were listed successfully.
  1.1036 +		@return KErrCANotSupported if the agent does not allow clients to view its private directory.
  1.1037 +		@return KErrPermissionDenied if the process does not have the correct capabilities to view the directory.
  1.1038 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1039 +				other system-wide error codes for any other errors.
  1.1040 +		@capability DRM Required when attempting to access an agents private directory
  1.1041 +		*/
  1.1042 +		virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList) const = 0;
  1.1043 +
  1.1044 +		/**  Gets a filtered list of the directory and file entries contained in a directory and a list of the directory entries only
  1.1045 +
  1.1046 +		The bitmask determines which file and directory entry types should be listed in aFileList. The contents of the second list, aDirList are not affected by the bitmask; it returns all directory entries contained in directory aName. The sort key determines the order in which both lists are sorted.
  1.1047 +
  1.1048 +		Notes:
  1.1049 +		-# If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.
  1.1050 +		-# The function sets both aFileList and aDirList to NULL, and then allocates memory to them before appending entries to the lists. Therefore, aFileList and aDirList should have no memory allocated to them before this function is called, otherwise the allocated memory will become orphaned.
  1.1051 +		-# The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.
  1.1052 +
  1.1053 +		This function can be used to list the contents of the agent's 
  1.1054 +		private directory. Access to the agents private directory is permitted at 
  1.1055 +		the agents discretion. 
  1.1056 +
  1.1057 +		Agents can just return KErrCANotSupported if they do not wish to publish their
  1.1058 +		private directory. Alternatively they can just populate the CDir object
  1.1059 +		with the entries they wish to show.
  1.1060 +
  1.1061 +		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files. 
  1.1062 +		@param aEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in aFileList. aDirList is unaffected by this mask. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.
  1.1063 +		@param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries in both lists are to be sorted. These flags are defined by TEntryKey. 
  1.1064 +		@param aEntryList On return contains a filtered list of directory and file entries. 
  1.1065 +		@param aDirList On return contains a filtered list of directory entries only.
  1.1066 +		@return The outcome of the GetDir operation.
  1.1067 +		@return KErrNone The directory contents were listed successfully.
  1.1068 +		@return KErrCANotSupported The agent does not allow clients to view its private directory.
  1.1069 +		@return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
  1.1070 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1071 +				other system-wide error codes for any other errors.
  1.1072 +		@capability DRM Required when attempting to access an agents private directory
  1.1073 +		*/
  1.1074 +		virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList,CDir*& aDirList) const = 0;
  1.1075 +
  1.1076 +		/**  Gets a filtered list of a directory's contents by UID
  1.1077 +
  1.1078 +		The aUidType parameter determines which file entry types should be listed. The sort key determines the order in which they are listed.
  1.1079 +
  1.1080 +		Notes:
  1.1081 +		-# The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.
  1.1082 +		-# The caller of this function is responsible for deleting aFileList after the function has returned.
  1.1083 +
  1.1084 +		This function can be used to list the contents of the agent's 
  1.1085 +		private directory. Access to the agents private directory is permitted at 
  1.1086 +		the agents discretion. 
  1.1087 +
  1.1088 +		Agents can just return KErrCANotSupported if they do not wish to publish their
  1.1089 +		private directory. Alternatively they can just populate the CDir object
  1.1090 +		with the entries they wish to show.
  1.1091 +
  1.1092 +		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files. 
  1.1093 +		@param aEntryUid Only those files whose UIDs match those specified within this UID type will be included in the file list. Any, or all, of the three UIDs within the UID type may be omitted. Any UID which is omitted acts in a similar manner to a wildcard character, matching to all UIDs. 
  1.1094 +		@param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
  1.1095 +		@param aFileList On return contains a filtered list of directory and file entries.
  1.1096 +		@return The outcome of the GetDir operation.
  1.1097 +		@return KErrNone The directory contents were listed successfully.
  1.1098 +		@return KErrCANotSupported The agent does not allow clients to view its private directory.
  1.1099 +		@return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
  1.1100 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1101 +				other system-wide error codes for any other errors.
  1.1102 +		@capability DRM Required when attempting to access an agents private directory
  1.1103 +		*/
  1.1104 +		virtual TInt GetDir(const TDesC& aName,const TUidType& aEntryUid,TUint aEntrySortKey, CDir*& aFileList) const = 0;
  1.1105 +		
  1.1106 +		/**  Get an attribute from a content object
  1.1107 +	
  1.1108 +		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
  1.1109 +		@param aValue Used to return the value of the attribute.
  1.1110 +		@param aVirtualPath The content object whose attributes are to be queried.
  1.1111 +		@return Whether the attribute value was updated.
  1.1112 +		@return KErrNone if the attribute value was updated.
  1.1113 +		@return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
  1.1114 +		@return KErrCANotSupported if the requested attribute is not supported for this content object.
  1.1115 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1116 +				other system-wide error codes for any other errors.
  1.1117 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1118 +		*/
  1.1119 +		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath) = 0;
  1.1120 +
  1.1121 +		/**  Get a content's attribute from a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1122 +	
  1.1123 +		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
  1.1124 +		@param aValue Used to return the value of the attribute.
  1.1125 +		@param aFile The file handle for the file containing the content object.
  1.1126 +		@param aUniqueId The unique id of the content object.
  1.1127 +		@return Whether the attribute value was updated.
  1.1128 +		@return KErrNone if the attribute value was updated.
  1.1129 +		@return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
  1.1130 +		@return KErrCANotSupported if the feature or the requested attribute is not supported for this content object.
  1.1131 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1132 +				other system-wide error codes for any other errors.
  1.1133 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1134 +		*/
  1.1135 +		IMPORT_C virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, RFile& aFile, const TDesC& aUniqueId);
  1.1136 +		
  1.1137 +		/** Get a set of attributes from a content object
  1.1138 +
  1.1139 +		@param aAttributeSet The set of attributes to query and update.
  1.1140 +		@param aVirtualPath The content object to retrieve attributes from.
  1.1141 +		@return Whether the attribute set was updated.
  1.1142 +		@return KErrNone if the attribute set was updated successfully.
  1.1143 +		@return KErrNotFound if the content object was not found.
  1.1144 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1145 +				other system-wide error codes for any other errors.
  1.1146 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1147 +		*/
  1.1148 +		virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath) = 0;
  1.1149 +		
  1.1150 +		/** Get a content's set of attributes from a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1151 +
  1.1152 +		@param aAttributeSet The set of attributes to query and update.
  1.1153 +		@param aFile The file handle for the file containing the content object.
  1.1154 +		@param aUniqueId The unique id of the content object.
  1.1155 +		@return Whether the attribute set was updated.
  1.1156 +		@return KErrNone if the attribute set was updated successfully.
  1.1157 +		@return KErrNotFound if the content object was not found.
  1.1158 +		@return KErrCANotSupported if the feature not supported.
  1.1159 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1160 +				other system-wide error codes for any other errors.
  1.1161 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1162 +		*/
  1.1163 +		IMPORT_C virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, RFile& aFile, const TDesC& aUniqueId);	
  1.1164 +
  1.1165 +		/**  Get text string attributes or meta-data from the file 
  1.1166 +
  1.1167 +		@param aAttribute The attribute to retrieve, from ContentAccess::TStringAttribute.
  1.1168 +		@param aValue Used to return the value of the attribute.
  1.1169 +		@param aVirtualPath The content object whose attributes are to be retrieved.
  1.1170 +		@return Whether the value was updated.
  1.1171 +		@return KErrNone if the attribute was retrieved successfully.
  1.1172 +		@return KErrNotFound if the content object does not exist.
  1.1173 +		@return KErrCANotSupported if the requested attribute does not apply to this content object.
  1.1174 +		@return KErrOverflow if the buffer was not large enough to return the result.
  1.1175 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1176 +				other system-wide error codes for any other errors.
  1.1177 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1178 +		*/
  1.1179 +		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath) = 0;
  1.1180 +
  1.1181 +		/**  Get a content's text string attribute from a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1182 +	
  1.1183 +		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
  1.1184 +		@param aValue Used to return the value of the attribute.
  1.1185 +		@param aFile The file handle for the file containing the content object.
  1.1186 +		@param aUniqueId The unique id of the content object whose attributes are to be retrieved.
  1.1187 +		@return Whether the attribute value was updated.
  1.1188 +		@return KErrNone if the attribute value was updated.
  1.1189 +		@return KErrNotFound if the content object does not exist.
  1.1190 +		@return KErrCANotSupported if the feature or the requested attribute is not supported for this content object.
  1.1191 +		@return KErrOverflow if the buffer was not large enough to return the result.
  1.1192 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1193 +				other system-wide error codes for any other errors.
  1.1194 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1195 +		*/		
  1.1196 +		IMPORT_C virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, RFile& aFile, const TDesC& aUniqueId);
  1.1197 +
  1.1198 +		/** Used to obtain a set of string attributes 
  1.1199 +
  1.1200 +		@param aStringAttributeSet The set of attributes to query and update.
  1.1201 +		@param aVirtualPath The content object whose attributes are to be retrieved.
  1.1202 +		@return Whether the string attribute set was updated.
  1.1203 +		@return KErrNone if the attribute set was updated successfully.
  1.1204 +		@return KErrNotFound if the object with the given virtual path was not found.
  1.1205 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1206 +				other system-wide error codes for any other errors.
  1.1207 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1208 +		*/
  1.1209 +		virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TVirtualPathPtr& aVirtualPath) = 0;
  1.1210 +
  1.1211 +		/** Get a content's set of string attributes from a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1212 +
  1.1213 +		@param aStringAttributeSet The set of attributes to query and update.
  1.1214 +		@param aFile The file handle for the file containing the content object.
  1.1215 +		@param aUniqueId The unique id of the content object whose attributes are to be retrieved	
  1.1216 +		@return Whether the string attribute set was updated.
  1.1217 +		@return KErrNone if the attribute set was updated successfully.
  1.1218 +		@return KErrNotFound if the object with the given virtual path was not found.
  1.1219 +		@return KErrCANotSupported if the feature not supported.
  1.1220 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1221 +				other system-wide error codes for any other errors.
  1.1222 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1223 +		*/
  1.1224 +		IMPORT_C virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, RFile& aFile, const TDesC& aUniqueId);
  1.1225 +				
  1.1226 +		/** Notify the caller when the status of a DRM protected content object changes.
  1.1227 +		NB: No assumption should be made about the scope of the descriptor 
  1.1228 +		passed to aURI for asynchronous IPC.
  1.1229 +
  1.1230 +		@param aURI The location of the file.
  1.1231 +		@param aMask Bitmask of events the caller is interested in.
  1.1232 +		@param aStatus The TRequestStatus object to complete if the event occurs, or KErrCANotSupported if the agent does not support asynchronous notifications.
  1.1233 +		@capability DRM Deleting DRM protected content is not permitted for processes without DRM capability. 
  1.1234 +		*/
  1.1235 +		virtual void NotifyStatusChange(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus) = 0;
  1.1236 +
  1.1237 +		/** Cancel a previous notification request
  1.1238 +		@param aURI The URI supplied in the call to NotifyStatusChange().
  1.1239 +		@param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
  1.1240 +		@return The outcome of the cancel request.
  1.1241 +		@return KErrNone if the notification was cancelled.
  1.1242 +		@return KErrNotFound if there was no matching request outstanding.
  1.1243 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
  1.1244 +		*/
  1.1245 +		virtual TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus) = 0;
  1.1246 +
  1.1247 +		/** 
  1.1248 +		Allows an application to request the modification of a property 
  1.1249 +		within the agent. The agent may or may not permit the property to be changed
  1.1250 +		 	
  1.1251 +		@param aProperty The property to set.
  1.1252 +		@param aValue The value of the property.
  1.1253 +		@return The outcome of the set property command.
  1.1254 +		@return KErrNone if the property was set by all agents.
  1.1255 +		@return KErrCANotSupported if one of the agent does not support the property or value.
  1.1256 +		@return KErrAccessDenied if one of the agents does not permit the property to be changed.
  1.1257 +		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
  1.1258 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
  1.1259 +		*/
  1.1260 +		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
  1.1261 +
  1.1262 +		/** View information associated with a single content object
  1.1263 +		
  1.1264 +		This call blocks execution and only returns once the display is dismissed 
  1.1265 +		by the user.
  1.1266 +
  1.1267 +		@param aInfo The information to display.
  1.1268 +		@param aVirtualPath The content object.
  1.1269 +		@leave KErrCANotSupported if agent cannot display the requested information.
  1.1270 +		@leave ...		One of the other CAF error codes defined in \c caferr.h  
  1.1271 +		 				or one of the system-wide error codes 
  1.1272 +						for any other errors.		
  1.1273 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1274 +		*/
  1.1275 +		virtual void DisplayInfoL(TDisplayInfo aInfo, const TVirtualPathPtr& aVirtualPath) = 0;
  1.1276 +
  1.1277 +		/** View information associated with a single content object in a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1278 +		
  1.1279 +		This call blocks execution and only returns once the display is dismissed 
  1.1280 +		by the user.
  1.1281 +
  1.1282 +		@param aInfo The information to display.
  1.1283 +		@param aFile The file handle for the file containing the content object.
  1.1284 +		@param aUniqueId The unique id of the content object.	
  1.1285 +		@leave KErrCANotSupported if the feature not supported or if agent cannot display the requested information.
  1.1286 +		@leave ...		One of the other CAF error codes defined in \c caferr.h  
  1.1287 +		 				or one of the system-wide error codes 
  1.1288 +						for any other errors.		
  1.1289 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1290 +		*/
  1.1291 +		IMPORT_C virtual void DisplayInfoL(TDisplayInfo aInfo, RFile& aFile, const TDesC& aUniqueId);
  1.1292 +	
  1.1293 +		/** 
  1.1294 +		Identifies whether or not the file at the given URI is to be handled by
  1.1295 +		this agent.
  1.1296 +
  1.1297 +		The agent should perform the mimimum possible processing to make the recognition
  1.1298 +		process as fast as possible. It should avoid opening the file whenever possible.
  1.1299 +		
  1.1300 +		The agent should leave only if a temporary or permanent condition prevents it from knowing
  1.1301 +		whether it can detect the content's type.
  1.1302 +		  
  1.1303 +		@param aURI		Location of the file to be examined.
  1.1304 +		@param aShareMode	The share mode to use if the agent opens a file.
  1.1305 +		@return			ETrue if this agent supports and recognises the file, EFalse otherwise. 
  1.1306 +		*/
  1.1307 +		virtual TBool IsRecognizedL(const TDesC& aURI, TContentShareMode aShareMode) const = 0;
  1.1308 +
  1.1309 +		/** 
  1.1310 +		Identifies whether or not the file is handled by this agent.
  1.1311 +
  1.1312 +		The agent should look at the name of the file first to try and avoid the need
  1.1313 +		to read from the file.
  1.1314 +		
  1.1315 +		The agent should leave only if a temporary or permanent condition prevents it from knowing
  1.1316 +		whether it can detect the content's type.		
  1.1317 +		  
  1.1318 +		@param aFile An open file handle.
  1.1319 +	    @return ETrue if this agent supports and recognises the file, EFalse otherwise. 
  1.1320 +		*/
  1.1321 +		virtual TBool IsRecognizedL(RFile& aFile) const = 0;
  1.1322 +
  1.1323 +		/** 
  1.1324 +		 Determines whether the file is recognized by this agent. 
  1.1325 +		 If it is the agent will fill in the file mime type and content mime 
  1.1326 +		 type. 
  1.1327 +		 
  1.1328 +		 The agent should attempt to recognized the file in an efficient manner
  1.1329 +		 It should avoid opening the file to provide the best performance.
  1.1330 +
  1.1331 +		 The agent should leave only if a temporary or permanent condition prevents it from 
  1.1332 +		 detecting content's type.
  1.1333 +
  1.1334 +		 The agent SHOULD NOT perform any API policing on this API since it
  1.1335 +		 will be called from within the Apparc server's process. 
  1.1336 +		  
  1.1337 +		 If a file is recognized, the file mime type should always be set to
  1.1338 +		 the correct value. For the content mime type there are three special cases:
  1.1339 +		 
  1.1340 +		 @li If the file needs to be imported through the Supplier API before
  1.1341 +		 it can be used then the agent should leave the aContentMimeType
  1.1342 +		 parameter blank (zero length). 
  1.1343 +		 
  1.1344 +		 @li If the file has no embedded content, eg an image/jpeg (.jpg) file 
  1.1345 +		 the agent should leave the aContentMimeType parameter blank (zero length).
  1.1346 +  
  1.1347 +		 @li If more than one content object is contained within the file, the agent will
  1.1348 +		 set aContentMimeType to "application/x-caf" indicating it is an archive that can
  1.1349 +		 be navigated by CAF regardless of the actual file format.
  1.1350 +		 
  1.1351 +		 @param aFileName			The name of the file to recognize. The name is examined, not the file itself.
  1.1352 +		 @param aBuffer				Buffer containing bytes from the start of the file.
  1.1353 +		 @param aFileMimeType 		Used to return the mime type of the file to the caller.
  1.1354 +		 @param aContentMimeType	Used to return the mime type of the content embedded within the file to the caller. This field should be zero length if there is no embedded content.
  1.1355 +	     @return				Whether or not the file was recognized.
  1.1356 + 		 @return ETrue if the file is handled by this agent. The aFileMimeType and aContentMimeType were updated.
  1.1357 +		 @return EFalse if the file was not recognized by this agent.
  1.1358 +		 */
  1.1359 +		virtual TBool RecognizeFileL(const TDesC& aFileName, const TDesC8& aBuffer, TDes8& aFileMimeType, TDes8& aContentMimeType) const = 0;
  1.1360 +
  1.1361 +		
  1.1362 +		/** Allows extended synchronous calls to the agent
  1.1363 +		Objects are passed in and out using serialization
  1.1364 +
  1.1365 +		@param aCommand The agent defined command.
  1.1366 +		@param aInputBuffer Non modifyable input data buffer.
  1.1367 +		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
  1.1368 +		@return The outcome of the agent specific command.
  1.1369 +		@return KErrNone if the command was successful.
  1.1370 +		@return KErrCANotSupported if the agent does not recognize the command.
  1.1371 +		@return KErrPermissionDenied if the agent does not permit the client to execute this command.
  1.1372 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  
  1.1373 +				or one of the other system-wide error codes 
  1.1374 +				for any other errors.		
  1.1375 +  		@capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
  1.1376 +		*/
  1.1377 +		virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer) = 0;
  1.1378 +
  1.1379 +		/** Allows extended asynchronous calls to the agent. 
  1.1380 +		Objects can be passed in and out using serialization.
  1.1381 +		NB: No assumption should be made about the scope of the descriptor 
  1.1382 +		passed to aInputBuffer for asynchronous IPC.
  1.1383 +
  1.1384 +		@param aCommand The agent defined command.
  1.1385 +		@param aInputBuffer Non modifyable input data buffer.
  1.1386 +		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
  1.1387 +		@param aStatus 	Asynchronous request status. On completion this will 
  1.1388 +						contain one of the following error codes: KErrNone if the command
  1.1389 +						was successful. KErrCANotSupported if the agent does 
  1.1390 +						not recognize the command. KErrPermissionDenied if the 
  1.1391 +						agent does not permit the client to execute this command.
  1.1392 +						Otherwise one of the other CAF error codes 
  1.1393 +						defined in \c caferr.h  or one of the other 
  1.1394 +						system-wide error codes for any other errors.
  1.1395 +		@capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
  1.1396 +		*/
  1.1397 +		virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus) = 0;
  1.1398 +
  1.1399 +		/** Allow the agent to display management information for users to 
  1.1400 +		manage any settings	or other information stored by the agent
  1.1401 +
  1.1402 +		The scope of this information is left to the agent implementation but it is expected
  1.1403 +		that a DRM agent will display the state of all DRM rights objects 
  1.1404 +		(pending, available, expired, orphaned) and allow users to delete rights 
  1.1405 +		that are no longer required.
  1.1406 +
  1.1407 +		@leave KErrCANotSupported If the agent does support the display of management information.
  1.1408 +		@capability DRM Agents implementing DRM may not display their management dialog to processes without DRM capability
  1.1409 +		*/
  1.1410 +		virtual void DisplayManagementInfoL() = 0;
  1.1411 +
  1.1412 +
  1.1413 +		/** Prepare the HTTP request headers required to download files that may be 
  1.1414 +		required for this agent.
  1.1415 +
  1.1416 +		@param aStringPool The string pool used by the HTTP session.
  1.1417 +		@param aRequestHeaders The agent will add any required headers to this object.
  1.1418 +		*/
  1.1419 +		virtual void PrepareHTTPRequestHeaders(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const = 0;
  1.1420 +
  1.1421 +		
  1.1422 +		/** Rename a directory
  1.1423 +
  1.1424 +		This function can be used to rename a directory from within the agent's 
  1.1425 +		private directory. Access to the agents private directory is permitted 
  1.1426 +		at the agents discretion. 
  1.1427 +		
  1.1428 +		@param aOldName The existing pathname of the directory to rename.
  1.1429 +		@param aNewName The new pathname of the directory.
  1.1430 +		@return The outcome of the RenameDir operation.
  1.1431 +		@return KErrNone if the directory was removed successfully.
  1.1432 +		@return KErrAccessDenied f the agent does not allow the directory to be removed.
  1.1433 +		@return KErrCANotSupported if the agent does not support directory removal.
  1.1434 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
  1.1435 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1436 +				other system-wide error codes for any other errors.
  1.1437 +		@capability DRM Required when attempting to access an agents private directory
  1.1438 +		*/
  1.1439 +		IMPORT_C virtual TInt RenameDir(const TDesC& aOldName, const TDesC& aNewName );
  1.1440 +		
  1.1441 +		/**
  1.1442 +		Make a copy of the content file (eg to removable media) belonging to this agent 
  1.1443 +		using a file handle
  1.1444 +
  1.1445 +		Access to the agents private directory is permitted at the 
  1.1446 +		agents discretion.
  1.1447 +
  1.1448 +  		@param aSource The handle the source file.
  1.1449 +		@param aDestination The full pathname of the destination file.
  1.1450 +		@return The outcome of the copy operation.
  1.1451 +		@return KErrNone if the file was copied successfully.
  1.1452 +		@return KErrAccessDenied if the agent does not allow the file to be copied.
  1.1453 +		@return KErrCANotSupported if the agent does not support file copying.
  1.1454 +		@return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
  1.1455 +		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1456 +				other system-wide error codes for any other errors.
  1.1457 +  		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
  1.1458 +		*/
  1.1459 +		IMPORT_C virtual TInt CopyFile(RFile& aSource, const TDesC& aDestination);
  1.1460 +		
  1.1461 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
  1.1462 +		/** 
  1.1463 +		Identifies whether or not the WMDRM content is handled by this agent using the header
  1.1464 +		data of WMDRM file or stream content.
  1.1465 +		
  1.1466 +		The agent should leave only if a temporary or permanent condition prevents it from knowing
  1.1467 +		whether it can detect the content's type.
  1.1468 +
  1.1469 +		@param aHeaderData	Header data of WMDRM file or stream content.
  1.1470 +	    @return ETrue 		If this agent recognises the given content. 
  1.1471 +		*/
  1.1472 +		IMPORT_C virtual TBool IsRecognizedL(const TDesC8& aHeaderData) const;
  1.1473 +		
  1.1474 +		/** 
  1.1475 +		 Determines whether or not the WMDRM content is recognized by this agent. 
  1.1476 +		 If it is recognized, the agent will populate the file and content mime 
  1.1477 +		 type. 
  1.1478 +		 
  1.1479 +		 The agent should leave only if a temporary or permanent condition prevents it from 
  1.1480 +		 detecting content's type.
  1.1481 +
  1.1482 +		 @param aHeaderData			Header data of WMDRM content.
  1.1483 +		 @param aFileMimeType 		Used to return the mime type of the content to the caller.
  1.1484 +		 @param aContentMimeType	Used to return the mime type of the content embedded within the file to the caller. This field should be zero length if there is no embedded content.
  1.1485 +	     @return					Whether or not the content was recognized.
  1.1486 + 		 @return ETrue 				If the content is handled by this agent. The aFileMimeType and aContentMimeType were updated.
  1.1487 +		 @return EFalse 			If the content was not recognized by this agent.
  1.1488 +		 */
  1.1489 +		IMPORT_C virtual TBool RecognizeContentL(const TDesC8& aHeaderData, TDes8& aFileMimeType, TDes8& aContentMimeType) const;
  1.1490 +		
  1.1491 +		/**  Get an attribute from WMDRM content.
  1.1492 +	
  1.1493 +		@param aHeaderData	Header data of WMDRM content.
  1.1494 +		@param aAttribute	The attribute to retrieve from ContentAccess::TAttribute.
  1.1495 +		@param aValue		Used to return the value of the attribute.
  1.1496 +		
  1.1497 +		@return				KErrNone if the attribute value was updated.
  1.1498 +		@return				KErrCANotSupported if the requested attribute is not supported for this content.
  1.1499 +		@return				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1500 +							other system-wide error codes for any other errors.
  1.1501 +		@capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1502 +		*/
  1.1503 +		IMPORT_C virtual TInt GetAttribute(const TDesC8& aHeaderData, TInt aAttribute, TInt& aValue);
  1.1504 +		
  1.1505 +		/** Get a set of attributes from WMDRM content.
  1.1506 +
  1.1507 +		@param aHeaderData		Header data of WMDRM content.
  1.1508 +		@param aAttributeSet	The set of attributes to query and update.
  1.1509 +		
  1.1510 +		@return 				KErrNone if the attribute set was updated successfully.
  1.1511 +		@return 				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1512 +								other system-wide error codes for any other errors.
  1.1513 +		@capability DRM 		Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1514 +		*/
  1.1515 +		IMPORT_C virtual TInt GetAttributeSet(const TDesC8& aHeaderData, RAttributeSet& aAttributeSet);
  1.1516 +		
  1.1517 +		
  1.1518 +		/**  Get text string attributes or meta-data from WMDRM content.
  1.1519 +
  1.1520 +		@param aHeaderData	Header data of WMDRM content.
  1.1521 +		@param aAttribute	The attribute to retrieve from ContentAccess::TStringAttribute.
  1.1522 +		@param aValue		Used to return the value of the attribute.
  1.1523 +		
  1.1524 +		@return				KErrNone if the attribute was retrieved successfully.
  1.1525 +		@return				KErrNotFound if the content object does not exist.
  1.1526 +		@return				KErrCANotSupported if the requested attribute does not apply to this content object.
  1.1527 +		@return				KErrOverflow if the buffer was not large enough to return the result.
  1.1528 +		@return				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1529 +							other system-wide error codes for any other errors.
  1.1530 +		@capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1531 +		*/
  1.1532 +		IMPORT_C virtual TInt GetStringAttribute(const TDesC8& aHeaderData, TInt aAttribute, TDes& aValue);
  1.1533 +		
  1.1534 +		/** Used to obtain a set of string attributes from WMDRM content.
  1.1535 +
  1.1536 +		@param aStringAttributeSet	The set of attributes to query and update.
  1.1537 +		@param aHeaderData			Header data of WMDRM content.
  1.1538 +	
  1.1539 +		@return 					KErrNone if the attribute set was updated successfully.
  1.1540 +		@return 					KErrNotFound if the object with the given virtual path was not found.
  1.1541 +		@return 					Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1.1542 +									other system-wide error codes for any other errors.
  1.1543 +		@capability DRM 			Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1.1544 +		*/
  1.1545 +		IMPORT_C virtual TInt GetStringAttributeSet(const TDesC8& aHeaderData, RStringAttributeSet& aStringAttributeSet);
  1.1546 +
  1.1547 +
  1.1548 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
  1.1549 +		
  1.1550 +		};
  1.1551 +
  1.1552 +		
  1.1553 +	/** 
  1.1554 +	Manages and retrieves rights objects from an agent.
  1.1555 +
  1.1556 + 	@publishedPartner
  1.1557 +	@released
  1.1558 +	*/
  1.1559 +	class CAgentRightsManager  : public CBase
  1.1560 +		{
  1.1561 +	public:
  1.1562 +		/** List all rights held by the agent 
  1.1563 +		@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1.1564 +		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1.1565 +		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1.1566 +		 				or one of the other system-wide error codes 
  1.1567 +						for any other errors.				
  1.1568 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1569 +		*/
  1.1570 +		virtual void ListAllRightsL(RStreamablePtrArray<CRightsInfo>& aArray) const = 0;
  1.1571 +
  1.1572 +		/** List all rights associated with a particular file
  1.1573 +		@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1.1574 +		@param aUri The name of the file.
  1.1575 +		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1.1576 +		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1.1577 +		 				or one of the other system-wide error codes 
  1.1578 +						for any other errors.				
  1.1579 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1580 +		*/
  1.1581 +		virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, const TDesC& aUri) const = 0;
  1.1582 +
  1.1583 +		/** List all rights associated with a particular content object
  1.1584 +		@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1.1585 +		@param aVirtualPath The content object.
  1.1586 +		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1.1587 +		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1.1588 +		 				or one of the other system-wide error codes 
  1.1589 +						for any other errors.				
  1.1590 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1591 +		*/
  1.1592 +		virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, TVirtualPathPtr& aVirtualPath) const = 0;
  1.1593 +
  1.1594 +		/** List all rights associated with a particular content object in a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1595 +		
  1.1596 +		@param aArray  		The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1.1597 +		@param aFile  		The file handle for the file containing the content object.
  1.1598 +		@param aUniqueId	The unique id of the content object.
  1.1599 +		@leave KErrCANotSupported if the feature not supported.
  1.1600 +		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1.1601 +		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1.1602 +		 				or one of the other system-wide error codes 
  1.1603 +						for any other errors.				
  1.1604 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1605 +		*/
  1.1606 +		IMPORT_C virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, RFile& aFile, const TDesC& aUniqueId) const;			
  1.1607 +
  1.1608 +		/** List all content associated with a particular rights object
  1.1609 +		@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.1610 +		@param aRightsInfo The rights object.
  1.1611 +		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1.1612 +		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1.1613 +		 				or one of the other system-wide error codes 
  1.1614 +						for any other errors.				
  1.1615 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1616 +		*/
  1.1617 +		virtual void ListContentL(RStreamablePtrArray<CVirtualPath>& aArray, CRightsInfo& aRightsInfo) const = 0;
  1.1618 +		
  1.1619 +		/** This will be used by applications to retrieve an agent specific rights object
  1.1620 +		@param aRightsInfo The rights object.
  1.1621 +		@return An agent specific rights object.
  1.1622 +		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1.1623 +		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1.1624 +		 				or one of the other system-wide error codes 
  1.1625 +						for any other errors.				
  1.1626 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1627 +		*/
  1.1628 +		virtual MAgentRightsBase* GetRightsDataL(const CRightsInfo& aRightsInfo) const = 0;
  1.1629 +
  1.1630 +		/** Asks the DRM agent to delete a rights object 
  1.1631 +
  1.1632 +		The agent may display a dialog asking the user to confirm the delete. Execution
  1.1633 +		will be blocked until the dialog is complete. Applications can request 
  1.1634 +		to disable the agents user interface using the SetProperty() command
  1.1635 +	
  1.1636 +		@param aRightsInfo The rights object.
  1.1637 +		@return The outcome of the delete operation.
  1.1638 +		@return KErrNone if the rights were deleted.
  1.1639 +		@return KErrCancel if the user cancels an agent supplied confirmation dialog.
  1.1640 +		@return KErrNotFound if the rights object does not exist.
  1.1641 +		@return KErrPermissionDenied if the agent does not permit the client to access rights information.
  1.1642 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1643 +		*/
  1.1644 +		virtual TInt DeleteRightsObject(const CRightsInfo& aRightsInfo) = 0;
  1.1645 +		
  1.1646 +		/** Deletes all rights associated with a particular content object
  1.1647 +
  1.1648 +		The agent may display a dialog asking the user to confirm the delete. Execution
  1.1649 +		will be blocked until the dialog is complete. Applications can request 
  1.1650 +		to disable the agents user interface using the SetProperty() command
  1.1651 +
  1.1652 +		@param aVirtualPath The path of the content object.
  1.1653 +		@return The outcome of the delete operation.
  1.1654 +		@return KErrNone if the rights were deleted.
  1.1655 +		@return KErrNotFound if no rights objects exist for the specified content object.
  1.1656 +		@return KErrCancel if the user cancels an agent supplied confirmation dialog.
  1.1657 +		@return KErrPermissionDenied if the agent does not permit the client to access rights information.
  1.1658 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1659 +		*/
  1.1660 +		virtual TInt DeleteAllRightsObjects(const TVirtualPathPtr& aVirtualPath) = 0;
  1.1661 +
  1.1662 +		/** Deletes all rights associated with a particular content object in a file specified by file handle. Can be used when the source file is in the client's private directory.
  1.1663 +
  1.1664 +		The agent may display a dialog asking the user to confirm the delete. Execution
  1.1665 +		will be blocked until the dialog is complete. Applications can request 
  1.1666 +		to disable the agents user interface using the SetProperty() command.
  1.1667 +
  1.1668 +		@param aFile The file handle for the file containing the content object.
  1.1669 +		@param aUniqueId The unique id of the content object.
  1.1670 +		@return The outcome of the delete operation.
  1.1671 +		@return KErrNone if the rights were deleted.
  1.1672 +		@return KErrNotFound if no rights objects exist for the specified content object.
  1.1673 +		@return KErrCancel if the user cancels an agent supplied confirmation dialog.
  1.1674 +		@return KErrPermissionDenied if the agent does not permit the client to access rights information.
  1.1675 +		@return KErrCANotSupported if the feature not supported.
  1.1676 +		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1.1677 +		*/
  1.1678 +		IMPORT_C virtual TInt DeleteAllRightsObjects (RFile& aFile, const TDesC& aUniqueId); 
  1.1679 +			
  1.1680 +		/** 
  1.1681 +		Allows an application to request the modification of a property 
  1.1682 +		within the agent. The agent may or may not permit the property to be changed
  1.1683 +		 	
  1.1684 +		@param aProperty The property to set.
  1.1685 +		@param aValue The value of the property.
  1.1686 +		@return KErrNone if the property was set.
  1.1687 +		@return KErrCANotSupported if the agent does not support the property or value.
  1.1688 +		@return KErrAccessDenied if the agent does not permit the property to be changed.
  1.1689 +		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
  1.1690 +		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
  1.1691 +		*/
  1.1692 + 		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
  1.1693 +		};
  1.1694 +
  1.1695 +
  1.1696 +} // namespace ContentAccess
  1.1697 +#endif // __AGENTINTERFACE_H__
  1.1698 +