56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
#ifndef DC_RESULT_H_INCLUDED
|
|
#define DC_RESULT_H_INCLUDED
|
|
|
|
|
|
#include <QMetaType>
|
|
#include <QString>
|
|
#include <QDebug>
|
|
|
|
class DCResult {
|
|
public:
|
|
enum class PLUGIN_STATE : quint8 {
|
|
NOT_INITIALIZED = 0,
|
|
INITIALIZED = 1
|
|
};
|
|
|
|
enum class RESULT_STATE : quint8 {
|
|
SUCCESS = 1, // operation was successfull
|
|
ERROR_BACKEND, // error from backend (e.g. backend replies with error)
|
|
ERROR_TIMEOUT, // the operation timed out
|
|
ERROR_PROCESS, // internal plugin error, should not occur (this is a bug in implementation)
|
|
ERROR_RETRY, // retry operation
|
|
INFO // informational (e.g. display a message, log something etc.)
|
|
};
|
|
|
|
enum class CASH_STATE : quint8 {
|
|
CACHE_EMPTY, // Cache still empty, default state
|
|
CACHE_INPUT, // Coins are in Cache
|
|
OVERPAYED,
|
|
NOT_AVAILABLE
|
|
/* t.b.d. */
|
|
};
|
|
|
|
explicit DCResult();
|
|
explicit DCResult(PLUGIN_STATE, RESULT_STATE, QString errorCode = "",
|
|
QString errorDescription = "",
|
|
QString cashValue = "");
|
|
explicit DCResult(PLUGIN_STATE, RESULT_STATE, CASH_STATE,
|
|
QString errorCode = "",
|
|
QString errorDescription = "",
|
|
QString cashValue = "");
|
|
|
|
PLUGIN_STATE m_pluginState;
|
|
RESULT_STATE m_resultState;
|
|
CASH_STATE m_cashState;
|
|
|
|
QString m_errorCode;
|
|
QString m_errorDescription;
|
|
QString m_newCashValue;
|
|
};
|
|
|
|
QDebug operator<<(QDebug d, DCResult const &result);
|
|
|
|
Q_DECLARE_METATYPE(DCResult)
|
|
|
|
#endif // DC_RESULT_H_INCLUDED
|