New interfcaes.

This commit is contained in:
Gerhard Hoffmann 2023-12-03 19:42:12 +01:00
parent 0b090c618d
commit 2f9b1e93c8
2 changed files with 64 additions and 2 deletions

View File

@ -2,6 +2,7 @@
#define INTERFACE_H #define INTERFACE_H
#include <QtPlugin> #include <QtPlugin>
#include <QString>
@ -397,6 +398,7 @@ struct T_bna
}; };
class hwapi;
class hwinf class hwinf
{ {
@ -1834,6 +1836,9 @@ public:
virtual uint8_t prn_getPrintResult() const { virtual uint8_t prn_getPrintResult() const {
return 0; return 0;
} }
// return: 0: just printing, wait
// 1: OK - last print was succesful
// 2: error - not printed
@ -2270,9 +2275,35 @@ public:
// countOfBills[1] for 10€ and so on // countOfBills[1] for 10€ and so on
// download device controller
virtual void dcDownloadStart() {}
virtual void dcDownloadRequest(QString const &fileToDownload) {
Q_UNUSED(fileToDownload);
}
virtual bool dcDownloadRequested() const { return false; }
virtual void dcDownloadResetRequest() {}
virtual QString dcDownloadFileName() const { return ""; }
virtual void dcDownloadReportStart() {}
virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) {
Q_UNUSED(totalBlockNumber);
}
virtual void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) {
Q_UNUSED(currentBlockNumber);
}
virtual uint16_t dcDownloadGetTotalBlockNumber() const { return 0; }
virtual uint16_t dcDownloadGetCurrentBlockNumber() const { return 0; }
virtual bool dcDownloadStarted() const { return false; }
virtual bool dcDownloadRunning() const { return false; }
virtual bool dcDownloadFinished() const { return false; }
virtual hwapi *getAPI() { return nullptr; }
signals: // for download
void hwapi_reportDCDownloadStatus(QString const &) const;
void hwapi_reportDCDownloadSuccess(QString const &) const;
void hwapi_reportDCDownloadFailure(QString const &) const;
signals:
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid. // NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
void hwapi_templatePrintFinished_OK() const; void hwapi_templatePrintFinished_OK() const;
void hwapi_templatePrintFinished_Err() const; void hwapi_templatePrintFinished_Err() const;

View File

@ -2,6 +2,7 @@
#define INTERFACE_H #define INTERFACE_H
#include <QtPlugin> #include <QtPlugin>
#include <QString>
@ -397,6 +398,7 @@ struct T_bna
}; };
class hwapi;
class hwinf class hwinf
{ {
@ -1834,6 +1836,9 @@ public:
virtual uint8_t prn_getPrintResult() const { virtual uint8_t prn_getPrintResult() const {
return 0; return 0;
} }
// return: 0: just printing, wait
// 1: OK - last print was succesful
// 2: error - not printed
@ -2270,9 +2275,35 @@ public:
// countOfBills[1] for 10€ and so on // countOfBills[1] for 10€ and so on
// download device controller
virtual void dcDownloadStart() {}
virtual void dcDownloadRequest(QString const &fileToDownload) {
Q_UNUSED(fileToDownload);
}
virtual bool dcDownloadRequested() const { return false; }
virtual void dcDownloadResetRequest() {}
virtual QString dcDownloadFileName() const { return ""; }
virtual void dcDownloadReportStart() {}
virtual void dcDownloadSetTotalBlockNumber(uint16_t totalBlockNumber) {
Q_UNUSED(totalBlockNumber);
}
virtual void dcDownloadSetCurrentBlockNumber(uint16_t currentBlockNumber) {
Q_UNUSED(currentBlockNumber);
}
virtual uint16_t dcDownloadGetTotalBlockNumber() const { return 0; }
virtual uint16_t dcDownloadGetCurrentBlockNumber() const { return 0; }
virtual bool dcDownloadStarted() const { return false; }
virtual bool dcDownloadRunning() const { return false; }
virtual bool dcDownloadFinished() const { return false; }
virtual hwapi *getAPI() { return nullptr; }
signals: // for download
void hwapi_reportDCDownloadStatus(QString const &) const;
void hwapi_reportDCDownloadSuccess(QString const &) const;
void hwapi_reportDCDownloadFailure(QString const &) const;
signals:
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid. // NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
void hwapi_templatePrintFinished_OK() const; void hwapi_templatePrintFinished_OK() const;
void hwapi_templatePrintFinished_Err() const; void hwapi_templatePrintFinished_Err() const;