Update contrib.
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
25 #ifndef __AGENTINTERFACE_H__
26 #define __AGENTINTERFACE_H__
29 #include <ecom/ecom.h>
31 #include <caf/caftypes.h>
32 #include <caf/streamableptrarray.h>
33 #include <caf/caferr.h>
38 namespace ContentAccess
40 class CEmbeddedObject;
41 class CSupplierOutputFile;
43 class RStringAttributeSet;
44 class TVirtualPathPtr;
47 class MAgentRightsBase;
53 Defines the agent interface for consumer operations such as
54 reading and seeking within a content object in a file.
59 class CAgentData : public CBase
63 Gets the data size in bytes.
65 @param aSize On return this will contain the size of the plaintext data in bytes.
66 @leave KErrCASizeNotDetermined Size could not be determined by the managing agent.
67 @leave ... One of the other CAF error codes defined in \c caferr.h or one of the
68 system-wide error codes for any other errors.
69 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
71 virtual void DataSizeL(TInt &aSize) = 0;
73 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
75 This is the 64bit version of DataSizeL. Implementing this function should take advantage of 64bit
76 file system and use RFile::Size64(TInt64 &). If this function is not implemented, fallback to 32bit
77 DataSizeL will be provided by CAF automatically.
79 @see DataSizeL(TInt &aSize)
81 IMPORT_C virtual void DataSize64L(TInt64 &aSize);
82 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
85 Allows a client to verify that the intent is supported by the
86 current rights for the data object.
88 Doing so may cause subsequent reads (or other accesses)
89 to fail. The result of the agent's evaluation
90 of the intent is returned.
92 @note Since the intent is only evaluated the agent will not decrement
93 any rights-state such as play counts.
95 @param aIntent The intended way the content will be used.
96 @return Whether rights exist allowing the content to be used for this intent.
97 @return KErrNone if the intent is permitted.
98 @return KErrNoRights if no rights exist for the specified content object.
99 @return KErrCANoPermission if rights exist but the specified intent is not permitted.
100 @return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
101 @return KErrNoPermission if rights exist but none permit the specified intent.
102 @return KErrPermissionDenied if the client is not allowed to use this content object.
103 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
104 other system-wide error codes for any other errors.
106 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
108 virtual TInt EvaluateIntent(TIntent aIntent) = 0;
111 Execute intent allows the application to signal it is about to carry out
112 the specified intent on DRM protected content.The agent will decrement applicable
113 stateful rights such as play counts where necessary.
115 Applications should be very careful to use this function correctly.
116 @li If ExecuteIntent() is never called stateful rights will never be decremented. Users will be able to use the content forever
117 @li If ExecuteIntent() is called too often stateful rights may be consumed prematurely.
119 Usually it would be best to call ExecuteIntent immediately before the content
120 is displayed or the instant playback begins. ExecuteIntent should not be considered a
121 prerequisite for calling the Read functions. It is valid for an application to read from
122 the file before calling ExecuteIntent.
124 @note Since rights are executed here the agent will decrement any rights-state such as
125 play counts that apply.
127 @param aIntent The intent indicator.
128 @return The result of attempting executing the intent.
129 @return KErrNone if the intent is permitted and stateful rights may have been decremented.
130 @return KErrNoRights if no rights exist for the specified content object.
131 @return KErrCANoPermission if rights exist but the specified intent is not permitted.
132 @return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
133 @return KErrNoPermission if rights exist but none permit the specified intent.
134 @return KErrPermissionDenied if the client is not allowed to use this content object.
135 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
136 other system-wide error codes for any other errors.
137 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
139 virtual TInt ExecuteIntent(TIntent aIntent) = 0;
142 Reads from a content object up to the maximum length of the
143 descriptor or the end of the content object.
145 When an attempt is made to read beyond the end of the content,
146 no error is returned. The descriptor’s length is set to the
147 number of bytes that were read into it. Therefore, when reading
148 through content, the end has been reached when the
149 descriptor length (given by TDesC::Length()) is zero.
151 @param aDes Descriptor into which binary data is read. Any existing
152 contents are overwritten. On return, its length is set
153 to the number of bytes read.
154 @return KErrNone if successful, otherwise another of the
155 system-wide error codes.
156 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
158 virtual TInt Read(TDes8& aDes) = 0;
161 Reads a specified number of bytes of content.
163 @see Read(TDes8& aDes)
165 @param aDes Descriptor into which binary data is read. Any existing
166 contents are overwritten. On return, its length is set
167 to the number of bytes read.
168 @param aLength The number of bytes to read from the file,
169 or to the end of the file, whichever is encountered first.
170 The length of the buffer is set to the number of bytes actually read.
171 @return KErrNone if successful.
172 @return Otherwise one of the CAF error codes defined in \c caferr.h or
173 one of the other system-wide error codes.
174 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
176 virtual TInt Read(TDes8& aDes, TInt aLength) = 0;
179 Reads content asynchronously.
181 @see Read(TDes8& aDes)
183 @param aDes Descriptor into which binary data is read. Any
184 existing contents are overwritten. On return,
185 its length is set to the number of bytes read.
186 @param aStatus Asynchronous request status. On completion this will contain one
187 of the following error codes: KErrNone if the data was
188 successfully read. Otherwise one of the CAF error codes defined in
189 \c caferr.h or one of the other standard system-wide
190 error codes for any other errors.
191 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
193 virtual void Read(TDes8& aDes, TRequestStatus& aStatus) = 0;
196 Reads content asynchronously (up to a specified maximum number of bytes)
198 @see Read(TDes8& aDes)
200 @param aDes Descriptor into which binary data is read. Any
201 existing contents are overwritten. On return,
202 its length is set to the number of bytes read.
203 @param aLength The number of bytes to read from the file,
204 or to the end of the file, whichever is encountered first.
205 The length of the buffer is set to the number of bytes actually read.
206 @param aStatus Asynchronous request status. On completion this will contain one
207 of the following error codes: KErrNone if the data was
208 successfully read. Otherwise one of the CAF error codes defined in
209 \c caferr.h or one of the other standard system-wide
210 error codes for any other errors.
211 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
213 virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus) = 0;
216 Cancels asynchronous read.
218 @param aStatus Asynchronous request status. This parameter should have been supplied earlier to
219 an asynchronous Read call. If it has not been previously supplied to a Read call,
220 this function will not have any effect.
221 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
223 IMPORT_C virtual void ReadCancel(TRequestStatus& aStatus);
226 Changes or retrieves the location of the file pointer within
229 There are four seek modes used:
231 @li ESeekStart - Sets the file pointer aPos bytes from the start of the
232 content object. aPos is not modified by the call to Seek()
233 @li ESeekEnd - Sets the file pointer aPos bytes from the end of the
234 content object. The aPos parameter supplied should be zero or negative
235 when using ESeekEnd. Upon completion aPos is updated with the current
236 position relative to the start of the content object.
237 @li ESeekCurrent - Moves the file pointer aPos bytes from the current
238 position. Upon completion aPos is updated with the new position relative
239 to the start of the content object. Suppling a zero value for the aPos Parameter can be
240 used to retrieve the current file pointer location
241 @li ESeekAddress Sets the aPos parameter to the address of the byte
242 aPos bytes from the start of the content object
246 @param aMode Seek mode - controls the destination of the
249 @param aPos Offset from either the start, end or current position depending upon
250 the seek mode. Negative offsets are used to seek before the current position or
251 relative to the end of the file.
253 @return KErrNone if successful.
254 @return Otherwise one of the CAF error codes defined in \c caferr.h or one
255 of the other system-wide error codes.
256 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
258 virtual TInt Seek(TSeek aMode, TInt& aPos) = 0;
260 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
262 This is the 64bit version of Seek. Implementing this function should take advantage of 64bit
263 file system and use RFile::Seek64(TSeek, TInt64 &). If this function is not implemented, fallback to 32bit
264 Seek will be provided by CAF automatically.
266 @see Seek(TSeek aMode, TInt& aPos)
268 IMPORT_C virtual TInt Seek64(TSeek aMode, TInt64& aPos);
269 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
272 Allows an application to request the modification of a property
273 within the agent handling this content. The agent may or may not
274 permit the property to be changed
276 @param aProperty The property to set.
277 @param aValue The value of the property.
278 @return Whether or not the property was set.
279 @return KErrNone if the property was set.
280 @return KErrCANotSupported if the agent does not support the property or value.
281 @return KErrAccessDenied if the agent does not permit the property to be changed.
282 @return KErrPermissionDenied if the application does not have the necessary capability to change the property.
283 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
285 virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
287 /** Get the value of an attribute for this content object
289 @param aAttribute The attribute to query, from ContentAccess::TAttribute.
290 @param aValue Used to return the attribute value.
291 @return Whether the attribute was updated.
292 @return KErrNone if the value of the attribute was updated.
293 @return KErrCANotSupported if the requested attribute does not exist.
294 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
295 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
296 other system-wide error codes for any other errors.
297 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
299 virtual TInt GetAttribute(TInt aAttribute, TInt& aValue)=0;
301 /** Get a set of attributes from a content object
303 @param aAttributeSet The set of attributes to query and update.
304 @return Whether the attribute set was updated.
305 @return KErrNone if the attributes were retrieved successfully.
306 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
307 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
308 other system-wide error codes for any other errors.
309 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
311 virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet) = 0;
313 /** Get text string attributes or meta-data for this content object
315 @param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
316 @param aValue Returns the value of the attribute.
317 @return Whether the value was updated.
318 @return KErrNone if the attribute was retrieved.
319 @return KErrOverflow if the buffer was not large enough to return the result.
320 @return KErrCANotSupported if the requested attribute does not exist.
321 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
322 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
323 other system-wide error codes for any other errors.
324 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
326 virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue)=0;
329 /** Used to obtain a set of string attributes
331 @param aStringAttributeSet The set of attributes to query and update.
332 @return Whether the string attribute set was updated.
333 @return KErrNone if the attributes were retrieved successfully.
334 @return KErrNotFound if the default content object was not found.
335 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
336 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
337 other system-wide error codes for any other errors.
338 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
340 virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet)=0;
343 Reads content asynchronously. The data is read from a specified offset
344 up to a specified number of bytes or until the end of the content object
345 is reached. The data is read into the descriptor buffer supplied.
347 @see Read(TDes8& aDes)
349 @param aPos Position of first byte to be read.
350 This is an offset from the start of the file.
351 @param aDes Descriptor into which binary data is read. Any
352 existing contents are overwritten. On return,
353 its length is set to the number of bytes read.
354 @param aLength The number of bytes to read from the file,
355 or to the end of the file, whichever is encountered first.
356 The length of the buffer is set to the number of bytes actually read.
357 @param aStatus Asynchronous request status. On completion this will contain one
358 of the following error codes: KErrNone if the data was
359 successfully read. Otherwise one of the CAF error codes defined in
360 \c caferr.h or one of the other standard system-wide
361 error codes for any other errors.
362 @return KErrNone if the async read request was successfully submitted.
363 @return KErrCANotSupported if the agent does not support this operation.
364 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
366 IMPORT_C virtual TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
368 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
370 This is the 64bit version of CAgentData::Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
371 Implementing this function should take advantage of 64bit file system and use RFile::Seek64(TSeek, TInt64 &) to get to
372 the position in file specified by aPos. If this function is not implemented, fallback to 32bit
373 Read will be provided by CAF automatically.
375 @see Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
377 IMPORT_C virtual TInt Read64(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
378 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
380 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
382 Decrypts the encrypted input data packet.Default implementation of this method returns KErrCANotSupported.
384 @param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application.
385 @param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written.
386 The length of this descriptor must be equal to or greater than the input packet.
387 @return KErrNone if successful or KErrInsuffcientDataPacketLength, if a part of input data packet
388 is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h or
389 one of the other system-wide error.
390 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
391 Access to unprotected content is unrestricted.
393 IMPORT_C virtual TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket);
397 Decrypts the encrypted input data packet asynchronously.Default implementation of this method returns KErrCANotSupported.
399 @param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application.
400 @param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written.
401 The length of this descriptor must be equal to or greater than the input packet.
402 @param aStatus Asynchronous request status. On completion this will contain one of the following error codes:
403 KErrNone if the data packet was successfully decrypted or KErrInsuffcientDataPacketLength, if a part of input data packet
404 is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h or
405 one of the other system-wide error codes.
406 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
407 Access to unprotected content is unrestricted.
409 IMPORT_C virtual void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus);
410 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
413 /** Defines the agent interface allowing clients to browse the objects
419 class CAgentContent : public CBase
422 /** Open a Container object within the file.
424 Allows an application to access the content objects and
425 any nested container objects within the specified container.
427 @param aUniqueId The container object's unique ID.
428 @return Whether the container was opened.
429 @return KErrNone if the container was opened successfully.
430 @return KErrNotFound if the container does not exist.
431 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
432 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
433 other system-wide error codes for any other errors.
434 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
436 virtual TInt OpenContainer(const TDesC& aUniqueId) = 0;
438 /** Close the current container object and go back to previous enclosing
439 container within the file.
441 Allows an application to access the content objects and
442 any nested container objects within parent container
444 @return Whether the container was closed.
445 @return KErrNone if the container was closed.
446 @return KErrNotFound if there is no enclosing container.
447 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
448 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
450 virtual TInt CloseContainer() = 0;
452 /** List all the embedded container objects and content objects within the
455 The UniqueId() member of CEmbeddedObject can be used to refer directly to
456 a particular object within the file.
458 @param aArray The array to be populated with the embedded objects.
459 @leave KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
460 @leave ... One of the CAF error codes defined in \c caferr.h or one of the
461 other system-wide error codes for any other errors.
462 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
464 virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray) = 0;
466 /** List all the embedded objects within the current container that
467 are of the specified type
469 @param aArray The array to be populated with the embedded objects.
470 @param aType The type of objects to list.
471 @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
472 @leave ... One of the CAF error codes defined in \c caferr.h or one of the
473 other system-wide error codes for any other errors.
474 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
476 virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray, TEmbeddedType aType) = 0;
478 /** Search the current container for content objects with a particular mime type
480 @param aArray The array to store the results of the search. The agent will add CEmbeddedObject objects to the supplied array.
481 @param aMimeType The mime type to search for.
482 @param aRecursive ETrue to search inside containers embedded within the current container, EFalse to search only the current container.
483 @return The result of the search.
484 @return KErrNone if the search was successful, even if no content objects were found.
485 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
486 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
487 other system-wide error codes for any other errors.
488 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
490 virtual TInt Search(RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8& aMimeType, TBool aRecursive) = 0;
492 /** Get an attribute for an object within the file
494 @param aAttribute The attribute to query, from ContentAccess::TAttribute.
495 @param aValue Used to return the attribute value.
496 @param aUniqueId The UniqueId of the object within the file.
497 @return Whether the attribute value was updated.
498 @return KErrNone if the value of the attribute was updated.
499 @return KErrNotFound if the object with the given UniqueId was not found.
500 @return KErrCANotSupported if the requested attribute does not exist.
501 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
502 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
503 other system-wide error codes for any other errors.
504 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
506 virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId) = 0;
508 /** Get a set of attributes for an object within the file
510 @param aAttributeSet The set of attributes to query and update.
511 @param aUniqueId The unique ID of the object within the file.
512 @return Whether that attribute set was updated.
513 @return KErrNone if the attributes were retrieved successfully.
514 @return KErrNotFound if the default content object was not found.
515 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
516 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
517 other system-wide error codes for any other errors.
518 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
520 virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId) = 0;
522 /** Get text string attributes or meta-data for an object within the file
524 @param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
525 @param aValue Returns the value of the attribute.
526 @param aUniqueId The UniqueId of the object within the file.
527 @return Whether the attribute value was updated.
528 @return KErrNone if the attribute was retrieved.
529 @return KErrNotFound if the object with the given UniqueId was not found.
530 @return KErrOverflow if the buffer was not large enough to return the result.
531 @return KErrCANotSupported if the requested attribute does not exist.
532 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
533 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
534 other system-wide error codes for any other errors.
535 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
537 virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId) = 0;
539 /** Used to obtain a set of string attributes for an object within the file
541 @param aStringAttributeSet The set of attributes to query and update.
542 @param aUniqueId The UniqueId of the container or content.
543 @return Whether the attribute set was updated.
544 @return KErrNone if the attributes were retrieved successfully.
545 @return KErrNotFound if the object with the given UniqueId was not found.
546 @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
547 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
548 other system-wide error codes for any other errors.
549 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
551 virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId)=0;
553 /** Allows extended synchronous calls to the CAF agent handling this file
555 Applications familiar with the agent can pass objects in and out using serialization.
557 @param aCommand The agent defined command.
558 @param aInputBuffer Non modifyable input data buffer.
559 @param aOutputBuffer Modifyable output buffer to hold the result of the command.
560 @return The outcome of the agent specific command.
561 @return KErrCANotSupported if the agent does not recognize the command.
562 @return KErrOverflow if the output buffer supplied is too small.
563 @return KErrPermissionDenied if the agent does not allow the client to execute the command.
564 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
565 other system-wide error codes for any other errors.
566 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
568 virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer) = 0;
570 /** Allows extended synchronous calls to the CAF agent handling this file.
571 Applications familiar with the agent can pass objects in and out using serialization.
572 NB: No assumption should be made about the scope of the descriptor
573 passed to aInputBuffer for asynchronous IPC.
575 @param aCommand The agent defined command.
576 @param aInputBuffer Non modifyable input data buffer.
577 @param aOutputBuffer Modifyable output buffer to hold the result of the command.
578 @param aStatus Asynchronous request status. On completion this will contain
579 one of the following error codes:
580 KErrNone if the command was successfully executed.
581 KErrCANotSupported if the agent does not recognize the command.
582 KErrOverflow if the output buffer supplied is too small.
583 KErrPermissionDenied if the agent does not allow the client
584 to execute the command. Otherwise one of the other CAF error codes defined
585 in \c caferr.h or one of the other system-wide error codes
586 for any other errors.
587 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
589 virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus) = 0;
591 /** Request notification for an event for an object within the file.
592 NB: No assumption should be made about the scope of the descriptor
593 passed to aUniqueId for asynchronous IPC.
595 @param aMask Bitmask of events the caller is interested in.
596 @param aStatus The TRequestStatus object to complete if the event occurs.
597 @param aUniqueId The UniqueId of the container or content.
598 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
600 virtual void NotifyStatusChange(TEventMask aMask, TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
602 /** Cancel a previous notification request
604 @param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
605 @param aUniqueId The UniqueId of the content object within the file.
606 @return The outcome of the cancel request.
607 @return KErrNone if the request was cancelled.
608 @return KErrNotFound if there was no matching request outstanding.
609 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
611 virtual TInt CancelNotifyStatusChange(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
613 /** Request the agent to obtain rights for a protected content object.
614 NB: No assumption should be made about the scope of the descriptor
615 passed to aUniqueId for asynchronous IPC.
617 This request may be handled differently by different agents.
618 Some agents may open a browser and direct the user to a URL. Others may
619 download and install the rights in the background.
621 The call should not block execution, applications can wait for a notification
622 if they are interested in the outcome.
624 If a rights request completes sucessfully it does not necessarily mean rights
625 are available. It just means the request is complete.
627 @param aStatus Asynchronous request status. On completion this will contain
628 one of the following error codes:
629 KErrNone if the rights request was successful.
630 KErrCANotSupported if the agent does not allow rights requests.
631 Otherwise one of the other CAF error codes defined in \c caferr.h
632 or one of the other system-wide error codes
633 for any other errors.
635 @param aUniqueId The unique id of the object within the file.
636 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
638 virtual void RequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
640 /** Cancel a previous RequestRights() request
642 @param aStatus The TRequestStatus that was supplied to the RequestRights() function.
643 @param aUniqueId The objects Unique Id that was supplied to the RequestRights() function.
644 @return The result of the cancel rights request.
645 @return KErrNone if the rights request was cancelled.
646 @return KErrNotFound if there was no matching rights request outstanding.
647 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
649 virtual TInt CancelRequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId) = 0;
651 /** View information associated with a single content object
653 This call blocks execution and only returns once the display is dismissed
656 @param aInfo The information to display.
657 @param aUniqueId The unique id of the object within the file.
658 @leave KErrCANotSupported if information cannot be displayed or does not exist.
659 @leave ... One of the other CAF error codes defined in \c caferr.h
660 or one of the system-wide error codes for
662 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
664 virtual void DisplayInfoL(TDisplayInfo aInfo, const TDesC& aUniqueId) = 0;
667 Allows an application to request the modification of a property
668 within the agent handling this content. The agent may or may not
669 permit the property to be changed
671 @param aProperty The property to set.
672 @param aValue The value of the property.
673 @return Whether the property was set.
674 @return KErrNone if the property was set.
675 @return KErrCANotSupported if the agent does not support the property or value.
676 @return KErrAccessDenied if the agent does not permit the property to be changed.
677 @return KErrPermissionDenied if the application does not have the necessary capability to change the property.
678 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
680 virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
685 Defines the interface for importing files into a Content access agent.
687 The agent should treat the import as a transaction and either import the
688 entire file or revert to the state before the import if the import is cancelled.
690 The client cancels an import by deleting the CAgentImportFile object
691 before WriteDataComplete() is called.
696 class CAgentImportFile : public CBase
700 /** Writes a block of data from a file to the agent
702 @param aData The block of data.
703 @return The result of the write operation.
704 @return KErrNone if the data was written successfully.
705 @return KErrCANewFileHandleRequired if the agent requires the client to provide a new file handle before proceeding. The agent must save its state and continue processing when the new handle is supplied by ContinueWithNewOutputFile().
706 @return KErrNotReady if the agent was not expecting WriteData() to be called at this point.
707 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
708 other system-wide error codes for any other errors.
710 virtual TInt WriteData(const TDesC8& aData)=0;
712 /** Signals to the agent that the entire file has now been transferred to the agent.
714 @return The result of the write operation.
715 @return KErrNone if the data was written successfully.
716 @return KErrCANewFileHandleRequired if the agent requires the client to provide a new file handle before proceeding. The agent must save its state and continue processing when the new handle is supplied by ContinueWithNewOutputFile().
717 @return KErrNotReady if the agent was not expecting WriteDataComplete() to be called at this point.
718 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
719 other system-wide error codes for any other errors.
721 virtual TInt WriteDataComplete()=0;
723 /** Asynchronously writes a block of data from a file the agent
725 Notifies the client when the write operation is complete.
727 @param aData The block of data.
728 @param aStatus Asynchronous request status. On completion this will
729 contain one of the following error codes: KErrNone if the data was written successfully.
730 KErrCANewFileHandleRequired if the agent requires a new
731 file handle before proceeding - the agent must save its
732 state and continue processing when the new handle
733 is supplied by ContinueWithNewOutputFile().
734 KErrNotReady if the agent was not expecting WriteDataComplete()
735 to be called at this point. Otherwise one of the other CAF error codes
736 defined in \c caferr.h or one of the other standard system-wide
737 error codes for any other errors.
739 virtual void WriteData(const TDesC8& aData, TRequestStatus& aStatus)=0;
741 /** Signals to the agent that the entire file has now been transferred to the agent
743 Notifies the client when any final processing operation is complete.
745 @param aStatus Asynchronous request status. On completion this will
746 contain one of the following error codes: KErrNone if the data was written successfully.
747 KErrCANewFileHandleRequired if the agent requires a new
748 file handle before proceeding - the agent must save its
749 state and continue processing when the new handle
750 is supplied by ContinueWithNewOutputFile().
751 KErrNotReady if the agent was not expecting WriteDataComplete()
752 to be called at this point. Otherwise one of the other CAF error codes
753 defined in \c caferr.h or one of the other standard system-wide
754 error codes for any other errors.
756 virtual void WriteDataComplete(TRequestStatus& aStatus)=0;
758 /** Gets the number of output files produced so far.
759 @return The number of output files.
761 virtual TInt OutputFileCountL() const = 0;
763 /** Return information about an output file generated by the import operation.
765 It is possible that the output file does not have the same name
766 as the one suggested at the beginning of the import. An agent may
767 need to use a particular file extension or a particular name.
769 The agent may decide not to store the output file in the output directory
770 suggested at the start of the import. eg. it may store the file in its private
773 The output files may only appear in this array after the WriteDataComplete()
774 function has been called.
776 @param aIndex The zero-based index of the file (must be less than the value returned by OutputFileCountL().
777 @return The CSupplierOutputFile for this object.
779 virtual CSupplierOutputFile& OutputFileL(TInt aIndex) = 0;
781 /** Retrieve the import status
783 Used to indicate non fatal problems encountered during the import operation.
784 Provides feedback to the client in case any problems are encountered.
786 The client can then decide whether or not to continue the import.
788 @return The state of the import operation.
790 virtual TImportStatus GetImportStatus() const = 0;
793 /** Get the agents suggestion for the file extension of the output file required by the agent
795 This function should only be called when the agent has returned KErrCANewFileHandleRequired from
796 WriteData() or WriteDataComplete().
798 The extension must include the dot '.' character.
800 @param aFileExtension On completion this will contain the appropriate file extension.
801 @return The result of the request for a file extension.
802 @return KErrNone if the agent populated aFileExtension with the correct file extension.
803 @return KErrNotReady if the agent is not waiting for another file handle to be provided.
804 @return KErrUnknown if the agent does not know what extension should be used.
806 virtual TInt GetSuggestedOutputFileExtension(TDes& aFileExtension) = 0;
808 /** Get the agents suggestion for the file name (with extension) of the output file required by the agent
810 This function should only be called when the agent has returned KErrCANewFileHandleRequired from
811 WriteData() or WriteDataComplete().
813 The file name is of the form filename.extension.
815 @param aFileName On completion this will contain the appropriate filename.
816 @return KErrNone if the agent populated aFileName with the correct file name.
817 @return KErrNotReady if the agent is not waiting for another file handle to be provided.
818 @return KErrUnknown if the agent does not know what file name should be used.
820 virtual TInt GetSuggestedOutputFileName(TDes& aFileName) = 0;
822 /** Continue the last write operation with a new file handle as requested by the agent
824 @param aFile A new file handle opened with write permission.
825 @param aFileName The name of the file handle that has been supplied. This is used by the agent when creating CSupplierOutputFile objects. It should include the full path and filename in order to be consistent with files generated by the agent.
826 @return The result of the continuing write operation.
827 @return KErrNone if the WriteData() or WriteDataComplete() operation is now complete.
828 @return KErrCANewFileHandleRequired if the agent requires a new
829 file handle before proceeding - the agent must save its
830 state and continue processing when the new handle
831 is supplied by ContinueWithNewOutputFile().
832 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
833 other system-wide error codes for any other errors.
835 virtual TInt ContinueWithNewOutputFile(RFile& aFile, const TDesC& aFileName) = 0;
837 /** Continue the last write operation with a new file handle and return the result asynchronously.
839 @param aFile A new file handle opened with write permission
840 @param aFileName The name of the file handle that has been supplied. This is used by the agent when creating CSupplierOutputFile objects. It should include the full path and filename in order to be consistent with files generated by the agent
842 @param aStatus Asynchronous request status. On completion this will
843 contain one of the following error codes: KErrNone if the
844 WriteData() or WriteDataComplete() operation is now complete.
845 KErrCANewFileHandleRequired if the agent requires a new
846 file handle before proceeding - the agent must save its
847 state and continue processing when the new handle
848 is supplied by ContinueWithNewOutputFile(). Otherwise one of the
849 other CAF error codes defined in \c caferr.h or one of the
850 other system-wide error codes for any other errors.
852 virtual void ContinueWithNewOutputFile(RFile& aFile, const TDesC& aFileName, TRequestStatus& aStatus) = 0;
854 /** Cancel an outstanding asynchronous WriteData() request.
856 IMPORT_C virtual void Cancel();
858 /** Retrieve the content MIME type based on available data
860 This function should only be called when the agent has returned KErrCANewFileHandleRequired from WriteData()
861 If the agent cannot return a content MIME type, the importer should assume that no content type
862 will be available until after the import session has been finished
864 @param aContentMime On return this will contain the appropriate content MIME type.
865 @return The result of the request for a content MIME type.
866 @return ETrue if the agent populated aContentMime with the correct content MIME type.
867 @return EFalse if the agent cannot return the content MIME type (for example, there
868 is not enough data, or the content is multi-part)
870 IMPORT_C virtual TBool ContentMimeTypeL(TDes8& aContentMime);
875 Defines the agent interface for manager operations.
877 The CAgentManager is not related to any particular content object but
878 used to manage files and settings belonging to this agent
880 All operations performed by the agent manager should be implemented in a
881 transactional manner by either completing or reverting to the state before
882 the function was called.
887 class CAgentManager : public CBase
891 Delete a file belonging to this agent
893 The agent implementation may delete rights that were associated with
894 the content at the same time. If an agent does delete rights at the same
895 time as the content it should display a confirmation dialog that makes it
896 clear to the user the rights they paid for will be also deleted.
898 Execution will be blocked until any dialog displayed is complete. Applications
899 can request to disable the agents user interface using the SetProperty() command
901 Access to the agents private directory is permitted at the
904 @param aFileName The full pathname of the file to delete.
905 @return The outcome of the delete operation.
906 @return KErrNone if the file was deleted successfully.
907 @return KErrCancel if the user selects cancel in an agent supplied confirmation screen.
908 @return KErrAccessDenied if the agent does not allow the file to be deleted.
909 @return KErrCANotSupported if the agent does not support file deletion
910 @return KErrPermissionDenied if the client does not have the necessary capabilities to delete the file.
911 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
912 other system-wide error codes for any other errors.
913 @capability DRM Deleting DRM protected content is not permitted for processes without DRM capability.
915 virtual TInt DeleteFile(const TDesC &aFileName) = 0;
918 Make a copy of the content file (eg to removable media) belonging to this agent
920 Access to the agents private directory is permitted at the
923 @param aSource The full pathname of the source file.
924 @param aDestination The full pathname of the destination file.
925 @return The outcome of the copy operation.
926 @return KErrNone if the file was copied successfully.
927 @return KErrAccessDenied if the agent does not allow the file to be copied.
928 @return KErrCANotSupported if the agent does not support file copying.
929 @return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
930 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
931 other system-wide error codes for any other errors.
932 @capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
934 virtual TInt CopyFile(const TDesC& aSource, const TDesC& aDestination) = 0;
937 Rename or move the content file (eg to removable media) belonging to this agent
939 Access to the agent private directories is permitted at the
942 @param aSource The full pathname of the source file.
943 @param aDestination The full pathname of the destination file.
944 @return The outcome of the Rename operation.
945 @return KErrNone if the file was moved or renamed successfully.
946 @return KErrAccessDenied if the agent does not allow the file to be moved or renamed.
947 @return KErrCANotSupported if the agent does not support file renaming.
948 @return KErrPermissionDenied if the client does not have the necessary capabilities to move or rename the file.
949 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
950 other system-wide error codes for any other errors.
951 @capability DRM Moving DRM protected files is not permitted for processes without DRM capability. Moving unprotected files is permitted
953 virtual TInt RenameFile(const TDesC& aSource, const TDesC& aDestination) = 0;
955 /** Create a directory
957 This function can be used to create a directory within in the agent's
958 private directory. Access to the agents private directory is permitted at the
961 @param aPath The full pathname of the directory to create.
962 @return The outcome of the MkDir operation.
963 @return KErrNone if the directory was created successfully.
964 @return KErrAccessDenied if the agent does not allow the directory to be created.
965 @return KErrCANotSupported if the agent does not support directory creation.
966 @return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
967 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
968 other system-wide error codes for any other errors.
970 @capability DRM Required when attempting to access an agents private directory
972 virtual TInt MkDir(const TDesC& aPath) = 0;
974 /** Create all directories in the given path if they do not exist
976 This function can be used to create directories within in the agent's
977 private directory. Access to the agents private directory is permitted at the
980 @param aPath The full pathname of the directory to create.
981 @return The outcome of the MkDirAll operation.
982 @return KErrNone if the directory was created successfully.
983 @return KErrAccessDenied if the agent does not allow the directory to be created.
984 @return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
985 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
986 other system-wide error codes for any other errors.
987 @capability DRM Required when attempting to access an agents private directory
989 virtual TInt MkDirAll(const TDesC& aPath) = 0;
991 /** Remove a directory
993 This function can be used to remove a directory from within the agent's
994 private directory. Access to the agents private directory is permitted
995 at the agents discretion.
997 @param aPath The full pathname of the directory to remove.
998 @return The outcome of the RmDir operation.
999 @return KErrNone if the directory was removed successfully.
1000 @return KErrAccessDenied if the agent does not allow the directory to be removed.
1001 @return KErrCANotSupported if the agent does not support directory removal.
1002 @return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
1003 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1004 other system-wide error codes for any other errors.
1005 @capability DRM Required when attempting to access an agents private directory
1007 virtual TInt RmDir(const TDesC& aPath) = 0;
1009 /** Gets a filtered list of a directory's contents.
1011 The bitmask determines which file and directory entry types should be listed. The sort key determines the order in which they are listed.
1014 -# If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.
1015 -# The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.
1016 -# The caller of this function is responsible for deleting aFileList after the function has returned.
1019 This function can be used to list the contents of the agent's
1020 private directory. Access to the agents private directory is permitted at
1021 the agents discretion.
1023 Agents can just return KErrCANotSupported if they do not wish to publish their
1024 private directory. Alternatively they can just populate the CDir object
1025 with the entries they wish to show.
1027 @param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files.
1028 @param aEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in the listing. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes
1029 @param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
1030 @param aEntryList On return contains a filtered list of directory and file entries.
1031 @return The outcome of the GetDir operation.
1032 @return KErrNone if the directory contents were listed successfully.
1033 @return KErrCANotSupported if the agent does not allow clients to view its private directory.
1034 @return KErrPermissionDenied if the process does not have the correct capabilities to view the directory.
1035 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1036 other system-wide error codes for any other errors.
1037 @capability DRM Required when attempting to access an agents private directory
1039 virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList) const = 0;
1041 /** Gets a filtered list of the directory and file entries contained in a directory and a list of the directory entries only
1043 The bitmask determines which file and directory entry types should be listed in aFileList. The contents of the second list, aDirList are not affected by the bitmask; it returns all directory entries contained in directory aName. The sort key determines the order in which both lists are sorted.
1046 -# If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.
1047 -# The function sets both aFileList and aDirList to NULL, and then allocates memory to them before appending entries to the lists. Therefore, aFileList and aDirList should have no memory allocated to them before this function is called, otherwise the allocated memory will become orphaned.
1048 -# The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.
1050 This function can be used to list the contents of the agent's
1051 private directory. Access to the agents private directory is permitted at
1052 the agents discretion.
1054 Agents can just return KErrCANotSupported if they do not wish to publish their
1055 private directory. Alternatively they can just populate the CDir object
1056 with the entries they wish to show.
1058 @param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files.
1059 @param aEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in aFileList. aDirList is unaffected by this mask. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.
1060 @param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries in both lists are to be sorted. These flags are defined by TEntryKey.
1061 @param aEntryList On return contains a filtered list of directory and file entries.
1062 @param aDirList On return contains a filtered list of directory entries only.
1063 @return The outcome of the GetDir operation.
1064 @return KErrNone The directory contents were listed successfully.
1065 @return KErrCANotSupported The agent does not allow clients to view its private directory.
1066 @return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
1067 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1068 other system-wide error codes for any other errors.
1069 @capability DRM Required when attempting to access an agents private directory
1071 virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList,CDir*& aDirList) const = 0;
1073 /** Gets a filtered list of a directory's contents by UID
1075 The aUidType parameter determines which file entry types should be listed. The sort key determines the order in which they are listed.
1078 -# The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.
1079 -# The caller of this function is responsible for deleting aFileList after the function has returned.
1081 This function can be used to list the contents of the agent's
1082 private directory. Access to the agents private directory is permitted at
1083 the agents discretion.
1085 Agents can just return KErrCANotSupported if they do not wish to publish their
1086 private directory. Alternatively they can just populate the CDir object
1087 with the entries they wish to show.
1089 @param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files.
1090 @param aEntryUid Only those files whose UIDs match those specified within this UID type will be included in the file list. Any, or all, of the three UIDs within the UID type may be omitted. Any UID which is omitted acts in a similar manner to a wildcard character, matching to all UIDs.
1091 @param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
1092 @param aFileList On return contains a filtered list of directory and file entries.
1093 @return The outcome of the GetDir operation.
1094 @return KErrNone The directory contents were listed successfully.
1095 @return KErrCANotSupported The agent does not allow clients to view its private directory.
1096 @return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
1097 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1098 other system-wide error codes for any other errors.
1099 @capability DRM Required when attempting to access an agents private directory
1101 virtual TInt GetDir(const TDesC& aName,const TUidType& aEntryUid,TUint aEntrySortKey, CDir*& aFileList) const = 0;
1103 /** Get an attribute from a content object
1105 @param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
1106 @param aValue Used to return the value of the attribute.
1107 @param aVirtualPath The content object whose attributes are to be queried.
1108 @return Whether the attribute value was updated.
1109 @return KErrNone if the attribute value was updated.
1110 @return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
1111 @return KErrCANotSupported if the requested attribute is not supported for this content object.
1112 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1113 other system-wide error codes for any other errors.
1114 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1116 virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath) = 0;
1118 /** Get a content's attribute from a file specified by file handle. Can be used when the source file is in the client's private directory.
1120 @param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
1121 @param aValue Used to return the value of the attribute.
1122 @param aFile The file handle for the file containing the content object.
1123 @param aUniqueId The unique id of the content object.
1124 @return Whether the attribute value was updated.
1125 @return KErrNone if the attribute value was updated.
1126 @return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
1127 @return KErrCANotSupported if the feature or the requested attribute is not supported for this content object.
1128 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1129 other system-wide error codes for any other errors.
1130 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1132 IMPORT_C virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, RFile& aFile, const TDesC& aUniqueId);
1134 /** Get a set of attributes from a content object
1136 @param aAttributeSet The set of attributes to query and update.
1137 @param aVirtualPath The content object to retrieve attributes from.
1138 @return Whether the attribute set was updated.
1139 @return KErrNone if the attribute set was updated successfully.
1140 @return KErrNotFound if the content object was not found.
1141 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1142 other system-wide error codes for any other errors.
1143 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1145 virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath) = 0;
1147 /** Get a content's set of attributes from a file specified by file handle. Can be used when the source file is in the client's private directory.
1149 @param aAttributeSet The set of attributes to query and update.
1150 @param aFile The file handle for the file containing the content object.
1151 @param aUniqueId The unique id of the content object.
1152 @return Whether the attribute set was updated.
1153 @return KErrNone if the attribute set was updated successfully.
1154 @return KErrNotFound if the content object was not found.
1155 @return KErrCANotSupported if the feature not supported.
1156 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1157 other system-wide error codes for any other errors.
1158 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1160 IMPORT_C virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, RFile& aFile, const TDesC& aUniqueId);
1162 /** Get text string attributes or meta-data from the file
1164 @param aAttribute The attribute to retrieve, from ContentAccess::TStringAttribute.
1165 @param aValue Used to return the value of the attribute.
1166 @param aVirtualPath The content object whose attributes are to be retrieved.
1167 @return Whether the value was updated.
1168 @return KErrNone if the attribute was retrieved successfully.
1169 @return KErrNotFound if the content object does not exist.
1170 @return KErrCANotSupported if the requested attribute does not apply to this content object.
1171 @return KErrOverflow if the buffer was not large enough to return the result.
1172 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1173 other system-wide error codes for any other errors.
1174 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1176 virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath) = 0;
1178 /** Get a content's text string attribute from a file specified by file handle. Can be used when the source file is in the client's private directory.
1180 @param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
1181 @param aValue Used to return the value of the attribute.
1182 @param aFile The file handle for the file containing the content object.
1183 @param aUniqueId The unique id of the content object whose attributes are to be retrieved.
1184 @return Whether the attribute value was updated.
1185 @return KErrNone if the attribute value was updated.
1186 @return KErrNotFound if the content object does not exist.
1187 @return KErrCANotSupported if the feature or the requested attribute is not supported for this content object.
1188 @return KErrOverflow if the buffer was not large enough to return the result.
1189 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1190 other system-wide error codes for any other errors.
1191 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1193 IMPORT_C virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, RFile& aFile, const TDesC& aUniqueId);
1195 /** Used to obtain a set of string attributes
1197 @param aStringAttributeSet The set of attributes to query and update.
1198 @param aVirtualPath The content object whose attributes are to be retrieved.
1199 @return Whether the string attribute set was updated.
1200 @return KErrNone if the attribute set was updated successfully.
1201 @return KErrNotFound if the object with the given virtual path was not found.
1202 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1203 other system-wide error codes for any other errors.
1204 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1206 virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TVirtualPathPtr& aVirtualPath) = 0;
1208 /** Get a content's set of string attributes from a file specified by file handle. Can be used when the source file is in the client's private directory.
1210 @param aStringAttributeSet The set of attributes to query and update.
1211 @param aFile The file handle for the file containing the content object.
1212 @param aUniqueId The unique id of the content object whose attributes are to be retrieved
1213 @return Whether the string attribute set was updated.
1214 @return KErrNone if the attribute set was updated successfully.
1215 @return KErrNotFound if the object with the given virtual path was not found.
1216 @return KErrCANotSupported if the feature not supported.
1217 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1218 other system-wide error codes for any other errors.
1219 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1221 IMPORT_C virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, RFile& aFile, const TDesC& aUniqueId);
1223 /** Notify the caller when the status of a DRM protected content object changes.
1224 NB: No assumption should be made about the scope of the descriptor
1225 passed to aURI for asynchronous IPC.
1227 @param aURI The location of the file.
1228 @param aMask Bitmask of events the caller is interested in.
1229 @param aStatus The TRequestStatus object to complete if the event occurs, or KErrCANotSupported if the agent does not support asynchronous notifications.
1230 @capability DRM Deleting DRM protected content is not permitted for processes without DRM capability.
1232 virtual void NotifyStatusChange(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus) = 0;
1234 /** Cancel a previous notification request
1235 @param aURI The URI supplied in the call to NotifyStatusChange().
1236 @param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
1237 @return The outcome of the cancel request.
1238 @return KErrNone if the notification was cancelled.
1239 @return KErrNotFound if there was no matching request outstanding.
1240 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1242 virtual TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus) = 0;
1245 Allows an application to request the modification of a property
1246 within the agent. The agent may or may not permit the property to be changed
1248 @param aProperty The property to set.
1249 @param aValue The value of the property.
1250 @return The outcome of the set property command.
1251 @return KErrNone if the property was set by all agents.
1252 @return KErrCANotSupported if one of the agent does not support the property or value.
1253 @return KErrAccessDenied if one of the agents does not permit the property to be changed.
1254 @return KErrPermissionDenied if the application does not have the necessary capability to change the property.
1255 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1257 virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
1259 /** View information associated with a single content object
1261 This call blocks execution and only returns once the display is dismissed
1264 @param aInfo The information to display.
1265 @param aVirtualPath The content object.
1266 @leave KErrCANotSupported if agent cannot display the requested information.
1267 @leave ... One of the other CAF error codes defined in \c caferr.h
1268 or one of the system-wide error codes
1269 for any other errors.
1270 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1272 virtual void DisplayInfoL(TDisplayInfo aInfo, const TVirtualPathPtr& aVirtualPath) = 0;
1274 /** View information associated with a single content object in a file specified by file handle. Can be used when the source file is in the client's private directory.
1276 This call blocks execution and only returns once the display is dismissed
1279 @param aInfo The information to display.
1280 @param aFile The file handle for the file containing the content object.
1281 @param aUniqueId The unique id of the content object.
1282 @leave KErrCANotSupported if the feature not supported or if agent cannot display the requested information.
1283 @leave ... One of the other CAF error codes defined in \c caferr.h
1284 or one of the system-wide error codes
1285 for any other errors.
1286 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1288 IMPORT_C virtual void DisplayInfoL(TDisplayInfo aInfo, RFile& aFile, const TDesC& aUniqueId);
1291 Identifies whether or not the file at the given URI is to be handled by
1294 The agent should perform the mimimum possible processing to make the recognition
1295 process as fast as possible. It should avoid opening the file whenever possible.
1297 The agent should leave only if a temporary or permanent condition prevents it from knowing
1298 whether it can detect the content's type.
1300 @param aURI Location of the file to be examined.
1301 @param aShareMode The share mode to use if the agent opens a file.
1302 @return ETrue if this agent supports and recognises the file, EFalse otherwise.
1304 virtual TBool IsRecognizedL(const TDesC& aURI, TContentShareMode aShareMode) const = 0;
1307 Identifies whether or not the file is handled by this agent.
1309 The agent should look at the name of the file first to try and avoid the need
1310 to read from the file.
1312 The agent should leave only if a temporary or permanent condition prevents it from knowing
1313 whether it can detect the content's type.
1315 @param aFile An open file handle.
1316 @return ETrue if this agent supports and recognises the file, EFalse otherwise.
1318 virtual TBool IsRecognizedL(RFile& aFile) const = 0;
1321 Determines whether the file is recognized by this agent.
1322 If it is the agent will fill in the file mime type and content mime
1325 The agent should attempt to recognized the file in an efficient manner
1326 It should avoid opening the file to provide the best performance.
1328 The agent should leave only if a temporary or permanent condition prevents it from
1329 detecting content's type.
1331 The agent SHOULD NOT perform any API policing on this API since it
1332 will be called from within the Apparc server's process.
1334 If a file is recognized, the file mime type should always be set to
1335 the correct value. For the content mime type there are three special cases:
1337 @li If the file needs to be imported through the Supplier API before
1338 it can be used then the agent should leave the aContentMimeType
1339 parameter blank (zero length).
1341 @li If the file has no embedded content, eg an image/jpeg (.jpg) file
1342 the agent should leave the aContentMimeType parameter blank (zero length).
1344 @li If more than one content object is contained within the file, the agent will
1345 set aContentMimeType to "application/x-caf" indicating it is an archive that can
1346 be navigated by CAF regardless of the actual file format.
1348 @param aFileName The name of the file to recognize. The name is examined, not the file itself.
1349 @param aBuffer Buffer containing bytes from the start of the file.
1350 @param aFileMimeType Used to return the mime type of the file to the caller.
1351 @param aContentMimeType Used to return the mime type of the content embedded within the file to the caller. This field should be zero length if there is no embedded content.
1352 @return Whether or not the file was recognized.
1353 @return ETrue if the file is handled by this agent. The aFileMimeType and aContentMimeType were updated.
1354 @return EFalse if the file was not recognized by this agent.
1356 virtual TBool RecognizeFileL(const TDesC& aFileName, const TDesC8& aBuffer, TDes8& aFileMimeType, TDes8& aContentMimeType) const = 0;
1359 /** Allows extended synchronous calls to the agent
1360 Objects are passed in and out using serialization
1362 @param aCommand The agent defined command.
1363 @param aInputBuffer Non modifyable input data buffer.
1364 @param aOutputBuffer Modifyable output buffer to hold the result of the command.
1365 @return The outcome of the agent specific command.
1366 @return KErrNone if the command was successful.
1367 @return KErrCANotSupported if the agent does not recognize the command.
1368 @return KErrPermissionDenied if the agent does not permit the client to execute this command.
1369 @return Otherwise one of the other CAF error codes defined in \c caferr.h
1370 or one of the other system-wide error codes
1371 for any other errors.
1372 @capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
1374 virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer) = 0;
1376 /** Allows extended asynchronous calls to the agent.
1377 Objects can be passed in and out using serialization.
1378 NB: No assumption should be made about the scope of the descriptor
1379 passed to aInputBuffer for asynchronous IPC.
1381 @param aCommand The agent defined command.
1382 @param aInputBuffer Non modifyable input data buffer.
1383 @param aOutputBuffer Modifyable output buffer to hold the result of the command.
1384 @param aStatus Asynchronous request status. On completion this will
1385 contain one of the following error codes: KErrNone if the command
1386 was successful. KErrCANotSupported if the agent does
1387 not recognize the command. KErrPermissionDenied if the
1388 agent does not permit the client to execute this command.
1389 Otherwise one of the other CAF error codes
1390 defined in \c caferr.h or one of the other
1391 system-wide error codes for any other errors.
1392 @capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
1394 virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus) = 0;
1396 /** Allow the agent to display management information for users to
1397 manage any settings or other information stored by the agent
1399 The scope of this information is left to the agent implementation but it is expected
1400 that a DRM agent will display the state of all DRM rights objects
1401 (pending, available, expired, orphaned) and allow users to delete rights
1402 that are no longer required.
1404 @leave KErrCANotSupported If the agent does support the display of management information.
1405 @capability DRM Agents implementing DRM may not display their management dialog to processes without DRM capability
1407 virtual void DisplayManagementInfoL() = 0;
1410 /** Prepare the HTTP request headers required to download files that may be
1411 required for this agent.
1413 @param aStringPool The string pool used by the HTTP session.
1414 @param aRequestHeaders The agent will add any required headers to this object.
1416 virtual void PrepareHTTPRequestHeaders(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const = 0;
1419 /** Rename a directory
1421 This function can be used to rename a directory from within the agent's
1422 private directory. Access to the agents private directory is permitted
1423 at the agents discretion.
1425 @param aOldName The existing pathname of the directory to rename.
1426 @param aNewName The new pathname of the directory.
1427 @return The outcome of the RenameDir operation.
1428 @return KErrNone if the directory was removed successfully.
1429 @return KErrAccessDenied f the agent does not allow the directory to be removed.
1430 @return KErrCANotSupported if the agent does not support directory removal.
1431 @return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
1432 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1433 other system-wide error codes for any other errors.
1434 @capability DRM Required when attempting to access an agents private directory
1436 IMPORT_C virtual TInt RenameDir(const TDesC& aOldName, const TDesC& aNewName );
1439 Make a copy of the content file (eg to removable media) belonging to this agent
1442 Access to the agents private directory is permitted at the
1445 @param aSource The handle the source file.
1446 @param aDestination The full pathname of the destination file.
1447 @return The outcome of the copy operation.
1448 @return KErrNone if the file was copied successfully.
1449 @return KErrAccessDenied if the agent does not allow the file to be copied.
1450 @return KErrCANotSupported if the agent does not support file copying.
1451 @return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
1452 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1453 other system-wide error codes for any other errors.
1454 @capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
1456 IMPORT_C virtual TInt CopyFile(RFile& aSource, const TDesC& aDestination);
1458 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1460 Identifies whether or not the WMDRM content is handled by this agent using the header
1461 data of WMDRM file or stream content.
1463 The agent should leave only if a temporary or permanent condition prevents it from knowing
1464 whether it can detect the content's type.
1466 @param aHeaderData Header data of WMDRM file or stream content.
1467 @return ETrue If this agent recognises the given content.
1469 IMPORT_C virtual TBool IsRecognizedL(const TDesC8& aHeaderData) const;
1472 Determines whether or not the WMDRM content is recognized by this agent.
1473 If it is recognized, the agent will populate the file and content mime
1476 The agent should leave only if a temporary or permanent condition prevents it from
1477 detecting content's type.
1479 @param aHeaderData Header data of WMDRM content.
1480 @param aFileMimeType Used to return the mime type of the content to the caller.
1481 @param aContentMimeType Used to return the mime type of the content embedded within the file to the caller. This field should be zero length if there is no embedded content.
1482 @return Whether or not the content was recognized.
1483 @return ETrue If the content is handled by this agent. The aFileMimeType and aContentMimeType were updated.
1484 @return EFalse If the content was not recognized by this agent.
1486 IMPORT_C virtual TBool RecognizeContentL(const TDesC8& aHeaderData, TDes8& aFileMimeType, TDes8& aContentMimeType) const;
1488 /** Get an attribute from WMDRM content.
1490 @param aHeaderData Header data of WMDRM content.
1491 @param aAttribute The attribute to retrieve from ContentAccess::TAttribute.
1492 @param aValue Used to return the value of the attribute.
1494 @return KErrNone if the attribute value was updated.
1495 @return KErrCANotSupported if the requested attribute is not supported for this content.
1496 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1497 other system-wide error codes for any other errors.
1498 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1500 IMPORT_C virtual TInt GetAttribute(const TDesC8& aHeaderData, TInt aAttribute, TInt& aValue);
1502 /** Get a set of attributes from WMDRM content.
1504 @param aHeaderData Header data of WMDRM content.
1505 @param aAttributeSet The set of attributes to query and update.
1507 @return KErrNone if the attribute set was updated successfully.
1508 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1509 other system-wide error codes for any other errors.
1510 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1512 IMPORT_C virtual TInt GetAttributeSet(const TDesC8& aHeaderData, RAttributeSet& aAttributeSet);
1515 /** Get text string attributes or meta-data from WMDRM content.
1517 @param aHeaderData Header data of WMDRM content.
1518 @param aAttribute The attribute to retrieve from ContentAccess::TStringAttribute.
1519 @param aValue Used to return the value of the attribute.
1521 @return KErrNone if the attribute was retrieved successfully.
1522 @return KErrNotFound if the content object does not exist.
1523 @return KErrCANotSupported if the requested attribute does not apply to this content object.
1524 @return KErrOverflow if the buffer was not large enough to return the result.
1525 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1526 other system-wide error codes for any other errors.
1527 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1529 IMPORT_C virtual TInt GetStringAttribute(const TDesC8& aHeaderData, TInt aAttribute, TDes& aValue);
1531 /** Used to obtain a set of string attributes from WMDRM content.
1533 @param aStringAttributeSet The set of attributes to query and update.
1534 @param aHeaderData Header data of WMDRM content.
1536 @return KErrNone if the attribute set was updated successfully.
1537 @return KErrNotFound if the object with the given virtual path was not found.
1538 @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1539 other system-wide error codes for any other errors.
1540 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1542 IMPORT_C virtual TInt GetStringAttributeSet(const TDesC8& aHeaderData, RStringAttributeSet& aStringAttributeSet);
1545 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1551 Manages and retrieves rights objects from an agent.
1556 class CAgentRightsManager : public CBase
1559 /** List all rights held by the agent
1560 @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1561 @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1562 @leave ... One of the CAF error codes defined in \c caferr.h
1563 or one of the other system-wide error codes
1564 for any other errors.
1565 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1567 virtual void ListAllRightsL(RStreamablePtrArray<CRightsInfo>& aArray) const = 0;
1569 /** List all rights associated with a particular file
1570 @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1571 @param aUri The name of the file.
1572 @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1573 @leave ... One of the CAF error codes defined in \c caferr.h
1574 or one of the other system-wide error codes
1575 for any other errors.
1576 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1578 virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, const TDesC& aUri) const = 0;
1580 /** List all rights associated with a particular content object
1581 @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1582 @param aVirtualPath The content object.
1583 @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1584 @leave ... One of the CAF error codes defined in \c caferr.h
1585 or one of the other system-wide error codes
1586 for any other errors.
1587 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1589 virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, TVirtualPathPtr& aVirtualPath) const = 0;
1591 /** List all rights associated with a particular content object in a file specified by file handle. Can be used when the source file is in the client's private directory.
1593 @param aArray The client supplied array used to store the CRightsInfo objects. The agent will add CRightsInfo objects to the supplied array.
1594 @param aFile The file handle for the file containing the content object.
1595 @param aUniqueId The unique id of the content object.
1596 @leave KErrCANotSupported if the feature not supported.
1597 @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1598 @leave ... One of the CAF error codes defined in \c caferr.h
1599 or one of the other system-wide error codes
1600 for any other errors.
1601 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1603 IMPORT_C virtual void ListRightsL(RStreamablePtrArray<CRightsInfo>& aArray, RFile& aFile, const TDesC& aUniqueId) const;
1605 /** List all content associated with a particular rights object
1606 @param aArray The client supplied array used to store the list of content objects. The agent will add CVirtualPath objects to the supplied array.
1607 @param aRightsInfo The rights object.
1608 @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1609 @leave ... One of the CAF error codes defined in \c caferr.h
1610 or one of the other system-wide error codes
1611 for any other errors.
1612 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1614 virtual void ListContentL(RStreamablePtrArray<CVirtualPath>& aArray, CRightsInfo& aRightsInfo) const = 0;
1616 /** This will be used by applications to retrieve an agent specific rights object
1617 @param aRightsInfo The rights object.
1618 @return An agent specific rights object.
1619 @leave KErrPermissionDenied If the agent does not permit the client to access rights information.
1620 @leave ... One of the CAF error codes defined in \c caferr.h
1621 or one of the other system-wide error codes
1622 for any other errors.
1623 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1625 virtual MAgentRightsBase* GetRightsDataL(const CRightsInfo& aRightsInfo) const = 0;
1627 /** Asks the DRM agent to delete a rights object
1629 The agent may display a dialog asking the user to confirm the delete. Execution
1630 will be blocked until the dialog is complete. Applications can request
1631 to disable the agents user interface using the SetProperty() command
1633 @param aRightsInfo The rights object.
1634 @return The outcome of the delete operation.
1635 @return KErrNone if the rights were deleted.
1636 @return KErrCancel if the user cancels an agent supplied confirmation dialog.
1637 @return KErrNotFound if the rights object does not exist.
1638 @return KErrPermissionDenied if the agent does not permit the client to access rights information.
1639 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1641 virtual TInt DeleteRightsObject(const CRightsInfo& aRightsInfo) = 0;
1643 /** Deletes all rights associated with a particular content object
1645 The agent may display a dialog asking the user to confirm the delete. Execution
1646 will be blocked until the dialog is complete. Applications can request
1647 to disable the agents user interface using the SetProperty() command
1649 @param aVirtualPath The path of the content object.
1650 @return The outcome of the delete operation.
1651 @return KErrNone if the rights were deleted.
1652 @return KErrNotFound if no rights objects exist for the specified content object.
1653 @return KErrCancel if the user cancels an agent supplied confirmation dialog.
1654 @return KErrPermissionDenied if the agent does not permit the client to access rights information.
1655 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1657 virtual TInt DeleteAllRightsObjects(const TVirtualPathPtr& aVirtualPath) = 0;
1659 /** Deletes all rights associated with a particular content object in a file specified by file handle. Can be used when the source file is in the client's private directory.
1661 The agent may display a dialog asking the user to confirm the delete. Execution
1662 will be blocked until the dialog is complete. Applications can request
1663 to disable the agents user interface using the SetProperty() command.
1665 @param aFile The file handle for the file containing the content object.
1666 @param aUniqueId The unique id of the content object.
1667 @return The outcome of the delete operation.
1668 @return KErrNone if the rights were deleted.
1669 @return KErrNotFound if no rights objects exist for the specified content object.
1670 @return KErrCancel if the user cancels an agent supplied confirmation dialog.
1671 @return KErrPermissionDenied if the agent does not permit the client to access rights information.
1672 @return KErrCANotSupported if the feature not supported.
1673 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
1675 IMPORT_C virtual TInt DeleteAllRightsObjects (RFile& aFile, const TDesC& aUniqueId);
1678 Allows an application to request the modification of a property
1679 within the agent. The agent may or may not permit the property to be changed
1681 @param aProperty The property to set.
1682 @param aValue The value of the property.
1683 @return KErrNone if the property was set.
1684 @return KErrCANotSupported if the agent does not support the property or value.
1685 @return KErrAccessDenied if the agent does not permit the property to be changed.
1686 @return KErrPermissionDenied if the application does not have the necessary capability to change the property.
1687 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1689 virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue) = 0;
1693 } // namespace ContentAccess
1694 #endif // __AGENTINTERFACE_H__