summaryrefslogtreecommitdiff
path: root/qicclient/client.hxx
blob: 47f25fbe0b8a413100b1d22cffce869680953efa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef QICCLIENT_CLIENT_HXX
#define QICCLIENT_CLIENT_HXX

#include <QObject>

struct icclient_catalog;
struct icclient_ord_order;

namespace ICClient {

	class Client : public QObject
	{
		Q_OBJECT

		public:
			Client(char const* url, char const* certificate = nullptr);
			~Client();

			void allProducts(size_t (*handler)(void* contents
						, size_t size, size_t nmemb
						, void* userdata));
			void order(icclient_ord_order** orderPtr, QString const& sku
					, icclient_catalog* catalog);
			void logIn(QString const& username
					, QString const& password
					, QString const& successPage = nullptr
					, QString const& nextPage = nullptr
					, QString const& failPage = nullptr);

		public slots:
			/*
			void remove(unsigned int const& indices);
			void checkout();
			*/
		/*
			void account(QString const& firstName
					, QString const& lastName
					, QString const& address1
					, QString const& address2
					, QString const& city
					, QString const& state
					, QString const& zip
					, QString const& email
					, QString const& phoneDay);
			void changePassword(QString const& passwordOld
					, QString const& password
					, QString const& verify);
					*/
			void logOut();
			/*
			void newItem(QString const& description
					, QString const& comment,
					QString const& price
					, QString const& imagePath);
					*/

		signals:
			void gotAllProducts(icclient_catalog* catalog);
			void ordered(icclient_ord_order* order);
			void loggedIn(QString const& userName);
			void loggedOut();
	};

}

#endif // QICCLIENT_CLIENT_HXX