#ifndef TICKET_H #define TICKET_H #include #include #include "../DeviceControllerInterface.h" using namespace nsDeviceControllerInterface; QDebug operator<<(QDebug debug, TICKET_VARIANT ticketVariant); class Ticket : public QObject { Q_OBJECT public: Ticket(TICKET_VARIANT ticketVariant, QObject *parent = nullptr); bool initNew(TICKET_VARIANT ticketVariant, const QList & templateList, const QHash & printingData); void clear(); TICKET_VARIANT variant(); QList * templateList(); /** * @brief getPrintingData - generic getter for printingData * Used mainly for simple tickets (single tickets e.g. ParkingTicket) * @return */ QHash & getPrintingData(); /** * @brief hasTemplateDynData * @return true, if ticket has dynamic data for each template. * * This depends on TICKET_VARIANT and printingData */ bool hasTemplateDynData(); /** * @brief getDyn1List * contains dynamic template data * The size of the lists must be exactly the same as the number of templates. */ QStringList getDyn1List(); QStringList getDyn2List(); quint8 getCurrentProcessedTemplateNumber(); /** * Mark current template as processed */ void setCurrentTemplateProcessed(); // error handling QString getErrorCode(); QString getErrorDescription(); private: TICKET_VARIANT ticketVariant; // printingData from application QHash printingData; // templateList, from .ini or created by ticketVariant... QList _templateList; bool _hasTemplateDynData; quint8 currentProcessedTemplateNumber; QStringList dyn1List; QStringList dyn2List; // error handling QString errorCode; QString errorDescription; }; #endif // TICKET_H