product.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. #ifndef PRODUCT_H
  5. #define PRODUCT_H
  6. #include <QObject>
  7. #include <QString>
  8. #include <iapclient.h>
  9. class Product : public QObject
  10. {
  11. Q_OBJECT
  12. Q_PROPERTY(QString id READ id WRITE setId)
  13. Q_PROPERTY(QString title READ title WRITE setTitle)
  14. Q_PROPERTY(QString price READ price WRITE setPrice)
  15. Q_PROPERTY(QString url READ url WRITE setUrl)
  16. Q_PROPERTY(QString thumbnail READ thumbnail WRITE setThumbnail)
  17. Q_PROPERTY(int reqId READ reqId WRITE setReqId)
  18. public:
  19. explicit Product(QObject *parent = 0);
  20. ~Product();
  21. public: // Property getters and setters
  22. QString id() const;
  23. void setId(const QString s);
  24. QString title() const;
  25. void setTitle(const QString s);
  26. QString price() const;
  27. void setPrice(const QString s);
  28. QString url() const;
  29. void setUrl(const QString s);
  30. QString thumbnail() const;
  31. void setThumbnail(const QString s);
  32. int reqId() const;
  33. void setReqId(const int i);
  34. public:
  35. void setProductData(const IAPClient::ProductData data);
  36. void setProductData(const IAPClient::ProductDataHash dataHash);
  37. bool equals(const Product *data);
  38. private: // Data
  39. QString m_productId;
  40. QString m_title;
  41. QString m_price;
  42. QString m_thumbnail;
  43. QString m_url;
  44. int m_reqId;
  45. };
  46. #endif // PRODUCT_H