From dd94e52d98aa29e0273176e038864c13fbd4aa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Mon, 29 Jun 2020 21:19:58 +0800 Subject: Reorder results and flyPage parameters Remove cURL handler parameter variables, and copy documentation from libicclient. --- qicclient/client.hxx | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'qicclient/client.hxx') diff --git a/qicclient/client.hxx b/qicclient/client.hxx index 056b3f8..d05d101 100644 --- a/qicclient/client.hxx +++ b/qicclient/client.hxx @@ -17,22 +17,45 @@ namespace ICClient { Q_OBJECT public: + /*! + * \brief Constructor. + * \param url Server root URL. + * \param certificate Path to the CA certificate file. + */ Client(char const* url, char const* certificate = nullptr); ~Client(); - void results(size_t (*handler)(void* contents, - size_t size, size_t nmemb, - void* userdata), - QString const& prodGroup); - void allProducts(size_t (*handler)(void* contents, - size_t size, size_t nmemb, - void* userdata)); - void flyPage(size_t (*handler)(void* contents, - size_t size, size_t nmemb, - void* userdata), - QString const& sku); + /*! + * \brief For fetching products that belong a specific group. + * \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*)); + + /*! + * \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*)); + + /*! + * \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*)); + + /*! + * \brief For putting an item to a cart. + * \param sku The SKU of the item to order. + * \param catalog The catalog from which the item is. + * \param order The order. + */ void order(QString const& sku, Catalog const& catalog, Basket& order); + void logIn(size_t (*handler)(void*, size_t, size_t, void*), icclient_user* user, QString const& username, -- cgit v1.2.3