From 18508ea004a66cc30c42c43d14afdc16b2267666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 25 Sep 2022 10:55:36 +0800 Subject: Rename project to qinterchange --- interchange.hxx | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 interchange.hxx (limited to 'interchange.hxx') diff --git a/interchange.hxx b/interchange.hxx new file mode 100644 index 0000000..e25a32c --- /dev/null +++ b/interchange.hxx @@ -0,0 +1,78 @@ +#ifndef INTERCHANGE_HXX +#define INTERCHANGE_HXX + +#include +#include "interchange/catalog.hxx" + +namespace Interchange { + + class Ord; + + class Interchange : public QObject + { + Q_OBJECT + + public: + /*! + * \brief Constructor. + * \param sampleURL The value of the SAMPLEURL setting in products/variable.txt. + * \param image_Dir The value of the IMAGE_DIR setting in products/variable.txt. + * \param certificate Path to the CA certificate file. + */ + Interchange(char const* sampleURL, char const* image_Dir, char const* certificate = nullptr); + /*! + * \brief Destructor. + */ + ~Interchange(); + /*! + * \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, Ord& order); + + public slots: + /*! + * \brief For fetching products that belong a specific group. + * \param prodGroup The name of the product group. + */ + void catalog(QString const& prodGroup); + /*! + * \brief For fetching data about all active products. + */ + void allProducts(); + /*! + * \brief For fetching data about a specific product. + * \param sku The SKU of the item to order. + */ + void product(QString const& sku); + /*! + * \brief For fetching data from a specific path. + * \param path The path. + */ + void page(QString const& path); + /*! + * \brief For fetching products that belong a specific group. + * \param prodGroup The name of the product group. + */ + void defaultCatalog(QString const& prodGroup); + /*! + * \brief For fetching data about all active products. + */ + void defaultAllProducts(); + + signals: + void gotCatalog(QString const& response); + void gotProduct(QString const& response); + void gotPage(QString const& response); + + protected: + void emitCatalog(QString const& response); + void emitProduct(QString const& response); + void emitPage(QString const& response); + }; + +} + +#endif -- cgit v1.2.3