miniiapqtclient.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 MINIIAPQTCLIENT_H
  9. #define MINIIAPQTCLIENT_H
  10. #include <QString>
  11. #include <QObject>
  12. #include "miniiapclientapi.h"
  13. #include "iapclient.h"
  14. const char IAP_API_FAILED[] = "IAPApiFailed";
  15. class MiniIAPQtClient : public QObject, public MiniIAPClientApi
  16. {
  17. Q_OBJECT
  18. public:
  19. MiniIAPQtClient(QObject *parent = 0);
  20. ~MiniIAPQtClient();
  21. virtual void prepare();
  22. virtual bool purchaseProduct(const char * productId);
  23. virtual bool isProductPurchased(const char *productId, const char *fileName = 0);
  24. public slots:
  25. void purchaseCompleted( int requestId, QString status, QString purchaseTicket );
  26. void restorationCompleted(int requestId, QString status, QString purchaseTicket);
  27. void purchaseFlowFinished( int requestId );
  28. private:
  29. bool canReadDRM(const QString &fileName) const;
  30. void clearPurchasing();
  31. bool isPurchaseRunning;
  32. IAPClient *m_IAPClient;
  33. int m_requestId;
  34. QString m_productId;
  35. };
  36. #endif // MINIIAPQTCLIENT_H