summaryrefslogtreecommitdiff
path: root/client.cxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-03-28 15:19:02 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-03-28 15:19:02 +0800
commit4681103c794fef10a0448d4378ca68ac77b6ee29 (patch)
treea7b411f744e730ded6877ec1b275a75f017b14e5 /client.cxx
parenta68fc492cf86a14cf9cf95d9f9a764cdf5b01007 (diff)
parent0728570b5a424abaad7fe49f63caa1977e016782 (diff)
Merge branch 'master' into cmake
Diffstat (limited to 'client.cxx')
-rw-r--r--client.cxx24
1 files changed, 19 insertions, 5 deletions
diff --git a/client.cxx b/client.cxx
index 7ffe780..8484387 100644
--- a/client.cxx
+++ b/client.cxx
@@ -1,5 +1,6 @@
#include <cstddef>
#include <icclient/client.h>
+#include <icclient/member.h>
#include "qicclient/client.hxx"
namespace ICClient {
@@ -21,12 +22,25 @@ namespace ICClient {
emit gotAllProducts(catalog);
}
- void Client::logIn(QString const& username, QString const& password)
+ void Client::order(icclient_ord_order** orderPtr, QString const& sku
+ , icclient_catalog* catalog)
{
- icclient_login(username.toLatin1().constData()
- , password.toLatin1().constData(), nullptr, nullptr
- , nullptr);
- emit loggedIn(username);
+ icclient_order(orderPtr, sku.toLatin1().constData(), catalog);
+ icclient_ord_order* order = *orderPtr;
+ emit ordered(order);
+ }
+
+ void Client::logIn(size_t (*handler)(void*, size_t, size_t, void*)
+ , icclient_user* user, QString const& username
+ , QString const& password, QString const& successPage
+ , QString const& nextPage, QString const& failPage)
+ {
+ icclient_login(handler, user, username.toLatin1().constData()
+ , password.toLatin1().constData()
+ , successPage.toLatin1().constData()
+ , nextPage.toLatin1().constData()
+ , failPage.toLatin1().constData());
+ emit loggedIn(user);
}
void Client::logOut()