os/security/contentmgmt/contentaccessfwfordrm/inc/agentinterface.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @publishedPartner
    22  @released
    23 */
    24 
    25 #ifndef __AGENTINTERFACE_H__
    26 #define __AGENTINTERFACE_H__
    27 
    28 #include <e32base.h>
    29 #include <ecom/ecom.h>
    30 
    31 #include <caf/caftypes.h>
    32 #include <caf/streamableptrarray.h>
    33 #include <caf/caferr.h>
    34 
    35 class RStringPool;
    36 class RHTTPHeaders;
    37 
    38 namespace ContentAccess
    39 {
    40 	class CEmbeddedObject;
    41 	class CSupplierOutputFile;
    42 	class RAttributeSet;
    43 	class RStringAttributeSet;
    44 	class TVirtualPathPtr;
    45 	class CRightsInfo;
    46 	class CVirtualPath;
    47 	class MAgentRightsBase;
    48 	class CImportFile;
    49 	class CMetaDataArray;
    50 	class CDirStreamable;
    51 
    52 	/**
    53 	 Defines the agent interface for consumer operations such as 
    54 	 reading and seeking within a content object in a file.
    55 
    56 	 @publishedPartner
    57 	 @released
    58      */
    59 	class CAgentData : public CBase
    60 		{
    61 	public:
    62 		/**
    63 		 Gets the data size in bytes.
    64 		 
    65 		 @param aSize	On return this will contain the size of the plaintext data in bytes.
    66 		 @leave KErrCASizeNotDetermined	Size could not be determined by the managing agent.
    67 		 @leave ...		One of the other CAF error codes defined in \c caferr.h  or one of the 
    68 						system-wide error codes for any other errors.		 
    69 		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
    70 		 */
    71 		virtual void DataSizeL(TInt &aSize) = 0;
    72 		
    73 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    74 		/**
    75 		 This is the 64bit version of DataSizeL. Implementing this function should take advantage of 64bit
    76 		 file system and use RFile::Size64(TInt64 &). If this function is not implemented, fallback to 32bit 
    77 		 DataSizeL will be provided by CAF automatically.
    78 		 
    79 		 @see DataSizeL(TInt &aSize)
    80 		*/
    81 		IMPORT_C virtual void DataSize64L(TInt64 &aSize);
    82 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    83 		
    84 		/**
    85 		 Allows a client to verify that the intent is supported by the
    86 		 current rights for the data object. 
    87 		 
    88 		 Doing so may cause subsequent reads (or other accesses)
    89 		 to fail. The result of the agent's evaluation
    90 		 of the intent is returned.
    91 		 
    92 		 @note Since the intent is only evaluated the agent will not decrement 
    93 		 any rights-state such as play counts.
    94 		  
    95 		 @param aIntent	The intended way the content will be used.
    96 		 @return Whether rights exist allowing the content to be used for this intent.
    97 		 @return KErrNone if the intent is permitted.
    98 		 @return KErrNoRights if no rights exist for the specified content object.
    99 		 @return KErrCANoPermission	if rights exist but the specified intent is not permitted.
   100 		 @return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
   101 		 @return KErrNoPermission if rights exist but none permit the specified intent.
   102 		 @return KErrPermissionDenied if the client is not allowed to use this content object.
   103 		 @return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   104 				other system-wide error codes for any other errors.
   105 
   106 		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
   107 		 */
   108 		virtual TInt EvaluateIntent(TIntent aIntent) = 0;
   109 		
   110 		/**
   111 		 Execute intent allows the application to signal it is about to carry out
   112 		 the specified intent on DRM protected content.The agent will decrement applicable 
   113 		 stateful rights such as play counts where necessary.
   114 
   115   		 Applications should be very careful to use this function correctly.
   116 		 @li If ExecuteIntent() is never called stateful rights will never be decremented. Users will be able to use the content forever
   117 		 @li If ExecuteIntent() is called too often stateful rights may be consumed prematurely. 
   118 
   119 		 Usually it would be best to call ExecuteIntent immediately before the content 
   120 		 is displayed or the instant playback begins. ExecuteIntent should not be considered a 
   121 		 prerequisite for calling the Read functions. It is valid for an application to read from 
   122 		 the file before calling ExecuteIntent. 
   123 
   124 		 @note Since rights are executed here the agent will decrement any rights-state such as 
   125 		 play counts that apply. 
   126 		 
   127 		@param aIntent	The intent indicator.
   128 		@return The result of attempting executing the intent.
   129 		@return KErrNone if the intent is permitted and stateful rights may have been decremented.
   130 		@return KErrNoRights if no rights exist for the specified content object.
   131 		@return KErrCANoPermission	if rights exist but the specified intent is not permitted.
   132 		@return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
   133 		@return KErrNoPermission if rights exist but none permit the specified intent.
   134 		@return KErrPermissionDenied if the client is not allowed to use this content object.
   135 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the
   136 				other system-wide error codes for any other errors.
   137 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   138 		*/
   139 		virtual TInt ExecuteIntent(TIntent aIntent) = 0;
   140 
   141 		/** 
   142 		 Reads from a content object up to the maximum length of the
   143 		 descriptor or the end of the content object.
   144 		 	
   145 		 When an attempt is made to read beyond the end of the content,
   146 		 no error is returned. The descriptor’s length is set to the
   147 		 number of bytes that were read into it. Therefore, when reading
   148 		 through content, the end has been reached when the
   149 		 descriptor length (given by TDesC::Length()) is zero.
   150 		 
   151 		 @param aDes	Descriptor into which binary data is read. Any existing
   152 		  				contents are overwritten. On return, its length is set
   153 		 				to the number of bytes read.
   154 		 @return		KErrNone if successful, otherwise another of the
   155 		  				system-wide error codes.
   156 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   157 		*/
   158 		virtual TInt Read(TDes8& aDes) = 0;
   159 
   160 		/**
   161 		 Reads a specified number of bytes of content.
   162 		  
   163 		 @see Read(TDes8& aDes)
   164 		 		 
   165 		 @param aDes	Descriptor into which binary data is read. Any existing
   166 		  				contents are overwritten. On return, its length is set
   167 		 				to the number of bytes read.
   168 		 @param aLength		The number of bytes to read from the file,
   169 		 					or to the end of the file, whichever is encountered first. 
   170 		 					The length of the buffer is set to the number of bytes actually read.
   171 		 @return		KErrNone if successful.
   172 		 @return		Otherwise one of the CAF error codes defined in \c caferr.h  or 
   173 		 				one of the other system-wide error codes.
   174 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   175 		*/
   176 		virtual TInt Read(TDes8& aDes, TInt aLength) = 0;
   177 
   178 		/**
   179 		 Reads content asynchronously.
   180 		 
   181 		 @see Read(TDes8& aDes)
   182 		 
   183 		 @param aDes 		Descriptor into which binary data is read. Any
   184 		  					existing contents are overwritten. On return,
   185 		 					its length is set to the number of bytes read. 
   186 		 @param aStatus		Asynchronous request status. On completion this will contain one 
   187 		 					of the following error codes: KErrNone if the data was 
   188 							successfully read. Otherwise one of the CAF error codes defined in 
   189 							\c caferr.h  or one of the other standard system-wide
   190 							error codes for any other errors.
   191 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   192 		*/
   193 		virtual void Read(TDes8& aDes, TRequestStatus& aStatus) = 0;
   194 
   195 		/**
   196 		 Reads content asynchronously (up to a specified maximum number of bytes)
   197 		 
   198 		 @see Read(TDes8& aDes)
   199 		 
   200 		 @param aDes 		Descriptor into which binary data is read. Any
   201 		  					existing contents are overwritten. On return,
   202 		 					its length is set to the number of bytes read. 
   203 		 @param aLength		The number of bytes to read from the file,
   204 		 					or to the end of the file, whichever is encountered first. 
   205 		 					The length of the buffer is set to the number of bytes actually read.
   206 		 @param aStatus		Asynchronous request status. On completion this will contain one 
   207 		 					of the following error codes: KErrNone if the data was 
   208 							successfully read. Otherwise one of the CAF error codes defined in 
   209 							\c caferr.h  or one of the other standard system-wide
   210 							error codes for any other errors.
   211 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   212 		*/
   213 		virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus) = 0;
   214 		
   215 		/**
   216 		 Cancels asynchronous read.
   217 		 
   218 		 @param aStatus		Asynchronous request status. This parameter should have been supplied earlier to
   219 		 					an asynchronous Read call. If it has not been previously supplied to a Read call,
   220 		 					this function will not have any effect.
   221 		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   222 		*/
   223 		IMPORT_C virtual void ReadCancel(TRequestStatus& aStatus);
   224 
   225 		/**
   226 		 Changes or retrieves the location of the file pointer within 
   227 		 the content object
   228 		 
   229 		 There are four seek modes used: 
   230 		 
   231 		 @li ESeekStart - Sets the file pointer aPos bytes from the start of the 
   232 		 content object.  aPos is not modified by the call to Seek()
   233 		 @li ESeekEnd - Sets the file pointer aPos bytes from the end of the 
   234 		 content object. The aPos parameter supplied should be zero or negative 
   235 		 when using ESeekEnd. Upon completion aPos is updated with the current 
   236 		 position relative to the start of the content object.
   237 		 @li ESeekCurrent - Moves the file pointer aPos bytes from the current 
   238 		 position. Upon completion aPos is updated with the new position relative 
   239 		 to the start of the content object. Suppling a zero value for the aPos Parameter can be
   240 		 used to retrieve the current file pointer location 
   241 		 @li ESeekAddress Sets the aPos parameter to the address of the byte 
   242 		 aPos bytes from the start of the content object
   243 
   244 		 @see TSeek
   245 		 
   246 		 @param aMode	Seek mode - controls the destination of the
   247 		  				seek operation.
   248 		  
   249 		 @param aPos	Offset from either the start, end or current position depending upon 
   250 		 the seek mode. Negative offsets are used to seek before the current position or
   251 		 relative to the end of the file.
   252 		 
   253 		 @return		KErrNone if successful. 
   254 		 @return		Otherwise one of the CAF error codes defined in \c caferr.h  or one 
   255 		 				of the other system-wide error codes.
   256 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   257 		*/
   258 		virtual TInt Seek(TSeek aMode, TInt& aPos) = 0;
   259 
   260 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   261 		/**
   262 		  This is the 64bit version of Seek. Implementing this function should take advantage of 64bit
   263 		  file system and use RFile::Seek64(TSeek, TInt64 &). If this function is not implemented, fallback to 32bit 
   264 		  Seek will be provided by CAF automatically.
   265 		  
   266 		  @see Seek(TSeek aMode, TInt& aPos)
   267 		*/
   268 		IMPORT_C virtual TInt Seek64(TSeek aMode, TInt64& aPos);
   269 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   270 		
   271 		/** 
   272 		Allows an application to request the modification of a property 
   273 		within the agent handling this content. The agent may or may not
   274 		permit the property to be changed
   275 		 	
   276 		@param aProperty The property to set.
   277 		@param aValue The value of the property.
   278 		@return Whether or not the property was set.
   279 		@return KErrNone if the property was set.
   280 		@return KErrCANotSupported if the agent does not support the property or value.
   281 		@return KErrAccessDenied if the agent does not permit the property to be changed.
   282 		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
   283 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   284 		 */
   285 		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
   286 
   287 		/**  Get the value of an attribute for this content object
   288  
   289 		@param aAttribute The attribute to query, from ContentAccess::TAttribute.
   290 		@param aValue Used to return the attribute value.
   291 		@return Whether the attribute was updated.
   292 		@return KErrNone if the value of the attribute was updated.
   293 		@return KErrCANotSupported if the requested attribute does not exist.
   294 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   295 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   296 				other system-wide error codes for any other errors.
   297 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   298 		*/
   299 		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue)=0;
   300 
   301 		/** Get a set of attributes from a content object
   302 
   303 		@param aAttributeSet The set of attributes to query and update.
   304 		@return Whether the attribute set was updated.
   305 		@return KErrNone if the attributes were retrieved successfully.
   306 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   307 		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   308 				other system-wide error codes for any other errors.
   309 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 				
   310 		*/
   311 		virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet) = 0;
   312 
   313 		/**  Get text string attributes or meta-data for this content object
   314 
   315 		@param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
   316 		@param aValue Returns the value of the attribute.
   317 		@return Whether the value was updated.
   318 		@return KErrNone if the attribute was retrieved.
   319 		@return KErrOverflow if the buffer was not large enough to return the result.
   320 		@return KErrCANotSupported if the requested attribute does not exist.
   321 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   322 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   323 				other system-wide error codes for any other errors.				 
   324 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   325 		*/
   326 		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue)=0;
   327 
   328 	
   329 		/** Used to obtain a set of string attributes 
   330 
   331 		@param aStringAttributeSet The set of attributes to query and update.
   332 		@return Whether the string attribute set was updated.
   333 		@return KErrNone if the attributes were retrieved successfully.
   334 		@return KErrNotFound if the default content object was not found.
   335 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
   336 		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   337 				other system-wide error codes for any other errors.				 
   338 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   339 		*/
   340 		virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet)=0;
   341 		
   342 		/**  
   343 		 Reads content asynchronously. The data is read from a specified offset 
   344 		 up to a specified number of bytes or until the end of the content object 
   345 		 is reached. The data is read into the descriptor buffer supplied.
   346 		 
   347 		 @see Read(TDes8& aDes)
   348 		 
   349 		 @param aPos		Position of first byte to be read. 
   350 		 					This is an offset from the start of the file. 
   351 		 @param aDes 		Descriptor into which binary data is read. Any
   352 		  					existing contents are overwritten. On return,
   353 		 					its length is set to the number of bytes read. 
   354 		 @param aLength		The number of bytes to read from the file,
   355 		 					or to the end of the file, whichever is encountered first. 
   356 		 					The length of the buffer is set to the number of bytes actually read.
   357 		 @param aStatus		Asynchronous request status. On completion this will contain one 
   358 		 					of the following error codes: KErrNone if the data was 
   359 							successfully read. Otherwise one of the CAF error codes defined in 
   360 							\c caferr.h  or one of the other standard system-wide
   361 							error codes for any other errors.
   362 		 @return KErrNone if the async read request was successfully submitted.
   363 		 @return KErrCANotSupported if the agent does not support this operation.
   364 		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   365 		*/
   366 		IMPORT_C virtual TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
   367 		
   368 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   369 		/**  
   370 		 This is the 64bit version of CAgentData::Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   371 		 Implementing this function should take advantage of 64bit file system and use RFile::Seek64(TSeek, TInt64 &) to get to
   372 		 the position in file specified by aPos. If this function is not implemented, fallback to 32bit 
   373 		 Read will be provided by CAF automatically. 
   374 		 
   375 		 @see Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   376 		*/
   377 		IMPORT_C virtual TInt Read64(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
   378 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   379 
   380 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   381 		/**
   382 		Decrypts the encrypted input data packet.Default implementation of this method returns KErrCANotSupported.
   383 		
   384 		@param aEncryptedInputDataPacket	Buffer descriptor containing the encrypted data packet supplied by client application. 
   385 		@param aDecryptedOutputDataPacket	Buffer descriptor supplied by the client application into which the decrypted data is written.
   386 											The length of this descriptor must be equal to or greater than the input packet.
   387 		@return								KErrNone if successful or KErrInsuffcientDataPacketLength, if a part of input data packet
   388 											is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h  or 
   389 		 									one of the other system-wide error.
   390 		@capability 						DRM Access to DRM protected content is not permitted for processes without DRM capability.
   391 											Access to unprotected content is unrestricted.
   392 		*/
   393 		IMPORT_C virtual TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket);
   394 		
   395 		
   396 		/**
   397 		Decrypts the encrypted input data packet asynchronously.Default implementation of this method returns KErrCANotSupported.
   398 	
   399 		@param aEncryptedInputDataPacket	Buffer descriptor containing the encrypted data packet supplied by client application. 
   400 		@param aDecryptedOutputDataPacket	Buffer descriptor supplied by the client application into which the decrypted data is written.
   401 											The length of this descriptor must be equal to or greater than the input packet.
   402 		@param aStatus						Asynchronous request status. On completion this will contain one of the following error codes:
   403 											KErrNone if the data packet was successfully decrypted or KErrInsuffcientDataPacketLength, if a part of input data packet
   404 											is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h  or 
   405 		 									one of the other system-wide error codes.
   406 		@capability 						DRM Access to DRM protected content is not permitted for processes without DRM capability.
   407 										    Access to unprotected content is unrestricted. 
   408 		*/
   409 		IMPORT_C virtual void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus);
   410 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   411 		};
   412 
   413 	/**	Defines the agent interface allowing clients to browse the objects 
   414 	within a file
   415 
   416 	@publishedPartner
   417 	@released
   418 	*/
   419 	class CAgentContent : public CBase
   420 		{
   421 	public:
   422  		/** Open a Container object within the file.
   423  		
   424  		Allows an application to access the content objects and 
   425  		any nested container objects within the specified container.
   426   		
   427  		@param aUniqueId The container object's unique ID.
   428 		@return Whether the container was opened.
   429  		@return KErrNone if the container was opened successfully.
   430  		@return KErrNotFound if the container does not exist.
   431 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   432 		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   433 				other system-wide error codes for any other errors.
   434 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   435  		*/
   436 		virtual TInt OpenContainer(const TDesC& aUniqueId) = 0;
   437 
   438  		/** Close the current container object and go back to previous enclosing
   439  		container within the file.
   440  		
   441  		Allows an application to access the content objects and 
   442  		any nested container objects within parent container
   443   		
   444 		@return Whether the container was closed.
   445   		@return KErrNone if the container was closed.
   446   		@return KErrNotFound if there is no enclosing container.
   447   		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 		
   448   		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   449  		*/
   450 		virtual  TInt CloseContainer() = 0;
   451 
   452 		/** List all the embedded container objects and content objects within the 
   453 		current container
   454  		 		
   455 		The UniqueId() member of CEmbeddedObject can be used to refer directly to 
   456 		a particular object within the file.
   457 
   458 		@param aArray The array to be populated with the embedded objects. 
   459 		@leave KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   460 		@leave ...			One of the CAF error codes defined in \c caferr.h  or one of the 
   461 							other system-wide error codes for any other errors.
   462   		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   463  		*/
   464 		virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray) = 0;
   465 		
   466 		/** List all the embedded objects within the current container that
   467 		are of the specified type
   468  		 		
   469 		@param aArray The array to be populated with the embedded objects. 
   470 		@param aType The type of objects to list.
   471 		@leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.		 
   472 		@leave ...			One of the CAF error codes defined in \c caferr.h  or one of the 
   473 							other system-wide error codes for any other errors.
   474   		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   475  		*/
   476 		virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray, TEmbeddedType aType) = 0;
   477 
   478 		/** Search the current container for content objects with a particular mime type
   479 
   480   		@param aArray The array to store the results of the search. The agent will add CEmbeddedObject objects to the supplied array.
   481 		@param aMimeType The mime type to search for.
   482 		@param aRecursive ETrue to search inside containers embedded within the current container, EFalse to search only the current container.
   483 		@return The result of the search.
   484 		@return KErrNone if the search was successful, even if no content objects were found.
   485 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   486 		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   487 				other system-wide error codes for any other errors.
   488 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   489 		*/
   490 		virtual TInt Search(RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8& aMimeType, TBool aRecursive) = 0;
   491 		
   492 		/**  Get an attribute for an object within the file
   493 	
   494 		@param aAttribute The attribute to query, from ContentAccess::TAttribute.
   495 		@param aValue Used to return the attribute value.
   496 		@param aUniqueId The UniqueId of the object within the file.
   497 		@return Whether the attribute value was updated.
   498 		@return KErrNone if the value of the attribute was updated.
   499 		@return KErrNotFound if the object with the given UniqueId was not found.
   500 		@return KErrCANotSupported if the requested attribute does not exist.
   501 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.	 
   502 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   503 				other system-wide error codes for any other errors.
   504 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   505 		*/
   506 		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId) = 0;
   507 
   508 		/** Get a set of attributes for an object within the file
   509 
   510 		@param aAttributeSet The set of attributes to query and update.
   511 		@param aUniqueId The unique ID of the object within the file.
   512 		@return Whether that attribute set was updated.
   513 		@return KErrNone if the attributes were retrieved successfully.
   514 		@return KErrNotFound if the default content object was not found.
   515 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   516 		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   517 				other system-wide error codes for any other errors.
   518 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   519 		*/
   520 		virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId) = 0;
   521 
   522 		/**  Get text string attributes or meta-data for an object within the file
   523 
   524 		@param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
   525 		@param aValue Returns the value of the attribute.
   526 		@param aUniqueId The UniqueId of the object within the file. 
   527 		@return Whether the attribute value was updated.
   528 		@return KErrNone if the attribute was retrieved.
   529 		@return KErrNotFound if the object with the given UniqueId was not found.
   530 		@return KErrOverflow if the buffer was not large enough to return the result.
   531 		@return KErrCANotSupported if the requested attribute does not exist.
   532 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.	 
   533 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   534 				other system-wide error codes for any other errors.
   535 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   536 		*/
   537 		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId) = 0;
   538 
   539 		/** Used to obtain a set of string attributes for an object within the file
   540 
   541 		@param aStringAttributeSet The set of attributes to query and update.
   542 		@param aUniqueId The UniqueId of the container or content. 
   543 		@return Whether the attribute set was updated.
   544 		@return KErrNone if the attributes were retrieved successfully.
   545 		@return KErrNotFound if the object with the given UniqueId was not found.
   546 		@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.		 
   547 		@return Otherwise one of the CAF error codes defined in \c caferr.h  or one of the 
   548 				other system-wide error codes for any other errors.
   549 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   550 		*/
   551 		virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId)=0;
   552 
   553 		/** Allows extended synchronous calls to the CAF agent handling this file
   554 		
   555 		Applications familiar with the agent can pass objects in and out using serialization.
   556 
   557 		@param aCommand The agent defined command.
   558 		@param aInputBuffer Non modifyable input data buffer.
   559 		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
   560 		@return The outcome of the agent specific command.
   561 		@return KErrCANotSupported if the agent does not recognize the command.
   562 		@return KErrOverflow if the output buffer supplied is too small.
   563 		@return KErrPermissionDenied if the agent does not allow the client to execute the command.
   564 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   565 				other system-wide error codes for any other errors.
   566 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   567 		*/
   568 		virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer) = 0;
   569 
   570 		/** Allows extended synchronous calls to the CAF agent handling this file.
   571 		Applications familiar with the agent can pass objects in and out using serialization.
   572 		NB: No assumption should be made about the scope of the descriptor 
   573 		passed to aInputBuffer for asynchronous IPC.
   574 
   575 		@param aCommand The agent defined command.
   576 		@param aInputBuffer Non modifyable input data buffer.
   577 		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
   578 		@param aStatus Asynchronous request status. On completion this will contain 
   579 						one of the following error codes:
   580 						KErrNone if the command was successfully executed.
   581 						KErrCANotSupported  if the agent does not recognize the command.
   582 						KErrOverflow if the output buffer supplied is too small.
   583 						KErrPermissionDenied if the agent does not allow the client 
   584 						to execute the command. Otherwise one of the other CAF error codes defined 
   585 						in \c caferr.h  or one of the other system-wide error codes 
   586 						for any other errors.
   587 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   588 		*/
   589 		virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus) = 0;
   590 
   591 		/** Request notification for an event for an object within the file.
   592 		NB: No assumption should be made about the scope of the descriptor 
   593 		passed to aUniqueId for asynchronous IPC.
   594 
   595 		@param aMask Bitmask of events the caller is interested in.
   596 		@param aStatus The TRequestStatus object to complete if the event occurs.
   597 		@param aUniqueId The UniqueId of the container or content. 
   598 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   599 		*/
   600 		virtual void NotifyStatusChange(TEventMask aMask, TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
   601 		
   602 		/** Cancel a previous notification request
   603 
   604 		@param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
   605 		@param aUniqueId The UniqueId of the content object within the file.
   606 		@return The outcome of the cancel request.
   607 		@return KErrNone if the request was cancelled.
   608 		@return KErrNotFound if there was no matching request outstanding.
   609 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   610 		*/
   611 		virtual TInt CancelNotifyStatusChange(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
   612 
   613 		/** Request the agent to obtain rights for a protected content object.
   614 		NB: No assumption should be made about the scope of the descriptor 
   615 		passed to aUniqueId for asynchronous IPC.
   616 
   617 		This request may be handled differently by different agents. 
   618 		Some agents may open a browser and direct the user to a URL. Others may 
   619 		download and install the rights in the background.
   620 
   621 		The call should not block execution, applications can wait for a notification 
   622 		if they are interested in the outcome. 
   623 		
   624 		If a rights request completes sucessfully it does not necessarily mean rights 
   625 		are available. It just means the request is complete.
   626 
   627 		@param aStatus Asynchronous request status. On completion this will contain 
   628 						one of the following error codes:
   629 						KErrNone if the rights request was successful.
   630 						KErrCANotSupported  if the agent does not allow rights requests.
   631 						Otherwise one of the other CAF error codes defined in \c caferr.h  
   632 						or one of the other system-wide error codes 
   633 						for any other errors.
   634 
   635 		@param aUniqueId The unique id of the object within the file.
   636 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.		
   637 		*/
   638 		virtual void RequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0; 
   639 
   640 		/** Cancel a previous RequestRights() request
   641 
   642 		@param aStatus The TRequestStatus that was supplied to the RequestRights() function.
   643 		@param aUniqueId The objects Unique Id that was supplied to the RequestRights() function.
   644 		@return The result of the cancel rights request.
   645 		@return KErrNone if the rights request was cancelled.
   646 		@return KErrNotFound if there was no matching rights request outstanding.
   647 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   648 		*/
   649 		virtual TInt CancelRequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
   650 
   651 		/** View information associated with a single content object
   652 		
   653 		This call blocks execution and only returns once the display is dismissed 
   654 		by the user.
   655 
   656 		@param aInfo The information to display.
   657 		@param aUniqueId The unique id of the object within the file.
   658 		@leave KErrCANotSupported if information cannot be displayed or does not exist.
   659 		@leave ...			One of the other CAF error codes defined in \c caferr.h  
   660 							or one of the system-wide error codes for 
   661 							any other errors.
   662 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
   663 		*/
   664 		virtual void DisplayInfoL(TDisplayInfo aInfo, const TDesC& aUniqueId) = 0;
   665 
   666 		/** 
   667 		Allows an application to request the modification of a property 
   668 		within the agent handling this content. The agent may or may not
   669 		permit the property to be changed
   670 		 	
   671 		@param aProperty The property to set.
   672 		@param aValue The value of the property.
   673 		@return Whether the property was set.
   674 		@return KErrNone if the property was set.
   675 		@return KErrCANotSupported if the agent does not support the property or value.
   676 		@return KErrAccessDenied if the agent does not permit the property to be changed.
   677 		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
   678 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   679 		*/
   680 		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
   681 		
   682 		};
   683 
   684 	/**
   685 	 Defines the interface for importing files into a Content access agent. 
   686 
   687 	The agent should treat the import as a transaction and either import the
   688 	entire file or revert to the state before the import if the import is cancelled.
   689 	
   690 	The client cancels an import by deleting the CAgentImportFile object 
   691 	before WriteDataComplete() is called. 
   692 	 
   693 	 @publishedPartner
   694 	 @released
   695 	 */
   696 	class CAgentImportFile : public CBase
   697 		{
   698 	public:
   699 
   700 		/** Writes a block of data from a file to the agent
   701 		
   702 		@param aData The block of data.
   703 		@return	The result of the write operation.
   704 		@return KErrNone if the data was written successfully.
   705 		@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().
   706 		@return KErrNotReady if the agent was not expecting WriteData() to be called at this point.
   707 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   708 				other system-wide error codes for any other errors.
   709 		*/
   710 		virtual TInt WriteData(const TDesC8& aData)=0;
   711 
   712 		/** Signals to the agent that the entire file has now been transferred to the agent.
   713 		
   714 		@return The result of the write operation. 
   715 		@return KErrNone if the data was written successfully.
   716 		@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().
   717 		@return KErrNotReady if the agent was not expecting WriteDataComplete() to be called at this point.
   718 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   719 				other system-wide error codes for any other errors.		
   720 		*/
   721 		virtual TInt WriteDataComplete()=0;
   722 
   723 		/** Asynchronously writes a block of data from a file the agent
   724 		 
   725 		Notifies the client when the write operation is complete.
   726 		
   727 		@param aData 	The block of data.
   728 		@param aStatus 	Asynchronous request status. On completion this will 
   729 						contain one of the following error codes: KErrNone if the data was written successfully. 
   730 						KErrCANewFileHandleRequired if the agent requires a new 
   731 						file handle before proceeding - the agent must save its 
   732 						state and continue processing when the new handle 
   733 						is supplied by ContinueWithNewOutputFile().
   734 						KErrNotReady if the agent was not expecting WriteDataComplete() 
   735 						to be called at this point. Otherwise one of the other CAF error codes 
   736 						defined in \c caferr.h  or one of the other standard system-wide 
   737 						error codes for any other errors.
   738 		*/
   739 		virtual void WriteData(const TDesC8& aData, TRequestStatus& aStatus)=0;
   740 
   741 		/** Signals to the agent that the entire file has now been transferred to the agent
   742 		
   743 		Notifies the client when any final processing operation is complete.
   744 		
   745 		@param aStatus 	Asynchronous request status. On completion this will 
   746 						contain one of the following error codes: KErrNone if the data was written successfully. 
   747 						KErrCANewFileHandleRequired if the agent requires a new 
   748 						file handle before proceeding - the agent must save its 
   749 						state and continue processing when the new handle 
   750 						is supplied by ContinueWithNewOutputFile().
   751 						KErrNotReady if the agent was not expecting WriteDataComplete() 
   752 						to be called at this point. Otherwise one of the other CAF error codes 
   753 						defined in \c caferr.h  or one of the other standard system-wide 
   754 						error codes for any other errors.
   755 		*/
   756 		virtual void WriteDataComplete(TRequestStatus& aStatus)=0;
   757 
   758 		/** Gets the number of output files produced so far. 
   759 		@return The number of output files.
   760 		*/
   761 		virtual TInt OutputFileCountL() const = 0;
   762 
   763 		/** Return information about an output file generated by the import operation. 
   764 		
   765 		 It is possible that the output file does not have the same name 
   766 		 as the one suggested at the beginning of the import. An agent may
   767 		 need to use a particular file extension or a particular name.
   768 
   769 		The agent may decide not to store the output file in the output directory 
   770 		suggested at the start of the import. eg. it may store the file in its private 
   771 		server directory.
   772 
   773 		The output files may only appear in this array after the WriteDataComplete() 
   774 		function has been called. 
   775 
   776 		@param aIndex The zero-based index of the file (must be less than the value returned by OutputFileCountL().
   777 		@return The CSupplierOutputFile for this object.
   778 		*/
   779 		virtual CSupplierOutputFile& OutputFileL(TInt aIndex) = 0;
   780 
   781 		/** Retrieve the import status
   782 
   783 		Used to indicate non fatal problems encountered during the import operation.
   784 		Provides feedback to the client in case any problems are encountered.
   785 
   786 		The client can then decide whether or not to continue the import.
   787 		 
   788 		@return	The state of the import operation.
   789 		*/
   790 		virtual TImportStatus GetImportStatus() const = 0;
   791 
   792 		
   793 		/** Get the agents suggestion for the file extension of the output file required by the agent
   794 
   795 		This function should only be called when the agent has returned KErrCANewFileHandleRequired from
   796 		WriteData() or WriteDataComplete().
   797 
   798 		The extension must include the dot '.' character.
   799 
   800 		@param aFileExtension On completion this will contain the appropriate file extension.
   801 		@return The result of the request for a file extension.
   802 		@return KErrNone if the agent populated aFileExtension with the correct file extension.
   803 		@return KErrNotReady if the agent is not waiting for another file handle to be provided.
   804 		@return KErrUnknown if the agent does not know what extension should be used.
   805 		*/
   806 		virtual TInt GetSuggestedOutputFileExtension(TDes& aFileExtension) = 0;
   807 
   808 		/** Get the agents suggestion for the file name (with extension) of the output file required by the agent
   809 
   810 		This function should only be called when the agent has returned KErrCANewFileHandleRequired from
   811 		WriteData() or WriteDataComplete().
   812 
   813 		The file name is of the form filename.extension.
   814 
   815 		@param aFileName On completion this will contain the appropriate filename.
   816 		@return KErrNone if the agent populated aFileName with the correct file name.
   817 		@return KErrNotReady if the agent is not waiting for another file handle to be provided.
   818 		@return KErrUnknown if the agent does not know what file name should be used.
   819 		*/
   820 		virtual TInt GetSuggestedOutputFileName(TDes& aFileName) = 0;
   821 
   822 		/** Continue the last write operation with a new file handle as requested by the agent
   823 
   824 		@param aFile A new file handle opened with write permission.
   825 		@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.
   826 		@return The result of the continuing write operation.
   827 		@return KErrNone if the WriteData() or WriteDataComplete() operation is now complete.
   828 		@return KErrCANewFileHandleRequired if the agent requires a new 
   829 						file handle before proceeding - the agent must save its 
   830 						state and continue processing when the new handle 
   831 						is supplied by ContinueWithNewOutputFile().
   832 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   833 				other system-wide error codes for any other errors.		
   834 		*/
   835 		virtual TInt ContinueWithNewOutputFile(RFile& aFile, const TDesC& aFileName) = 0;
   836 
   837 		/** Continue the last write operation with a new file handle and return the result asynchronously.
   838 
   839 		@param aFile A new file handle opened with write permission
   840 		@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
   841 		
   842 		@param aStatus 	Asynchronous request status. On completion this will 
   843 						contain one of the following error codes: KErrNone if the 
   844 						WriteData() or WriteDataComplete() operation is now complete.
   845 						KErrCANewFileHandleRequired if the agent requires a new 
   846 						file handle before proceeding - the agent must save its 
   847 						state and continue processing when the new handle 
   848 						is supplied by ContinueWithNewOutputFile(). Otherwise one of the 
   849 						other CAF error codes defined in \c caferr.h  or one of the 
   850 						other system-wide error codes for any other errors.
   851 		*/
   852 		virtual void ContinueWithNewOutputFile(RFile& aFile, const TDesC& aFileName, TRequestStatus& aStatus) = 0;
   853 		
   854 		/** Cancel an outstanding asynchronous WriteData() request.
   855 		*/
   856 		IMPORT_C virtual void Cancel();
   857 		
   858 		/** Retrieve the content MIME type based on available data
   859 		
   860 		This function should only be called when the agent has returned KErrCANewFileHandleRequired from WriteData()
   861 		If the agent cannot return a content MIME type, the importer should assume that no content type
   862 		will be available until after the import session has been finished 
   863 
   864 		@param aContentMime On return this will contain the appropriate content MIME type.
   865 		@return The result of the request for a content MIME type.
   866 		@return ETrue if the agent populated aContentMime with the correct content MIME type.
   867 		@return EFalse if the agent cannot return the content MIME type (for example, there 
   868 					is not enough data, or the content is multi-part)
   869 		*/
   870 		IMPORT_C virtual TBool ContentMimeTypeL(TDes8& aContentMime);
   871 				
   872 		};
   873 
   874 	/**
   875 	 Defines the agent interface for manager operations. 
   876 	 
   877 	 The CAgentManager is not related to any particular content object but 
   878 	 used to manage files and settings belonging to this agent
   879 	 
   880 	All operations performed by the agent manager should be implemented in a 
   881 	transactional manner by either completing or reverting to the state before
   882 	the function was called.
   883 	 
   884  	 @publishedPartner
   885 	 @released
   886 	 */	
   887 	class CAgentManager : public CBase
   888 		{
   889 	public:
   890 		/** 
   891 		 Delete a file belonging to this agent
   892 
   893 		 The agent implementation may delete rights that were associated with 
   894 		 the content at the same time. If an agent does delete rights at the same
   895 		 time as the content it should display a confirmation dialog that makes it
   896 		 clear to the user the rights they paid for will be also deleted. 
   897 
   898 		 Execution will be blocked until any dialog displayed is complete. Applications 
   899 		 can request to disable the agents user interface using the SetProperty() command
   900 		 
   901 		 Access to the agents private directory is permitted at the 
   902 		 agents discretion.
   903 
   904 		 @param aFileName The full pathname of the file to delete.
   905 		 @return The outcome of the delete operation.
   906 		 @return KErrNone if the file was deleted successfully.
   907 		 @return KErrCancel if the user selects cancel in an agent supplied confirmation screen.
   908 		 @return KErrAccessDenied if the agent does not allow the file to be deleted.
   909 		 @return KErrCANotSupported if the agent does not support file deletion
   910 		 @return KErrPermissionDenied if the client does not have the necessary capabilities to delete the file.
   911 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   912 				other system-wide error codes for any other errors.
   913 		 @capability DRM Deleting DRM protected content is not permitted for processes without DRM capability. 
   914 		 */
   915 		virtual TInt DeleteFile(const TDesC &aFileName) = 0;
   916 
   917 		/**
   918 		Make a copy of the content file (eg to removable media) belonging to this agent
   919 
   920 		Access to the agents private directory is permitted at the 
   921 		agents discretion.
   922 
   923   		@param aSource The full pathname of the source file.
   924 		@param aDestination The full pathname of the destination file.
   925 		@return The outcome of the copy operation.
   926 		@return KErrNone if the file was copied successfully.
   927 		@return KErrAccessDenied if the agent does not allow the file to be copied.
   928 		@return KErrCANotSupported if the agent does not support file copying.
   929 		@return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
   930 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   931 				other system-wide error codes for any other errors.
   932   		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
   933 		*/
   934 		virtual TInt CopyFile(const TDesC& aSource, const TDesC& aDestination) = 0;
   935 
   936 		/**
   937 		Rename or move the content file (eg to removable media) belonging to this agent
   938 
   939 		Access to the agent private directories is permitted at the 
   940 		agents discretion.
   941 
   942 		@param aSource The full pathname of the source file.
   943 		@param aDestination The full pathname of the destination file.
   944 		@return The outcome of the Rename operation.
   945 		@return KErrNone if the file was moved or renamed successfully.
   946 		@return KErrAccessDenied if the agent does not allow the file to be moved or renamed.
   947 		@return KErrCANotSupported if the agent does not support file renaming.
   948 		@return KErrPermissionDenied if the client does not have the necessary capabilities to move or rename the file.
   949 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   950 				other system-wide error codes for any other errors.
   951   		@capability DRM Moving DRM protected files is not permitted for processes without DRM capability. Moving unprotected files is permitted
   952 		*/
   953 		virtual TInt RenameFile(const TDesC& aSource, const TDesC& aDestination) = 0;
   954 
   955 		/** Create a directory
   956 
   957 		This function can be used to create a directory within in the agent's 
   958 		private directory. Access to the agents private directory is permitted at the 
   959 		agents discretion. 
   960 
   961 		@param aPath The full pathname of the directory to create.
   962 		@return The outcome of the MkDir operation.
   963 		@return KErrNone if the directory was created successfully.
   964 		@return KErrAccessDenied if the agent does not allow the directory to be created.
   965 		@return KErrCANotSupported if the agent does not support directory creation.
   966 		@return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
   967 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   968 				other system-wide error codes for any other errors.
   969 		
   970 		@capability DRM Required when attempting to access an agents private directory
   971 		*/
   972 		virtual TInt MkDir(const TDesC& aPath) = 0;
   973 
   974 		/** Create all directories in the given path if they do not exist
   975 
   976 		This function can be used to create directories within in the agent's 
   977 		private directory. Access to the agents private directory is permitted at the 
   978 		agents discretion. 
   979 		
   980 		@param aPath The full pathname of the directory to create.
   981 		@return The outcome of the MkDirAll operation.
   982 		@return KErrNone if the directory was created successfully.
   983 		@return KErrAccessDenied if the agent does not allow the directory to be created.
   984 		@return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
   985 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
   986 				other system-wide error codes for any other errors.
   987 		@capability DRM Required when attempting to access an agents private directory
   988 		*/
   989 		virtual TInt MkDirAll(const TDesC& aPath) = 0;
   990 
   991 		/** Remove a directory
   992 
   993 		This function can be used to remove a directory from within the agent's 
   994 		private directory. Access to the agents private directory is permitted 
   995 		at the agents discretion. 
   996 		
   997 		@param aPath The full pathname of the directory to remove.
   998 		@return The outcome of the RmDir operation.
   999 		@return KErrNone if the directory was removed successfully.
  1000 		@return KErrAccessDenied if the agent does not allow the directory to be removed.
  1001 		@return KErrCANotSupported if the agent does not support directory removal.
  1002 		@return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
  1003 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1004 				other system-wide error codes for any other errors.
  1005 		@capability DRM Required when attempting to access an agents private directory
  1006 		*/
  1007 		virtual TInt RmDir(const TDesC& aPath) = 0;
  1008 
  1009 		/**  Gets a filtered list of a directory's contents. 
  1010 
  1011 		The bitmask determines which file and directory entry types should be listed. The sort key determines the order in which they are listed.
  1012 
  1013 		Notes:
  1014 		-# 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.
  1015 		-# 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.
  1016 		-# The caller of this function is responsible for deleting aFileList after the function has returned.
  1017 
  1018 
  1019 		This function can be used to list the contents of the agent's 
  1020 		private directory. Access to the agents private directory is permitted at 
  1021 		the agents discretion. 
  1022 		
  1023 		Agents can just return KErrCANotSupported if they do not wish to publish their
  1024 		private directory. Alternatively they can just populate the CDir object
  1025 		with the entries they wish to show.
  1026 	
  1027   		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files.
  1028 		@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 
  1029 		@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. 
  1030 		@param aEntryList On return contains a filtered list of directory and file entries.
  1031 		@return The outcome of the GetDir operation.
  1032 		@return KErrNone if the directory contents were listed successfully.
  1033 		@return KErrCANotSupported if the agent does not allow clients to view its private directory.
  1034 		@return KErrPermissionDenied if the process does not have the correct capabilities to view the directory.
  1035 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1036 				other system-wide error codes for any other errors.
  1037 		@capability DRM Required when attempting to access an agents private directory
  1038 		*/
  1039 		virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList) const = 0;
  1040 
  1041 		/**  Gets a filtered list of the directory and file entries contained in a directory and a list of the directory entries only
  1042 
  1043 		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.
  1044 
  1045 		Notes:
  1046 		-# 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.
  1047 		-# 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.
  1048 		-# The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.
  1049 
  1050 		This function can be used to list the contents of the agent's 
  1051 		private directory. Access to the agents private directory is permitted at 
  1052 		the agents discretion. 
  1053 
  1054 		Agents can just return KErrCANotSupported if they do not wish to publish their
  1055 		private directory. Alternatively they can just populate the CDir object
  1056 		with the entries they wish to show.
  1057 
  1058 		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files. 
  1059 		@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.
  1060 		@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. 
  1061 		@param aEntryList On return contains a filtered list of directory and file entries. 
  1062 		@param aDirList On return contains a filtered list of directory entries only.
  1063 		@return The outcome of the GetDir operation.
  1064 		@return KErrNone The directory contents were listed successfully.
  1065 		@return KErrCANotSupported The agent does not allow clients to view its private directory.
  1066 		@return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
  1067 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1068 				other system-wide error codes for any other errors.
  1069 		@capability DRM Required when attempting to access an agents private directory
  1070 		*/
  1071 		virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList,CDir*& aDirList) const = 0;
  1072 
  1073 		/**  Gets a filtered list of a directory's contents by UID
  1074 
  1075 		The aUidType parameter determines which file entry types should be listed. The sort key determines the order in which they are listed.
  1076 
  1077 		Notes:
  1078 		-# 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.
  1079 		-# The caller of this function is responsible for deleting aFileList after the function has returned.
  1080 
  1081 		This function can be used to list the contents of the agent's 
  1082 		private directory. Access to the agents private directory is permitted at 
  1083 		the agents discretion. 
  1084 
  1085 		Agents can just return KErrCANotSupported if they do not wish to publish their
  1086 		private directory. Alternatively they can just populate the CDir object
  1087 		with the entries they wish to show.
  1088 
  1089 		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files. 
  1090 		@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. 
  1091 		@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.
  1092 		@param aFileList On return contains a filtered list of directory and file entries.
  1093 		@return The outcome of the GetDir operation.
  1094 		@return KErrNone The directory contents were listed successfully.
  1095 		@return KErrCANotSupported The agent does not allow clients to view its private directory.
  1096 		@return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
  1097 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1098 				other system-wide error codes for any other errors.
  1099 		@capability DRM Required when attempting to access an agents private directory
  1100 		*/
  1101 		virtual TInt GetDir(const TDesC& aName,const TUidType& aEntryUid,TUint aEntrySortKey, CDir*& aFileList) const = 0;
  1102 		
  1103 		/**  Get an attribute from a content object
  1104 	
  1105 		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
  1106 		@param aValue Used to return the value of the attribute.
  1107 		@param aVirtualPath The content object whose attributes are to be queried.
  1108 		@return Whether the attribute value was updated.
  1109 		@return KErrNone if the attribute value was updated.
  1110 		@return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
  1111 		@return KErrCANotSupported if the requested attribute is not supported for this content object.
  1112 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1113 				other system-wide error codes for any other errors.
  1114 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1115 		*/
  1116 		virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath) = 0;
  1117 
  1118 		/**  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.
  1119 	
  1120 		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
  1121 		@param aValue Used to return the value of the attribute.
  1122 		@param aFile The file handle for the file containing the content object.
  1123 		@param aUniqueId The unique id of the content object.
  1124 		@return Whether the attribute value was updated.
  1125 		@return KErrNone if the attribute value was updated.
  1126 		@return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
  1127 		@return KErrCANotSupported if the feature or the requested attribute is not supported for this content object.
  1128 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1129 				other system-wide error codes for any other errors.
  1130 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1131 		*/
  1132 		IMPORT_C virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, RFile& aFile, const TDesC& aUniqueId);
  1133 		
  1134 		/** Get a set of attributes from a content object
  1135 
  1136 		@param aAttributeSet The set of attributes to query and update.
  1137 		@param aVirtualPath The content object to retrieve attributes from.
  1138 		@return Whether the attribute set was updated.
  1139 		@return KErrNone if the attribute set was updated successfully.
  1140 		@return KErrNotFound if the content object was not found.
  1141 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1142 				other system-wide error codes for any other errors.
  1143 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1144 		*/
  1145 		virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath) = 0;
  1146 		
  1147 		/** 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.
  1148 
  1149 		@param aAttributeSet The set of attributes to query and update.
  1150 		@param aFile The file handle for the file containing the content object.
  1151 		@param aUniqueId The unique id of the content object.
  1152 		@return Whether the attribute set was updated.
  1153 		@return KErrNone if the attribute set was updated successfully.
  1154 		@return KErrNotFound if the content object was not found.
  1155 		@return KErrCANotSupported if the feature not supported.
  1156 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1157 				other system-wide error codes for any other errors.
  1158 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1159 		*/
  1160 		IMPORT_C virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, RFile& aFile, const TDesC& aUniqueId);	
  1161 
  1162 		/**  Get text string attributes or meta-data from the file 
  1163 
  1164 		@param aAttribute The attribute to retrieve, from ContentAccess::TStringAttribute.
  1165 		@param aValue Used to return the value of the attribute.
  1166 		@param aVirtualPath The content object whose attributes are to be retrieved.
  1167 		@return Whether the value was updated.
  1168 		@return KErrNone if the attribute was retrieved successfully.
  1169 		@return KErrNotFound if the content object does not exist.
  1170 		@return KErrCANotSupported if the requested attribute does not apply to this content object.
  1171 		@return KErrOverflow if the buffer was not large enough to return the result.
  1172 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1173 				other system-wide error codes for any other errors.
  1174 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1175 		*/
  1176 		virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath) = 0;
  1177 
  1178 		/**  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.
  1179 	
  1180 		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
  1181 		@param aValue Used to return the value of the attribute.
  1182 		@param aFile The file handle for the file containing the content object.
  1183 		@param aUniqueId The unique id of the content object whose attributes are to be retrieved.
  1184 		@return Whether the attribute value was updated.
  1185 		@return KErrNone if the attribute value was updated.
  1186 		@return KErrNotFound if the content object does not exist.
  1187 		@return KErrCANotSupported if the feature or the requested attribute is not supported for this content object.
  1188 		@return KErrOverflow if the buffer was not large enough to return the result.
  1189 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1190 				other system-wide error codes for any other errors.
  1191 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1192 		*/		
  1193 		IMPORT_C virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, RFile& aFile, const TDesC& aUniqueId);
  1194 
  1195 		/** Used to obtain a set of string attributes 
  1196 
  1197 		@param aStringAttributeSet The set of attributes to query and update.
  1198 		@param aVirtualPath The content object whose attributes are to be retrieved.
  1199 		@return Whether the string attribute set was updated.
  1200 		@return KErrNone if the attribute set was updated successfully.
  1201 		@return KErrNotFound if the object with the given virtual path was not found.
  1202 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1203 				other system-wide error codes for any other errors.
  1204 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1205 		*/
  1206 		virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TVirtualPathPtr& aVirtualPath) = 0;
  1207 
  1208 		/** 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.
  1209 
  1210 		@param aStringAttributeSet The set of attributes to query and update.
  1211 		@param aFile The file handle for the file containing the content object.
  1212 		@param aUniqueId The unique id of the content object whose attributes are to be retrieved	
  1213 		@return Whether the string attribute set was updated.
  1214 		@return KErrNone if the attribute set was updated successfully.
  1215 		@return KErrNotFound if the object with the given virtual path was not found.
  1216 		@return KErrCANotSupported if the feature not supported.
  1217 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1218 				other system-wide error codes for any other errors.
  1219 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1220 		*/
  1221 		IMPORT_C virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, RFile& aFile, const TDesC& aUniqueId);
  1222 				
  1223 		/** Notify the caller when the status of a DRM protected content object changes.
  1224 		NB: No assumption should be made about the scope of the descriptor 
  1225 		passed to aURI for asynchronous IPC.
  1226 
  1227 		@param aURI The location of the file.
  1228 		@param aMask Bitmask of events the caller is interested in.
  1229 		@param aStatus The TRequestStatus object to complete if the event occurs, or KErrCANotSupported if the agent does not support asynchronous notifications.
  1230 		@capability DRM Deleting DRM protected content is not permitted for processes without DRM capability. 
  1231 		*/
  1232 		virtual void NotifyStatusChange(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus) = 0;
  1233 
  1234 		/** Cancel a previous notification request
  1235 		@param aURI The URI supplied in the call to NotifyStatusChange().
  1236 		@param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
  1237 		@return The outcome of the cancel request.
  1238 		@return KErrNone if the notification was cancelled.
  1239 		@return KErrNotFound if there was no matching request outstanding.
  1240 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
  1241 		*/
  1242 		virtual TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus) = 0;
  1243 
  1244 		/** 
  1245 		Allows an application to request the modification of a property 
  1246 		within the agent. The agent may or may not permit the property to be changed
  1247 		 	
  1248 		@param aProperty The property to set.
  1249 		@param aValue The value of the property.
  1250 		@return The outcome of the set property command.
  1251 		@return KErrNone if the property was set by all agents.
  1252 		@return KErrCANotSupported if one of the agent does not support the property or value.
  1253 		@return KErrAccessDenied if one of the agents does not permit the property to be changed.
  1254 		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
  1255 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
  1256 		*/
  1257 		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
  1258 
  1259 		/** View information associated with a single content object
  1260 		
  1261 		This call blocks execution and only returns once the display is dismissed 
  1262 		by the user.
  1263 
  1264 		@param aInfo The information to display.
  1265 		@param aVirtualPath The content object.
  1266 		@leave KErrCANotSupported if agent cannot display the requested information.
  1267 		@leave ...		One of the other CAF error codes defined in \c caferr.h  
  1268 		 				or one of the system-wide error codes 
  1269 						for any other errors.		
  1270 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1271 		*/
  1272 		virtual void DisplayInfoL(TDisplayInfo aInfo, const TVirtualPathPtr& aVirtualPath) = 0;
  1273 
  1274 		/** 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.
  1275 		
  1276 		This call blocks execution and only returns once the display is dismissed 
  1277 		by the user.
  1278 
  1279 		@param aInfo The information to display.
  1280 		@param aFile The file handle for the file containing the content object.
  1281 		@param aUniqueId The unique id of the content object.	
  1282 		@leave KErrCANotSupported if the feature not supported or if agent cannot display the requested information.
  1283 		@leave ...		One of the other CAF error codes defined in \c caferr.h  
  1284 		 				or one of the system-wide error codes 
  1285 						for any other errors.		
  1286 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1287 		*/
  1288 		IMPORT_C virtual void DisplayInfoL(TDisplayInfo aInfo, RFile& aFile, const TDesC& aUniqueId);
  1289 	
  1290 		/** 
  1291 		Identifies whether or not the file at the given URI is to be handled by
  1292 		this agent.
  1293 
  1294 		The agent should perform the mimimum possible processing to make the recognition
  1295 		process as fast as possible. It should avoid opening the file whenever possible.
  1296 		
  1297 		The agent should leave only if a temporary or permanent condition prevents it from knowing
  1298 		whether it can detect the content's type.
  1299 		  
  1300 		@param aURI		Location of the file to be examined.
  1301 		@param aShareMode	The share mode to use if the agent opens a file.
  1302 		@return			ETrue if this agent supports and recognises the file, EFalse otherwise. 
  1303 		*/
  1304 		virtual TBool IsRecognizedL(const TDesC& aURI, TContentShareMode aShareMode) const = 0;
  1305 
  1306 		/** 
  1307 		Identifies whether or not the file is handled by this agent.
  1308 
  1309 		The agent should look at the name of the file first to try and avoid the need
  1310 		to read from the file.
  1311 		
  1312 		The agent should leave only if a temporary or permanent condition prevents it from knowing
  1313 		whether it can detect the content's type.		
  1314 		  
  1315 		@param aFile An open file handle.
  1316 	    @return ETrue if this agent supports and recognises the file, EFalse otherwise. 
  1317 		*/
  1318 		virtual TBool IsRecognizedL(RFile& aFile) const = 0;
  1319 
  1320 		/** 
  1321 		 Determines whether the file is recognized by this agent. 
  1322 		 If it is the agent will fill in the file mime type and content mime 
  1323 		 type. 
  1324 		 
  1325 		 The agent should attempt to recognized the file in an efficient manner
  1326 		 It should avoid opening the file to provide the best performance.
  1327 
  1328 		 The agent should leave only if a temporary or permanent condition prevents it from 
  1329 		 detecting content's type.
  1330 
  1331 		 The agent SHOULD NOT perform any API policing on this API since it
  1332 		 will be called from within the Apparc server's process. 
  1333 		  
  1334 		 If a file is recognized, the file mime type should always be set to
  1335 		 the correct value. For the content mime type there are three special cases:
  1336 		 
  1337 		 @li If the file needs to be imported through the Supplier API before
  1338 		 it can be used then the agent should leave the aContentMimeType
  1339 		 parameter blank (zero length). 
  1340 		 
  1341 		 @li If the file has no embedded content, eg an image/jpeg (.jpg) file 
  1342 		 the agent should leave the aContentMimeType parameter blank (zero length).
  1343   
  1344 		 @li If more than one content object is contained within the file, the agent will
  1345 		 set aContentMimeType to "application/x-caf" indicating it is an archive that can
  1346 		 be navigated by CAF regardless of the actual file format.
  1347 		 
  1348 		 @param aFileName			The name of the file to recognize. The name is examined, not the file itself.
  1349 		 @param aBuffer				Buffer containing bytes from the start of the file.
  1350 		 @param aFileMimeType 		Used to return the mime type of the file to the caller.
  1351 		 @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.
  1352 	     @return				Whether or not the file was recognized.
  1353  		 @return ETrue if the file is handled by this agent. The aFileMimeType and aContentMimeType were updated.
  1354 		 @return EFalse if the file was not recognized by this agent.
  1355 		 */
  1356 		virtual TBool RecognizeFileL(const TDesC& aFileName, const TDesC8& aBuffer, TDes8& aFileMimeType, TDes8& aContentMimeType) const = 0;
  1357 
  1358 		
  1359 		/** Allows extended synchronous calls to the agent
  1360 		Objects are passed in and out using serialization
  1361 
  1362 		@param aCommand The agent defined command.
  1363 		@param aInputBuffer Non modifyable input data buffer.
  1364 		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
  1365 		@return The outcome of the agent specific command.
  1366 		@return KErrNone if the command was successful.
  1367 		@return KErrCANotSupported if the agent does not recognize the command.
  1368 		@return KErrPermissionDenied if the agent does not permit the client to execute this command.
  1369 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  
  1370 				or one of the other system-wide error codes 
  1371 				for any other errors.		
  1372   		@capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
  1373 		*/
  1374 		virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer) = 0;
  1375 
  1376 		/** Allows extended asynchronous calls to the agent. 
  1377 		Objects can be passed in and out using serialization.
  1378 		NB: No assumption should be made about the scope of the descriptor 
  1379 		passed to aInputBuffer for asynchronous IPC.
  1380 
  1381 		@param aCommand The agent defined command.
  1382 		@param aInputBuffer Non modifyable input data buffer.
  1383 		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
  1384 		@param aStatus 	Asynchronous request status. On completion this will 
  1385 						contain one of the following error codes: KErrNone if the command
  1386 						was successful. KErrCANotSupported if the agent does 
  1387 						not recognize the command. KErrPermissionDenied if the 
  1388 						agent does not permit the client to execute this command.
  1389 						Otherwise one of the other CAF error codes 
  1390 						defined in \c caferr.h  or one of the other 
  1391 						system-wide error codes for any other errors.
  1392 		@capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
  1393 		*/
  1394 		virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus) = 0;
  1395 
  1396 		/** Allow the agent to display management information for users to 
  1397 		manage any settings	or other information stored by the agent
  1398 
  1399 		The scope of this information is left to the agent implementation but it is expected
  1400 		that a DRM agent will display the state of all DRM rights objects 
  1401 		(pending, available, expired, orphaned) and allow users to delete rights 
  1402 		that are no longer required.
  1403 
  1404 		@leave KErrCANotSupported If the agent does support the display of management information.
  1405 		@capability DRM Agents implementing DRM may not display their management dialog to processes without DRM capability
  1406 		*/
  1407 		virtual void DisplayManagementInfoL() = 0;
  1408 
  1409 
  1410 		/** Prepare the HTTP request headers required to download files that may be 
  1411 		required for this agent.
  1412 
  1413 		@param aStringPool The string pool used by the HTTP session.
  1414 		@param aRequestHeaders The agent will add any required headers to this object.
  1415 		*/
  1416 		virtual void PrepareHTTPRequestHeaders(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const = 0;
  1417 
  1418 		
  1419 		/** Rename a directory
  1420 
  1421 		This function can be used to rename a directory from within the agent's 
  1422 		private directory. Access to the agents private directory is permitted 
  1423 		at the agents discretion. 
  1424 		
  1425 		@param aOldName The existing pathname of the directory to rename.
  1426 		@param aNewName The new pathname of the directory.
  1427 		@return The outcome of the RenameDir operation.
  1428 		@return KErrNone if the directory was removed successfully.
  1429 		@return KErrAccessDenied f the agent does not allow the directory to be removed.
  1430 		@return KErrCANotSupported if the agent does not support directory removal.
  1431 		@return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
  1432 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1433 				other system-wide error codes for any other errors.
  1434 		@capability DRM Required when attempting to access an agents private directory
  1435 		*/
  1436 		IMPORT_C virtual TInt RenameDir(const TDesC& aOldName, const TDesC& aNewName );
  1437 		
  1438 		/**
  1439 		Make a copy of the content file (eg to removable media) belonging to this agent 
  1440 		using a file handle
  1441 
  1442 		Access to the agents private directory is permitted at the 
  1443 		agents discretion.
  1444 
  1445   		@param aSource The handle the source file.
  1446 		@param aDestination The full pathname of the destination file.
  1447 		@return The outcome of the copy operation.
  1448 		@return KErrNone if the file was copied successfully.
  1449 		@return KErrAccessDenied if the agent does not allow the file to be copied.
  1450 		@return KErrCANotSupported if the agent does not support file copying.
  1451 		@return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
  1452 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1453 				other system-wide error codes for any other errors.
  1454   		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
  1455 		*/
  1456 		IMPORT_C virtual TInt CopyFile(RFile& aSource, const TDesC& aDestination);
  1457 		
  1458 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
  1459 		/** 
  1460 		Identifies whether or not the WMDRM content is handled by this agent using the header
  1461 		data of WMDRM file or stream content.
  1462 		
  1463 		The agent should leave only if a temporary or permanent condition prevents it from knowing
  1464 		whether it can detect the content's type.
  1465 
  1466 		@param aHeaderData	Header data of WMDRM file or stream content.
  1467 	    @return ETrue 		If this agent recognises the given content. 
  1468 		*/
  1469 		IMPORT_C virtual TBool IsRecognizedL(const TDesC8& aHeaderData) const;
  1470 		
  1471 		/** 
  1472 		 Determines whether or not the WMDRM content is recognized by this agent. 
  1473 		 If it is recognized, the agent will populate the file and content mime 
  1474 		 type. 
  1475 		 
  1476 		 The agent should leave only if a temporary or permanent condition prevents it from 
  1477 		 detecting content's type.
  1478 
  1479 		 @param aHeaderData			Header data of WMDRM content.
  1480 		 @param aFileMimeType 		Used to return the mime type of the content to the caller.
  1481 		 @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.
  1482 	     @return					Whether or not the content was recognized.
  1483  		 @return ETrue 				If the content is handled by this agent. The aFileMimeType and aContentMimeType were updated.
  1484 		 @return EFalse 			If the content was not recognized by this agent.
  1485 		 */
  1486 		IMPORT_C virtual TBool RecognizeContentL(const TDesC8& aHeaderData, TDes8& aFileMimeType, TDes8& aContentMimeType) const;
  1487 		
  1488 		/**  Get an attribute from WMDRM content.
  1489 	
  1490 		@param aHeaderData	Header data of WMDRM content.
  1491 		@param aAttribute	The attribute to retrieve from ContentAccess::TAttribute.
  1492 		@param aValue		Used to return the value of the attribute.
  1493 		
  1494 		@return				KErrNone if the attribute value was updated.
  1495 		@return				KErrCANotSupported if the requested attribute is not supported for this content.
  1496 		@return				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1497 							other system-wide error codes for any other errors.
  1498 		@capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1499 		*/
  1500 		IMPORT_C virtual TInt GetAttribute(const TDesC8& aHeaderData, TInt aAttribute, TInt& aValue);
  1501 		
  1502 		/** Get a set of attributes from WMDRM content.
  1503 
  1504 		@param aHeaderData		Header data of WMDRM content.
  1505 		@param aAttributeSet	The set of attributes to query and update.
  1506 		
  1507 		@return 				KErrNone if the attribute set was updated successfully.
  1508 		@return 				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1509 								other system-wide error codes for any other errors.
  1510 		@capability DRM 		Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1511 		*/
  1512 		IMPORT_C virtual TInt GetAttributeSet(const TDesC8& aHeaderData, RAttributeSet& aAttributeSet);
  1513 		
  1514 		
  1515 		/**  Get text string attributes or meta-data from WMDRM content.
  1516 
  1517 		@param aHeaderData	Header data of WMDRM content.
  1518 		@param aAttribute	The attribute to retrieve from ContentAccess::TStringAttribute.
  1519 		@param aValue		Used to return the value of the attribute.
  1520 		
  1521 		@return				KErrNone if the attribute was retrieved successfully.
  1522 		@return				KErrNotFound if the content object does not exist.
  1523 		@return				KErrCANotSupported if the requested attribute does not apply to this content object.
  1524 		@return				KErrOverflow if the buffer was not large enough to return the result.
  1525 		@return				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1526 							other system-wide error codes for any other errors.
  1527 		@capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1528 		*/
  1529 		IMPORT_C virtual TInt GetStringAttribute(const TDesC8& aHeaderData, TInt aAttribute, TDes& aValue);
  1530 		
  1531 		/** Used to obtain a set of string attributes from WMDRM content.
  1532 
  1533 		@param aStringAttributeSet	The set of attributes to query and update.
  1534 		@param aHeaderData			Header data of WMDRM content.
  1535 	
  1536 		@return 					KErrNone if the attribute set was updated successfully.
  1537 		@return 					KErrNotFound if the object with the given virtual path was not found.
  1538 		@return 					Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
  1539 									other system-wide error codes for any other errors.
  1540 		@capability DRM 			Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
  1541 		*/
  1542 		IMPORT_C virtual TInt GetStringAttributeSet(const TDesC8& aHeaderData, RStringAttributeSet& aStringAttributeSet);
  1543 
  1544 
  1545 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
  1546 		
  1547 		};
  1548 
  1549 		
  1550 	/** 
  1551 	Manages and retrieves rights objects from an agent.
  1552 
  1553  	@publishedPartner
  1554 	@released
  1555 	*/
  1556 	class CAgentRightsManager  : public CBase
  1557 		{
  1558 	public:
  1559 		/** List all rights held by the agent 
  1560 		@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1561 		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1562 		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1563 		 				or one of the other system-wide error codes 
  1564 						for any other errors.				
  1565 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1566 		*/
  1567 		virtual void ListAllRightsL(RStreamablePtrArray<CRightsInfo>& aArray) const = 0;
  1568 
  1569 		/** List all rights associated with a particular file
  1570 		@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1571 		@param aUri The name of the file.
  1572 		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1573 		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1574 		 				or one of the other system-wide error codes 
  1575 						for any other errors.				
  1576 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1577 		*/
  1578 		virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, const TDesC& aUri) const = 0;
  1579 
  1580 		/** List all rights associated with a particular content object
  1581 		@param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1582 		@param aVirtualPath The content object.
  1583 		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1584 		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1585 		 				or one of the other system-wide error codes 
  1586 						for any other errors.				
  1587 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1588 		*/
  1589 		virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, TVirtualPathPtr& aVirtualPath) const = 0;
  1590 
  1591 		/** 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.
  1592 		
  1593 		@param aArray  		The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
  1594 		@param aFile  		The file handle for the file containing the content object.
  1595 		@param aUniqueId	The unique id of the content object.
  1596 		@leave KErrCANotSupported if the feature not supported.
  1597 		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1598 		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1599 		 				or one of the other system-wide error codes 
  1600 						for any other errors.				
  1601 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1602 		*/
  1603 		IMPORT_C virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, RFile& aFile, const TDesC& aUniqueId) const;			
  1604 
  1605 		/** List all content associated with a particular rights object
  1606 		@param aArray The client supplied array used to store the list of content objects. The agent will add CVirtualPath objects to the supplied array.
  1607 		@param aRightsInfo The rights object.
  1608 		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1609 		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1610 		 				or one of the other system-wide error codes 
  1611 						for any other errors.				
  1612 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1613 		*/
  1614 		virtual void ListContentL(RStreamablePtrArray<CVirtualPath>& aArray, CRightsInfo& aRightsInfo) const = 0;
  1615 		
  1616 		/** This will be used by applications to retrieve an agent specific rights object
  1617 		@param aRightsInfo The rights object.
  1618 		@return An agent specific rights object.
  1619 		@leave KErrPermissionDenied If the agent does not permit the client to access rights information.
  1620 		@leave ...		One of the CAF error codes defined in \c caferr.h  
  1621 		 				or one of the other system-wide error codes 
  1622 						for any other errors.				
  1623 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1624 		*/
  1625 		virtual MAgentRightsBase* GetRightsDataL(const CRightsInfo& aRightsInfo) const = 0;
  1626 
  1627 		/** Asks the DRM agent to delete a rights object 
  1628 
  1629 		The agent may display a dialog asking the user to confirm the delete. Execution
  1630 		will be blocked until the dialog is complete. Applications can request 
  1631 		to disable the agents user interface using the SetProperty() command
  1632 	
  1633 		@param aRightsInfo The rights object.
  1634 		@return The outcome of the delete operation.
  1635 		@return KErrNone if the rights were deleted.
  1636 		@return KErrCancel if the user cancels an agent supplied confirmation dialog.
  1637 		@return KErrNotFound if the rights object does not exist.
  1638 		@return KErrPermissionDenied if the agent does not permit the client to access rights information.
  1639 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1640 		*/
  1641 		virtual TInt DeleteRightsObject(const CRightsInfo& aRightsInfo) = 0;
  1642 		
  1643 		/** Deletes all rights associated with a particular content object
  1644 
  1645 		The agent may display a dialog asking the user to confirm the delete. Execution
  1646 		will be blocked until the dialog is complete. Applications can request 
  1647 		to disable the agents user interface using the SetProperty() command
  1648 
  1649 		@param aVirtualPath The path of the content object.
  1650 		@return The outcome of the delete operation.
  1651 		@return KErrNone if the rights were deleted.
  1652 		@return KErrNotFound if no rights objects exist for the specified content object.
  1653 		@return KErrCancel if the user cancels an agent supplied confirmation dialog.
  1654 		@return KErrPermissionDenied if the agent does not permit the client to access rights information.
  1655 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1656 		*/
  1657 		virtual TInt DeleteAllRightsObjects(const TVirtualPathPtr& aVirtualPath) = 0;
  1658 
  1659 		/** 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.
  1660 
  1661 		The agent may display a dialog asking the user to confirm the delete. Execution
  1662 		will be blocked until the dialog is complete. Applications can request 
  1663 		to disable the agents user interface using the SetProperty() command.
  1664 
  1665 		@param aFile The file handle for the file containing the content object.
  1666 		@param aUniqueId The unique id of the content object.
  1667 		@return The outcome of the delete operation.
  1668 		@return KErrNone if the rights were deleted.
  1669 		@return KErrNotFound if no rights objects exist for the specified content object.
  1670 		@return KErrCancel if the user cancels an agent supplied confirmation dialog.
  1671 		@return KErrPermissionDenied if the agent does not permit the client to access rights information.
  1672 		@return KErrCANotSupported if the feature not supported.
  1673 		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
  1674 		*/
  1675 		IMPORT_C virtual TInt DeleteAllRightsObjects (RFile& aFile, const TDesC& aUniqueId); 
  1676 			
  1677 		/** 
  1678 		Allows an application to request the modification of a property 
  1679 		within the agent. The agent may or may not permit the property to be changed
  1680 		 	
  1681 		@param aProperty The property to set.
  1682 		@param aValue The value of the property.
  1683 		@return KErrNone if the property was set.
  1684 		@return KErrCANotSupported if the agent does not support the property or value.
  1685 		@return KErrAccessDenied if the agent does not permit the property to be changed.
  1686 		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
  1687 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
  1688 		*/
  1689  		virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
  1690 		};
  1691 
  1692 
  1693 } // namespace ContentAccess
  1694 #endif // __AGENTINTERFACE_H__
  1695