VMCPlugin/plugins/CC/CCInterface.h

87 lines
2.8 KiB
C
Raw Normal View History

#ifndef CCINTERFACE_H
#define CCINTERFACE_H
#include <QtPlugin>
#include <QSettings>
#include <QString>
#include "ATBAPPplugin.h"
namespace nsCCInterface {
enum class PLUGIN_STATE : quint8;
enum class RESULT_STATE : quint8;
}
class CCInterface : public ATBAPPplugin
{
Q_INTERFACES(ATBAPPplugin)
public:
virtual ~CCInterface() {}
virtual nsCCInterface::PLUGIN_STATE initCCInterfacePlugin(QObject *healthEventReceiver, const QSettings & settings) = 0;
virtual nsCCInterface::PLUGIN_STATE getState() = 0;
virtual quint32 getLastError() = 0;
virtual const QString & getLastErrorDescription() = 0;
// return a plugin description in JSON or XML
// -> ATBAPPplugin::getPluginInfo()
public slots:
virtual void requestReset() = 0;
virtual void requestStartTransaction(quint32 amount) = 0;
virtual void requestCancelTransaction() = 0;
virtual void requestRevertTransaction() = 0;
virtual void requestConfirmTransaction() = 0;
virtual void requestDayClose() = 0;
virtual void requestCardInfo() = 0;
virtual void requestPreAuthTransaction(quint32 amount) = 0;
virtual void requestCancelPreAuthTransaction(QString & receiptNumber) = 0;
virtual void requestBookTotalTransaction(quint32 amount, QString & receiptNumber) = 0;
virtual void wakeupCC() = 0;
virtual void sleepCC() = 0;
signals:
virtual void sendStartTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendCancelTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendRevertTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendConfirmTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendDayCloseResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendCardInfoResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendPreAuthTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendCancelPreAuthTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
virtual void sendBookTotalTransactionResult(nsCCInterface::RESULT_STATE resultState, QString & result) = 0;
};
Q_DECLARE_INTERFACE(CCInterface,
"eu.atb.ptu.plugin.CCInterface/2.9.1")
namespace nsCCInterface {
enum class PLUGIN_STATE : quint8 {
NOT_INITIALIZED = 0,
INITIALIZED = 1
};
enum class RESULT_STATE : quint8 {
SUCCESS = 1,
ERROR_BACKEND = 2,
ERROR_NETWORK = 3,
ERROR_TIMEOUT = 4,
ERROR_PROCESS = 5,
ERROR_BUSY = 6,
ERROR_STATE = 7,
INFO = 8
};
}
#endif // CCINTERFACE_H