drmfile_p.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /**
  2. * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
  3. * All rights reserved.
  4. *
  5. * For the applicable distribution terms see the license.txt -file, included in
  6. * the distribution.
  7. */
  8. #ifndef DRMFILE_P_H
  9. #define DRMFILE_P_H
  10. #include <qglobal.h>
  11. #include <caf/content.h>
  12. using namespace ContentAccess;
  13. class DRMFile;
  14. /**
  15. * @class DRMFilePrivate
  16. *
  17. * @brief Content Access Framework (CAF) wrapper implementation
  18. *
  19. */
  20. class DRMFilePrivate
  21. {
  22. public:
  23. /**
  24. * @brief constructor
  25. *
  26. */
  27. explicit DRMFilePrivate();
  28. /**
  29. * @brief destructor
  30. *
  31. */
  32. virtual ~DRMFilePrivate();
  33. public:
  34. /**
  35. * @brief lets Content Access Framework to open either DRM encrypted file package or non-protected file
  36. * NOTE: Access to unprotected content is unrestricted by CAF thus regular files can
  37. * be opened and read successfully
  38. *
  39. * @param fileName
  40. */
  41. int open(const QString & fileName);
  42. /**
  43. * @brief Reads the whole data or requested length into allocated memory buffer.
  44. *
  45. * @param data - reference to pointer on allocated memory buffer.
  46. * It is client's responcibility to release allocated memory
  47. * @param length - requested data length to read, if it is equal to '0' it will read the whole file
  48. */
  49. int read(uchar*& data, int length = 0);
  50. /**
  51. * @brief closes file or DRM file package
  52. *
  53. */
  54. void close();
  55. /**
  56. * @brief returns opened file or DRM file package
  57. *
  58. */
  59. int size();
  60. #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  61. qint64 size64();
  62. #endif
  63. /**
  64. * @brief obsolete, checks whether given error code belongs to CAF error code range
  65. *
  66. * @param error
  67. */
  68. bool isDRMError(int error);
  69. private:
  70. /**
  71. * @brief function helper to 'open' method
  72. *
  73. * @param fileName
  74. */
  75. int openL(const TDesC& fileName);
  76. private:
  77. CContent *CAF_file; /**< TODO */
  78. CData *CAF_data; /**< TODO */
  79. TBool intentExecuted; /**< TODO */
  80. };
  81. #endif // DRMFILE_P_H