iapminimal.h 894 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IAPMINIMAL_H
  2. #define IAPMINIMAL_H
  3. #include <QObject>
  4. #include <iapclient.h>
  5. class IAPminimal : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit IAPminimal(QObject *parent = 0);
  10. ~IAPminimal();
  11. Q_INVOKABLE void getProductData();
  12. Q_INVOKABLE void purchaseProduct();
  13. Q_INVOKABLE void closeIAP();
  14. signals:
  15. void productDataComplete(QString data);
  16. void productPurchaseComplete(QString data);
  17. void statusBusy();
  18. void iapClosed();
  19. private slots:
  20. void productDataReceived(int requestId, QString status, IAPClient::ProductDataHash productData);
  21. void purchaseFlowFinished( int requestId );
  22. void purchaseCompleted( int requestId, QString status, QString purchaseTicket );
  23. void stopIAP();
  24. void startIAP();
  25. private:
  26. // data
  27. IAPClient *iap_client;
  28. bool isbusy;
  29. };
  30. #endif // IAPMINIMAL_H