drmfile_p.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 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. */
  48. int read(uchar*& data);
  49. /**
  50. * @brief closes file or DRM file package
  51. *
  52. */
  53. void close();
  54. /**
  55. * @brief returns opened file or DRM file package
  56. *
  57. */
  58. int size();
  59. #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  60. qint64 size64();
  61. #endif
  62. /**
  63. * @brief obsolete, checks whether given error code belongs to CAF error code range
  64. *
  65. * @param error
  66. */
  67. static bool isDRMError(int error);
  68. private:
  69. /**
  70. * @brief function helper to 'open' method
  71. *
  72. * @param fileName
  73. */
  74. int openL(const TDesC& fileName);
  75. private:
  76. CContent *CAF_file; /**< TODO */
  77. CData *CAF_data; /**< TODO */
  78. TBool intentExecuted; /**< TODO */
  79. };
  80. #endif // DRMFILE_P_H