contentmgmt/contentaccessfwfordrm/inc/agentinterface.h
changeset 15 da2ae96f639b
parent 8 35751d3474b7
child 45 030c4fbc13d7
equal deleted inserted replaced
10:afc583cfa176 15:da2ae96f639b
    76 		 file system and use RFile::Size64(TInt64 &). If this function is not implemented, fallback to 32bit 
    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.
    77 		 DataSizeL will be provided by CAF automatically.
    78 		 
    78 		 
    79 		 @see DataSizeL(TInt &aSize)
    79 		 @see DataSizeL(TInt &aSize)
    80 		*/
    80 		*/
    81 		virtual void DataSize64L(TInt64 &aSize);
    81 		IMPORT_C virtual void DataSize64L(TInt64 &aSize);
    82 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    82 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    83 		
    83 		
    84 		/**
    84 		/**
    85 		 Allows a client to verify that the intent is supported by the
    85 		 Allows a client to verify that the intent is supported by the
    86 		 current rights for the data object. 
    86 		 current rights for the data object. 
   218 		 @param aStatus		Asynchronous request status. This parameter should have been supplied earlier to
   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,
   219 		 					an asynchronous Read call. If it has not been previously supplied to a Read call,
   220 		 					this function will not have any effect.
   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 
   221 		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   222 		*/
   222 		*/
   223 		virtual void ReadCancel(TRequestStatus& aStatus);
   223 		IMPORT_C virtual void ReadCancel(TRequestStatus& aStatus);
   224 
   224 
   225 		/**
   225 		/**
   226 		 Changes or retrieves the location of the file pointer within 
   226 		 Changes or retrieves the location of the file pointer within 
   227 		 the content object
   227 		 the content object
   228 		 
   228 		 
   263 		  file system and use RFile::Seek64(TSeek, TInt64 &). If this function is not implemented, fallback to 32bit 
   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.
   264 		  Seek will be provided by CAF automatically.
   265 		  
   265 		  
   266 		  @see Seek(TSeek aMode, TInt& aPos)
   266 		  @see Seek(TSeek aMode, TInt& aPos)
   267 		*/
   267 		*/
   268 		virtual TInt Seek64(TSeek aMode, TInt64& aPos);
   268 		IMPORT_C virtual TInt Seek64(TSeek aMode, TInt64& aPos);
   269 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   269 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   270 		
   270 		
   271 		/** 
   271 		/** 
   272 		Allows an application to request the modification of a property 
   272 		Allows an application to request the modification of a property 
   273 		within the agent handling this content. The agent may or may not
   273 		within the agent handling this content. The agent may or may not
   361 							error codes for any other errors.
   361 							error codes for any other errors.
   362 		 @return KErrNone if the async read request was successfully submitted.
   362 		 @return KErrNone if the async read request was successfully submitted.
   363 		 @return KErrCANotSupported if the agent does not support this operation.
   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 
   364 		 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
   365 		*/
   365 		*/
   366 		virtual TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
   366 		IMPORT_C virtual TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
   367 		
   367 		
   368 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   368 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   369 		/**  
   369 		/**  
   370 		 This is the 64bit version of CAgentData::Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   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
   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 
   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. 
   373 		 Read will be provided by CAF automatically. 
   374 		 
   374 		 
   375 		 @see Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   375 		 @see Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
   376 		*/
   376 		*/
   377 		virtual TInt Read64(TInt64 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
   378 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   379 
       
   380 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
       
   381 		/**
       
   382 		Decrypts the encrypted input data packet.Default implementation of this method returns KErrCANotSupported.
       
   383 		
       
   384 		@param aEncryptedInputDataPacket	Buffer descriptor containing the encrypted data packet supplied by client application. 
       
   385 		@param aDecryptedOutputDataPacket	Buffer descriptor supplied by the client application into which the decrypted data is written.
       
   386 											The length of this descriptor must be equal to or greater than the input packet.
       
   387 		@return								KErrNone if successful or KErrInsuffcientDataPacketLength, if a part of input data packet
       
   388 											is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h  or 
       
   389 		 									one of the other system-wide error.
       
   390 		@capability 						DRM Access to DRM protected content is not permitted for processes without DRM capability.
       
   391 											Access to unprotected content is unrestricted.
       
   392 		*/
       
   393 		IMPORT_C virtual TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket);
       
   394 		
       
   395 		
       
   396 		/**
       
   397 		Decrypts the encrypted input data packet asynchronously.Default implementation of this method returns KErrCANotSupported.
       
   398 	
       
   399 		@param aEncryptedInputDataPacket	Buffer descriptor containing the encrypted data packet supplied by client application. 
       
   400 		@param aDecryptedOutputDataPacket	Buffer descriptor supplied by the client application into which the decrypted data is written.
       
   401 											The length of this descriptor must be equal to or greater than the input packet.
       
   402 		@param aStatus						Asynchronous request status. On completion this will contain one of the following error codes:
       
   403 											KErrNone if the data packet was successfully decrypted or KErrInsuffcientDataPacketLength, if a part of input data packet
       
   404 											is provided for decryption.Otherwise one of the CAF error codes defined in \c caferr.h  or 
       
   405 		 									one of the other system-wide error codes.
       
   406 		@capability 						DRM Access to DRM protected content is not permitted for processes without DRM capability.
       
   407 										    Access to unprotected content is unrestricted. 
       
   408 		*/
       
   409 		IMPORT_C virtual void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus);
       
   410 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   379 		};
   411 		};
   380 
   412 
   381 	/**	Defines the agent interface allowing clients to browse the objects 
   413 	/**	Defines the agent interface allowing clients to browse the objects 
   382 	within a file
   414 	within a file
   383 
   415 
  1421 				other system-wide error codes for any other errors.
  1453 				other system-wide error codes for any other errors.
  1422   		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
  1454   		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
  1423 		*/
  1455 		*/
  1424 		IMPORT_C virtual TInt CopyFile(RFile& aSource, const TDesC& aDestination);
  1456 		IMPORT_C virtual TInt CopyFile(RFile& aSource, const TDesC& aDestination);
  1425 		
  1457 		
       
  1458 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
       
  1459 		/** 
       
  1460 		Identifies whether or not the WMDRM content is handled by this agent using the header
       
  1461 		data of WMDRM file or stream content.
       
  1462 		
       
  1463 		The agent should leave only if a temporary or permanent condition prevents it from knowing
       
  1464 		whether it can detect the content's type.
       
  1465 
       
  1466 		@param aHeaderData	Header data of WMDRM file or stream content.
       
  1467 	    @return ETrue 		If this agent recognises the given content. 
       
  1468 		*/
       
  1469 		IMPORT_C virtual TBool IsRecognizedL(const TDesC8& aHeaderData) const;
       
  1470 		
       
  1471 		/** 
       
  1472 		 Determines whether or not the WMDRM content is recognized by this agent. 
       
  1473 		 If it is recognized, the agent will populate the file and content mime 
       
  1474 		 type. 
       
  1475 		 
       
  1476 		 The agent should leave only if a temporary or permanent condition prevents it from 
       
  1477 		 detecting content's type.
       
  1478 
       
  1479 		 @param aHeaderData			Header data of WMDRM content.
       
  1480 		 @param aFileMimeType 		Used to return the mime type of the content to the caller.
       
  1481 		 @param aContentMimeType	Used to return the mime type of the content embedded within the file to the caller. This field should be zero length if there is no embedded content.
       
  1482 	     @return					Whether or not the content was recognized.
       
  1483  		 @return ETrue 				If the content is handled by this agent. The aFileMimeType and aContentMimeType were updated.
       
  1484 		 @return EFalse 			If the content was not recognized by this agent.
       
  1485 		 */
       
  1486 		IMPORT_C virtual TBool RecognizeContentL(const TDesC8& aHeaderData, TDes8& aFileMimeType, TDes8& aContentMimeType) const;
       
  1487 		
       
  1488 		/**  Get an attribute from WMDRM content.
       
  1489 	
       
  1490 		@param aHeaderData	Header data of WMDRM content.
       
  1491 		@param aAttribute	The attribute to retrieve from ContentAccess::TAttribute.
       
  1492 		@param aValue		Used to return the value of the attribute.
       
  1493 		
       
  1494 		@return				KErrNone if the attribute value was updated.
       
  1495 		@return				KErrCANotSupported if the requested attribute is not supported for this content.
       
  1496 		@return				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
  1497 							other system-wide error codes for any other errors.
       
  1498 		@capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
  1499 		*/
       
  1500 		IMPORT_C virtual TInt GetAttribute(const TDesC8& aHeaderData, TInt aAttribute, TInt& aValue);
       
  1501 		
       
  1502 		/** Get a set of attributes from WMDRM content.
       
  1503 
       
  1504 		@param aHeaderData		Header data of WMDRM content.
       
  1505 		@param aAttributeSet	The set of attributes to query and update.
       
  1506 		
       
  1507 		@return 				KErrNone if the attribute set was updated successfully.
       
  1508 		@return 				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
  1509 								other system-wide error codes for any other errors.
       
  1510 		@capability DRM 		Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
  1511 		*/
       
  1512 		IMPORT_C virtual TInt GetAttributeSet(const TDesC8& aHeaderData, RAttributeSet& aAttributeSet);
       
  1513 		
       
  1514 		
       
  1515 		/**  Get text string attributes or meta-data from WMDRM content.
       
  1516 
       
  1517 		@param aHeaderData	Header data of WMDRM content.
       
  1518 		@param aAttribute	The attribute to retrieve from ContentAccess::TStringAttribute.
       
  1519 		@param aValue		Used to return the value of the attribute.
       
  1520 		
       
  1521 		@return				KErrNone if the attribute was retrieved successfully.
       
  1522 		@return				KErrNotFound if the content object does not exist.
       
  1523 		@return				KErrCANotSupported if the requested attribute does not apply to this content object.
       
  1524 		@return				KErrOverflow if the buffer was not large enough to return the result.
       
  1525 		@return				Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
  1526 							other system-wide error codes for any other errors.
       
  1527 		@capability DRM 	Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
  1528 		*/
       
  1529 		IMPORT_C virtual TInt GetStringAttribute(const TDesC8& aHeaderData, TInt aAttribute, TDes& aValue);
       
  1530 		
       
  1531 		/** Used to obtain a set of string attributes from WMDRM content.
       
  1532 
       
  1533 		@param aStringAttributeSet	The set of attributes to query and update.
       
  1534 		@param aHeaderData			Header data of WMDRM content.
       
  1535 	
       
  1536 		@return 					KErrNone if the attribute set was updated successfully.
       
  1537 		@return 					KErrNotFound if the object with the given virtual path was not found.
       
  1538 		@return 					Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
  1539 									other system-wide error codes for any other errors.
       
  1540 		@capability DRM 			Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
  1541 		*/
       
  1542 		IMPORT_C virtual TInt GetStringAttributeSet(const TDesC8& aHeaderData, RStringAttributeSet& aStringAttributeSet);
       
  1543 
       
  1544 
       
  1545 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
       
  1546 		
  1426 		};
  1547 		};
  1427 
  1548 
  1428 		
  1549 		
  1429 	/** 
  1550 	/** 
  1430 	Manages and retrieves rights objects from an agent.
  1551 	Manages and retrieves rights objects from an agent.