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