miniiapclientapi.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 MINIIAPCLIENTAPI_H
  9. #define MINIIAPCLIENTAPI_H
  10. #include "miniiapinterface.h"
  11. class MiniIAPClientApi
  12. {
  13. public:
  14. MiniIAPClientApi();
  15. virtual ~MiniIAPClientApi();
  16. virtual void prepare();
  17. /*!
  18. \fn bool MiniIAPInterface::purchaseProduct(const char *productId)
  19. Requests that Ovi Store process a payment for an in-app purchase.
  20. The purchase is automatically transformed to a restoration.
  21. If an item is DRM-encrypted, the %IAPClient API can restore the item
  22. only if it was encrypted by Nokia.
  23. The following methods of receiver are called during execution:
  24. - purchaseCompleted() — when the Ovi Payment Experience (OPE) back-end
  25. has completed the purchase, this signal provides the purchase status and data
  26. - purchaseFlowFinished() — when the user has finished purchase flow.
  27. \param productId The ID of the product to be purchased.
  28. \return If the request fails immediately, returns false and the MiniIAPInterface receiver's
  29. methods are not called, otherwise, returns true.
  30. */
  31. virtual bool purchaseProduct(const char * productId);
  32. /*!
  33. \fn int MiniIAPInterface::isProductPurchased(const char *productId, const char *fileName = 0)
  34. \param productId The ID of the product.
  35. \param fileName The filename of a DRM protected file of the product.
  36. \return If the product is purchased, returns true, otherwise, returns false.
  37. */
  38. virtual bool isProductPurchased(const char *productId, const char *fileName = 0);
  39. MiniIAPInterface *miniIAPReceiver() const;
  40. void setMiniIAPReceiver(MiniIAPInterface *receiver);
  41. protected:
  42. MiniIAPInterface *m_miniIAPReceiver; // Not owned
  43. };
  44. #endif // MINIIAPCLIENTAPI_H