summaryrefslogtreecommitdiff
path: root/client.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'client.cxx')
-rw-r--r--client.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/client.cxx b/client.cxx
index edb1c84..ff28eaa 100644
--- a/client.cxx
+++ b/client.cxx
@@ -1,10 +1,12 @@
#include <cstddef>
#include <memory>
#include <QObject>
+#include <icclient/typedefs.h>
#include <icclient/client.h>
-#include <icclient/member.h>
#include "qicclient/catalog.hxx"
+#ifndef __EMSCRIPTEN__
#include "qicclient/ord.hxx"
+#endif
#include "qicclient/client.hxx"
namespace QICClient {
@@ -19,29 +21,28 @@ namespace QICClient {
icclient_cleanup();
}
- void Client::results(QString const& prodGroup,
- size_t (*handler)(void*, size_t, size_t, void*))
+ void Client::results(QString const& prodGroup, icclient_handler handler)
{
icclient_catalog* catalog = nullptr;
icclient_results(prodGroup.toLatin1().constData(), handler, &catalog);
if (catalog) emit gotResults(new Catalog{catalog});
}
- void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*))
+ void Client::allProducts(icclient_handler handler)
{
icclient_catalog* catalog = nullptr;
icclient_allproducts(handler, &catalog);
if (catalog) emit gotResults(new Catalog{catalog});
}
- void Client::flyPage(QString const& sku,
- size_t (*handler)(void*, size_t, size_t, void*))
+ void Client::flyPage(QString const& sku,icclient_handler handler)
{
icclient_product* product = nullptr;
icclient_flypage(sku.toLatin1().constData(), handler, &product);
if (product) emit gotFlyPage(shared_ptr<Product>{new Product{product}});
}
+#ifndef __EMSCRIPTEN__
void Client::order(QString const& sku, Catalog const& catalog, Ord& order)
{
auto c_order = order.data();
@@ -49,5 +50,6 @@ namespace QICClient {
&c_order);
order.setData(c_order);
}
+#endif
}