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