FaceAccess/Linguist/recoUi/recoUiHealthCode.h
2024-07-11 11:27:12 +08:00

115 lines
5.7 KiB
C++

#ifndef RECOUIHEALTHCODE_H
#define RECOUIHEALTHCODE_H
#include "UiTools.h"
#include "UiConfig.h"
class recoUiHealthCodePage : public QWidget
{
Q_OBJECT
public:
#if 0
static const int PERSON_NAME_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY];
static const int WEL_MSG_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY];
static const int PASSWORD_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY];
static const int NUM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY];
static const int CONFIRM_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY];
static const QString PWD_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const QString CONFIRM_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const QString CONFIRM_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const int CONFIRM_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const int CONFIRM_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const QString BACK_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const int BACK_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const int BACK_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const QString DEL_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const int DEL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const int DEL_BTN_H[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
static const QString NUM_BTN[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
#endif
static const int PIC_WIDGET_H_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
explicit recoUiHealthCodePage(int type, QWidget *parent = nullptr);
void showTemp(float temp);
void showPersonMsg(const QString& name, const QString& idNum, const unsigned char* jpgDate, int len);
void showAntibodyTestingMsg(int num, const QString& testingTime);
void showCovid19TestingMsg(int res, const QString& testingTime);
void showAntiGenTestingMsg(int res, const QString& testingTime);
void showTripMsg(int res, const QString& tripCity);
void showAccResult(bool pass, const QString& failReason, int bgColor);
void setResultShowType(int type);
//void setBgColorByResult(int codeColor, int c19t, int trip, bool pass);
signals:
public slots:
private:
QLabel* m_labelTitle;
QLabel* m_labelCurTime;
QLabel* m_labelTempTip;
QLabel* m_labelTemp;
QWidget* m_labelFacePic;
QLabel* m_labelName;
QLabel* m_labelIdNo;
QLabel* m_labelABTTitle;
QLabel* m_labelABTRes;
QLabel* m_labelABTTime;
QLabel* m_labelC19T;
QLabel* m_labelC19TTitle;
RoundedWidget* m_covid19Testing;
QStackedWidget* m_stackC19T;
QLabel* m_labelC19TTime;
QLabel* m_labelAccRes;
QLabel* m_labelTripRes;
QLabel* m_labelTripResTime;
QLabel* m_labelAcc;
QLabel* m_failReason;
};
class recoUiHealthCode : public WidgetWithBackstageInterface
{
Q_OBJECT
public:
explicit recoUiHealthCode(QWidget *parent = nullptr);
void showHealthMsg(int type, float temp, const QString& msg, bool pass,
const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void setResultShowType(int type);
signals:
public slots:
private:
QStackedWidget* m_stackPages;
recoUiHealthCodePage* m_pageGreen;
recoUiHealthCodePage* m_pageYellow;
recoUiHealthCodePage* m_pageRed;
recoUiHealthCodePage* m_pageGrey;
int m_resultType = 0;
void _showType0HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType1HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType2HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType3HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType4HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType5HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showTypexHealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType101HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType6HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType7HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType8HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
void _showType9HealthData(float temp, const QString& msg, bool pass, const unsigned char* jpgDate, int jpgLen, const QString& tripCity, const QString& failReason, int bgColor);
};
#endif // RECOUIPASSWORD_H