diff -r f18401adf8e1 -r 641f389e9157 contentmgmt/contentaccessfwfordrm/inc/data.h --- a/contentmgmt/contentaccessfwfordrm/inc/data.h Thu Aug 19 11:38:48 2010 +0300 +++ b/contentmgmt/contentaccessfwfordrm/inc/data.h Tue Aug 31 17:00:08 2010 +0300 @@ -273,6 +273,74 @@ */ static CData* NewLC(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId, TIntent aIntent); +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT + + /** + Creates a new CData object. + @param aHeaderData Header data of WMDRM file/stream content. + @return CData object. + @leave One of the CAF error codes defined in caferr.h or one of the + system-wide error for any other errors. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + */ + + IMPORT_C static CData* NewL(const TDesC8& aHeaderData); + + /** + Creates a new CData object. + @param aHeaderData Header data of WMDRM file/stream content. + @param aIntent The intended use of the content. + @return CData object. + @leave One of the CAF error codes defined in caferr.h or one of the + system-wide error for any other errors. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + */ + + IMPORT_C static CData* NewL(const TDesC8& aHeaderData, TIntent aIntent); + + /** + Creates a new CData object. + @param aHeaderData Header data of WMDRM file/stream content. + @return CData object. + @leave One of the CAF error codes defined in caferr.h or one of the + system-wide error for any other errors. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + */ + + IMPORT_C static CData* NewLC(const TDesC8& aHeaderData); + + /** + Creates a new CData object. + @param aHeaderData Header data of WMDRM file/stream content. + @param aIntent The intended use of the content. + @return CData object. + @leave One of the CAF error codes defined in caferr.h or one of the + system-wide error for any other errors. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + */ + + IMPORT_C static CData* NewLC(const TDesC8& aHeaderData, TIntent aIntent); + + /** + Creates a new CData object. + @param aAgentUid UID of an agent which supports this content. + @param aHeaderData Header data of WMDRM file/stream content. + @param aIntent The intended use of the content. + @return CData object. + @leave One of the CAF error codes defined in caferr.h or one of the + system-wide error for any other errors. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + + */ + + static CData* NewLC(TUid aAgentUid, const TDesC8& aHeaderData, TIntent aIntent); + +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT /** destructor */ virtual ~CData(); @@ -741,6 +809,37 @@ IMPORT_C TBool GetMimeTypeL(TDes8& aMimeType) const; #endif // REMOVE_CAF1 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT + /** + Decrypts the encrypted input data packet. + + @param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application. + @param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written. + The length of this descriptor must be equal to or greater than the input packet. + @return KErrNone if successful.KErrInsufficientDataPacketLength if a part of input packet is provided, + otherwise one of the CAF error codes defined in \c caferr.h or + one of the other system-wide error codes. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + */ + + IMPORT_C TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket) const; + + /** + Decrypts the encrypted input data packet asynchronously. + @param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application. + @param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written. + The length of this descriptor must be equal to or greater than the input packet. + @param aStatus Asynchronous request status. On completion this will contain one of the following error codes: + KErrNone if the data packet was successfully decrypted.KErrInsufficientDataPacketLength if a + part of input packet is provided, otherwise one of the CAF error codes defined in \c caferr.h or + one of the other system-wide error codes. + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. + Access to unprotected content is unrestricted. + */ + IMPORT_C void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus) const; + +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT private: CData(); @@ -754,6 +853,15 @@ void ConstructL(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId); void ConstructL(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode); +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT + + void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData, TIntent aIntent); + void ConstructL(const TDesC8& aHeaderData); + void ConstructL(const TDesC8& aHeaderData, TIntent aIntent); + void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData); + +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT + #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API /* * This is the obselete 32bit Read and replaced by its 64bit counterpart