summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-26 22:04:11 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-26 22:04:11 +0800
commit3fdde5e115af1edf084a81ead04adbca49d39e88 (patch)
tree4e777ff0354328fa136b79bd81a6037a07b17e5e
parentd614c6c8bd12c2a01ab5ef90e34f068bfb019e25 (diff)
All products related signal and slot
-rw-r--r--client.cxx9
-rw-r--r--qicclient/client.hxx9
2 files changed, 18 insertions, 0 deletions
diff --git a/client.cxx b/client.cxx
index f9cf9b2..00f0712 100644
--- a/client.cxx
+++ b/client.cxx
@@ -13,6 +13,15 @@ namespace ICClient {
icclient_cleanup();
}
+ void productAll(icclient_catalog** catalogptr
+ , size_t (*callback)(void* contents
+ , size_t size, size_t nmemb
+ , void* userdata))
+ {
+ icclient_product_all(catalogptr, callback);
+ emit gotProductAll(*catalogptr);
+ }
+
void Client::logIn(QString const& username, QString const& password)
{
icclient_login(username.toLatin1().constData()
diff --git a/qicclient/client.hxx b/qicclient/client.hxx
index 14c3652..481f9bb 100644
--- a/qicclient/client.hxx
+++ b/qicclient/client.hxx
@@ -2,6 +2,9 @@
#define QRTCLIENT_CLIENT_HXX
#include <QObject>
+#include <icclient/product.h>
+
+struct icclient_catalog;
namespace ICClient {
@@ -13,11 +16,17 @@ namespace ICClient {
Client(char const* url, char const* certificate = nullptr);
~Client();
+ void productAll(icclient_catalog** catalogptr
+ , size_t (*callback)(void* contents
+ , size_t size, size_t nmemb
+ , void* userdata));
+
public slots:
void logIn(QString const& username, QString const& password);
void logOut();
signals:
+ void gotProductAll(icclient_catalog*);
void loggedIn(QString const& username);
void loggedOut();
};