| 1 | /**************************************************************************** |
|---|---|
| 2 | ** |
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the Purchasing module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL3-COMM$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at http://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPLv3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl.html. |
| 24 | ** |
| 25 | ** $QT_END_LICENSE$ |
| 26 | ** |
| 27 | ****************************************************************************/ |
| 28 | |
| 29 | #ifndef QINAPPSTORE_H |
| 30 | #define QINAPPSTORE_H |
| 31 | |
| 32 | #include <QtCore/qobject.h> |
| 33 | #include <QtPurchasing/qtpurchasingglobal.h> |
| 34 | #include <QtPurchasing/qinappproduct.h> |
| 35 | |
| 36 | QT_BEGIN_NAMESPACE |
| 37 | |
| 38 | class QInAppStorePrivate; |
| 39 | class QInAppProduct; |
| 40 | class QInAppTransaction; |
| 41 | class Q_PURCHASING_EXPORT QInAppStore: public QObject |
| 42 | { |
| 43 | Q_OBJECT |
| 44 | public: |
| 45 | explicit QInAppStore(QObject *parent = nullptr); |
| 46 | ~QInAppStore(); |
| 47 | |
| 48 | Q_INVOKABLE void restorePurchases(); |
| 49 | Q_INVOKABLE void registerProduct(QInAppProduct::ProductType productType, const QString &identifier); |
| 50 | Q_INVOKABLE QInAppProduct *registeredProduct(const QString &identifier) const; |
| 51 | Q_INVOKABLE void setPlatformProperty(const QString &propertyName, const QString &value); |
| 52 | |
| 53 | Q_SIGNALS: |
| 54 | void productRegistered(QInAppProduct *product); |
| 55 | void productUnknown(QInAppProduct::ProductType productType, const QString &identifier); |
| 56 | void transactionReady(QInAppTransaction *transaction); |
| 57 | |
| 58 | private Q_SLOTS: |
| 59 | void registerPendingProducts(); |
| 60 | void registerProduct(QInAppProduct *); |
| 61 | |
| 62 | private: |
| 63 | void setupBackend(); |
| 64 | |
| 65 | Q_DISABLE_COPY(QInAppStore) |
| 66 | QSharedPointer<QInAppStorePrivate> d; |
| 67 | }; |
| 68 | |
| 69 | QT_END_NAMESPACE |
| 70 | |
| 71 | #endif // QINAPPSTORE_H |
| 72 |
