1 /* |
1 /* |
2 * Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
373 this function will not have any effect. |
373 this function will not have any effect. |
374 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
374 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
375 */ |
375 */ |
376 IMPORT_C void ReadCancel(TRequestStatus &aStatus) const; |
376 IMPORT_C void ReadCancel(TRequestStatus &aStatus) const; |
377 |
377 |
|
378 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
378 /** |
379 /** |
379 Reads content asynchronously. The data is read from a specified offset |
380 Reads content asynchronously. The data is read from a specified offset |
380 up to a specified number of bytes or until the end of the content object |
381 up to a specified number of bytes or until the end of the content object |
381 is reached. The data is read into the descriptor buffer supplied. |
382 is reached. The data is read into the descriptor buffer supplied. |
382 NB: It is important that the descriptor passed to |
383 NB: It is important that the descriptor passed to |
383 aDes remains in scope until the request has completed. |
384 aDes remains in scope until the request has completed. |
384 |
385 If agent does not support 64bit, fallback to 32bit Read is provided automatically by CAF |
|
386 |
385 @see Read(TDes8& aDes) |
387 @see Read(TDes8& aDes) |
386 |
388 |
387 @param aPos Position of first byte to be read. |
389 @param aPos Position of first byte to be read. |
388 This is an offset from the start of the file. |
390 This is an offset from the start of the file. |
389 @param aDes Descriptor into which binary data is read. Any |
391 @param aDes Descriptor into which binary data is read. Any |
390 existing contents are overwritten. On return, |
392 existing contents are overwritten. On return, |
391 its length is set to the number of bytes read. |
393 its length is set to the number of bytes read. |
392 @param aLength The number of bytes to read from the file, |
394 @param aLength The number of bytes to read from the file, |
393 or to the end of the file, whichever is encountered first. |
395 or to the end of the file, whichever is encountered first. |
399 error codes for any other errors. |
401 error codes for any other errors. |
400 @return KErrNone if the async read request was successfully submitted. |
402 @return KErrNone if the async read request was successfully submitted. |
401 @return KErrArgument if a negative offset is supplied. |
403 @return KErrArgument if a negative offset is supplied. |
402 @return KErrCANotSupported if the agent does not support this operation. |
404 @return KErrCANotSupported if the agent does not support this operation. |
403 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
405 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
404 */ |
406 */ |
|
407 IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const; |
|
408 #else |
|
409 /** |
|
410 Reads content asynchronously. The data is read from a specified offset |
|
411 up to a specified number of bytes or until the end of the content object |
|
412 is reached. The data is read into the descriptor buffer supplied. |
|
413 |
|
414 @see Read(TDes8& aDes) |
|
415 |
|
416 @param aPos Position of first byte to be read. |
|
417 This is an offset from the start of the file. |
|
418 @param aDes Descriptor into which binary data is read. Any |
|
419 existing contents are overwritten. On return, |
|
420 its length is set to the number of bytes read. |
|
421 @param aLength The number of bytes to read from the file, |
|
422 or to the end of the file, whichever is encountered first. |
|
423 The length of the buffer is set to the number of bytes actually read. |
|
424 @param aStatus Asynchronous request status. On completion this will contain one |
|
425 of the following error codes: KErrNone if the data was |
|
426 successfully read. Otherwise one of the CAF error codes defined in |
|
427 \c caferr.h or one of the other standard system-wide |
|
428 error codes for any other errors. |
|
429 @return KErrNone if the async read request was successfully submitted. |
|
430 @return KErrArgument if a negative offset is supplied. |
|
431 @return KErrCANotSupported if the agent does not support this operation. |
|
432 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
|
433 */ |
405 IMPORT_C TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const; |
434 IMPORT_C TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const; |
406 |
435 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
436 |
407 /** |
437 /** |
408 Gets the data size in bytes. |
438 Gets the data size in bytes. |
409 |
439 |
410 @param aSize On return this will contain the size of the plaintext data in bytes. |
440 @param aSize On return this will contain the size of the plaintext data in bytes. |
411 @leave KErrCASizeNotDetermined Size could not be determined by the managing agent. |
441 @leave KErrCASizeNotDetermined Size could not be determined by the managing agent. |
413 system-wide error codes for any other errors. |
443 system-wide error codes for any other errors. |
414 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
444 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
415 */ |
445 */ |
416 IMPORT_C void DataSizeL(TInt& aSize); |
446 IMPORT_C void DataSizeL(TInt& aSize); |
417 |
447 |
|
448 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
449 /** |
|
450 This is the 64bit version of CData::DataSizeL |
|
451 Client can call this function instead of CData::DataSizeL. If it's not implemented by the agent, |
|
452 fallback to 32bit counterpart will be provided automatically |
|
453 |
|
454 @see DataSizeL(TInt& aSize) |
|
455 */ |
|
456 IMPORT_C void DataSize64L(TInt64& aSize); |
|
457 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
458 |
418 /** |
459 /** |
419 Changes or retrieves the location of the file pointer within |
460 Changes or retrieves the location of the file pointer within |
420 the content object. |
461 the content object. |
421 |
462 |
422 NOTE: Some operations may fail if the content data is sourced over a network connection. |
463 NOTE: Some operations may fail if the content data is sourced over a network connection. |
450 of the other system-wide error codes. |
491 of the other system-wide error codes. |
451 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
492 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
452 */ |
493 */ |
453 IMPORT_C TInt Seek(TSeek aMode,TInt& aPos) const; |
494 IMPORT_C TInt Seek(TSeek aMode,TInt& aPos) const; |
454 |
495 |
|
496 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
497 /** |
|
498 This is the 64bit version of CData::Seek |
|
499 Client can call this function instead of CData::Seek. If it's not implemented by the agent, |
|
500 fallback to 32bit counterpart will be provided automatically |
|
501 |
|
502 @see Seek(TSeek aMode,TInt& aPos) |
|
503 */ |
|
504 IMPORT_C TInt Seek64(TSeek aMode,TInt64& aPos) const; |
|
505 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
455 |
506 |
456 /** Request the agent handling this content to set a property value. If the property is set |
507 /** Request the agent handling this content to set a property value. If the property is set |
457 it is only set for this CData session and does not impact other CAF users. |
508 it is only set for this CData session and does not impact other CAF users. |
458 |
509 |
459 For example setting the buffer-size to 256 bytes can be achieved as follows: |
510 For example setting the buffer-size to 256 bytes can be achieved as follows: |
676 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the |
727 @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the |
677 other system-wide error codes for any other errors. |
728 other system-wide error codes for any other errors. |
678 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
729 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
679 */ |
730 */ |
680 IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet) const; |
731 IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet) const; |
681 |
732 |
|
733 |
682 #ifndef REMOVE_CAF1 |
734 #ifndef REMOVE_CAF1 |
683 /** Set Qos attribute |
735 /** Set Qos attribute |
684 @param aQosAttr The Qos attribute to set. |
736 @param aQosAttr The Qos attribute to set. |
685 @param aValue The value of the attribute. |
737 @param aValue The value of the attribute. |
686 @deprecated |
738 @deprecated |
706 void ConstructL(RFile& aFile, const TDesC& aUniqueId); |
758 void ConstructL(RFile& aFile, const TDesC& aUniqueId); |
707 void ConstructL(const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode); |
759 void ConstructL(const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode); |
708 void ConstructL(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId); |
760 void ConstructL(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId); |
709 void ConstructL(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode); |
761 void ConstructL(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode); |
710 |
762 |
|
763 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
764 /* |
|
765 * This is the obselete 32bit Read and replaced by its 64bit counterpart |
|
766 * TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const |
|
767 * However, this function still exits at its original ordinal to avoid BC break. |
|
768 * Upgrade to 64bit Read is done automatically upon recompling the client code which uses CAF interfaces |
|
769 */ |
|
770 IMPORT_C TInt Read_Unused(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const; |
|
771 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
711 |
772 |
712 private: |
773 private: |
713 // The agent handling this content |
774 // The agent handling this content |
714 CAgentData* iAgentData; |
775 CAgentData* iAgentData; |
715 |
776 |