From a1e538564d4b2a60be70a32ec39afdba249ce37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 9 Jun 2021 19:55:28 +0800 Subject: Add support for Emscripten --- qicclient/admin.hxx | 4 ++-- qicclient/client.hxx | 15 +++++++++------ qicclient/member.hxx | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'qicclient') diff --git a/qicclient/admin.hxx b/qicclient/admin.hxx index f19f167..c123a2d 100644 --- a/qicclient/admin.hxx +++ b/qicclient/admin.hxx @@ -2,6 +2,7 @@ #define QICCLIENT_ADMIN_HXX #include +#include #include struct icclient_admin; @@ -31,8 +32,7 @@ namespace QICClient { QString const& successPage = nullptr, QString const& nextPage = nullptr, QString const& failPage = nullptr, - size_t (*handler)(void*, size_t, size_t, - void*) = nullptr); + icclient_handler handler = nullptr); QString const& userName() const { return m_userName; } QString const& password() const { return m_password; } diff --git a/qicclient/client.hxx b/qicclient/client.hxx index 488a093..dfe1888 100644 --- a/qicclient/client.hxx +++ b/qicclient/client.hxx @@ -2,12 +2,15 @@ #define QICCLIENT_CLIENT_HXX #include +#include namespace QICClient { using std::shared_ptr; class Catalog; +#ifndef __EMSCRIPTEN__ class Ord; +#endif class Client : public QObject { @@ -27,23 +30,22 @@ namespace QICClient { * \param prodGroup The name of the product group. * \param handler A pointer to a cURL write function callback. */ - void results(QString const& prodGroup, - size_t (*handler)(void*, size_t, size_t, void*)); + void results(QString const& prodGroup, icclient_handler handler); /*! * \brief For fetching data about all active products. * \param handler A pointer to a cURL write function callback. */ - void allProducts(size_t (*handler)(void*, size_t, size_t, void*)); + void allProducts(icclient_handler handler); /*! * \brief For fetching data about a specific product. * \param sku The SKU of the item to order. * \param handler A pointer to a cURL write function callback. */ - void flyPage(QString const& sku, - size_t (*handler)(void*, size_t, size_t, void*)); + void flyPage(QString const& sku, icclient_handler handler); +#ifndef __EMSCRIPTEN__ /*! * \brief For putting an item to a cart. * \param sku The SKU of the item to order. @@ -51,6 +53,7 @@ namespace QICClient { * \param order The order. */ void order(QString const& sku, Catalog const& catalog, Ord& order); +#endif signals: void gotResults(Catalog* catalog); @@ -59,4 +62,4 @@ namespace QICClient { } -#endif // QICCLIENT_CLIENT_HXX +#endif diff --git a/qicclient/member.hxx b/qicclient/member.hxx index fc3c77e..4e8010f 100644 --- a/qicclient/member.hxx +++ b/qicclient/member.hxx @@ -2,6 +2,7 @@ #define QICCLIENT_MEMBER_HXX #include +#include #include struct icclient_member; @@ -61,8 +62,7 @@ namespace QICClient { QString const& successPage = nullptr, QString const& nextPage = nullptr, QString const& failPage = nullptr, - size_t (*handler)(void*, size_t, size_t, - void*) = nullptr); + icclient_handler handler = nullptr); QString const& userName() const { return m_userName; } QString const& userNick() const { return m_userNick; } -- cgit v1.2.3