FaceAccess/Linguist/mainUi/UiConfig.h
2024-07-11 11:27:12 +08:00

304 lines
8.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef UICONFIG_H
#define UICONFIG_H
#include "memory.h"
#include <QString>
//#define DEBUG_MODE
#define QRCODE_SUPPORT
#ifdef QRCODE_SUPPORT
#define CUSTOM_QRCODE_AREA
#endif
typedef enum
{
ScreenSize_7inch,
ScreenSize_8inch,
ScreenSize_5inch,
ScreenSize_8inch_rk,
ScreenSize_5inch_rk
}ScreenSize_E;
typedef enum
{
FaceFrameSize_8inchJinggong_B020,
FaceFrameSize_8inchHaiman_A038,
FaceFrameSize_8inchJinggong_A038,
FaceFrameSize_Butt
}FaceFrameSize_E;
typedef enum
{
FuncWifi,
FuncWg42,
FuncCardReaderUnderScreen,
FuncDataEncrypt
}Func_E;
class RecoUiTextCfg
{
public:
typedef enum
{
TextOtherRecoResult,
TextFacePass = 0,
TextAllowPass,
TextAuthFailed,
TextNoEntry,
TextNOMask,
TextMaskOk,
TextTemp,
TextTapCard,
TextUseOwnCertifi,
TextFaceCam,
TextNoEntryTime,
TextCfgMax
}enTextType;
typedef enum
{
DisModeDefault,
DisModeHide,
DisModeCustom,
DisModeHideKeyWord
}enDisMode;
typedef enum
{
FontSizeDefault,
FontSizeLarge,
FontSizeSmall,
FontSizeHuge
}enFontSize;
enDisMode m_mode = DisModeDefault;
QString m_cusText;
enFontSize m_fontSize = FontSizeDefault;
char m_padding[4];
};
class UiConfig
{
public:
static const long long UI_VERSION;
static const int SUPPORT_SCREEN_SIZE_QUANTITY = 5;
static const int SUPPORT_LANGUAGE_QUANTITY = 14; //简 繁 英 日 韩 西班牙 泰 葡萄牙 意大利 希伯来 法 德 土耳其 匈牙利
static const int GLOBAL_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY];
static const QString WELCOME[SUPPORT_SCREEN_SIZE_QUANTITY];
static const int DEV_NAME_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY];
static const int MASK_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY];
static const int PERSON_MSG_FONT_SIZE[SUPPORT_SCREEN_SIZE_QUANTITY][SUPPORT_LANGUAGE_QUANTITY];
static const QString LANGUAGE_FILE[SUPPORT_LANGUAGE_QUANTITY];
//大 86 294
//小133 324
static const int QRCODE_AREA_COORDINATE_X = 133;
static const int QRCODE_AREA_COORDINATE_Y = 324;
//static const int QRCODE_AREA_WIDTH = 0;
//static const int QRCODE_AREA_HEIGHT = 0;
RecoUiTextCfg m_textCfg[RecoUiTextCfg::TextCfgMax];
typedef enum
{
#ifndef DEBUG_MODE
//启动画面展示时间,单位:毫秒
START_SCREEN_TIMEOUT = 4000,
//设置界面密码多次输错等待时间,单位:分钟
PWD_ACCEPT_DELAY_TIME = 2,
//设置界面密码尝试次数,到达次数后需要等待一段时间
RETRY_TIMES_MAX_PER_GROUP = 6,
//设置界面密码输入无操作自动返回时间,单位:秒
NO_OPERATION_OVERTIME_RETURN = 30,
//识别界面鼠标点击进入设置界面次数
MOUSE_CLICK_TIMES_TO_SETTING = 10,
//长按时长进设置界面需大于200ms单位毫秒
TOUCH_TIME_TO_SETTING = 1000, //3000
#define SPECIAL_PWD_1 "recon123"
#else
//启动画面展示时间,单位:毫秒
START_SCREEN_TIMEOUT = 1000,
//设置界面密码多次输错等待时间,单位:分钟
PWD_ACCEPT_DELAY_TIME = 1,
//设置界面密码尝试次数,到达次数后需要等待一段时间
RETRY_TIMES_MAX_PER_GROUP = 2,
//设置界面密码输入无操作自动返回时间,单位:秒
NO_OPERATION_OVERTIME_RETURN = 10,
//识别界面鼠标点击进入设置界面次数
MOUSE_CLICK_TIMES_TO_SETTING = 2,
//长按时长进设置界面需大于200ms单位毫秒
TOUCH_TIME_TO_SETTING = 300,
#define SPECIAL_PWD_1 "x"
#endif
//主风格颜色
MAIN_STYLE_COLOR_RED = 255,
MAIN_STYLE_COLOR_GREEN = 255,
MAIN_STYLE_COLOR_BLUE = 255,
MAIN_STYLE_COLOR_TRAN = 255,
//主界面背景颜色
//主界面字体颜色
SUB_STYLE_COLOR_RED = 245,
SUB_STYLE_COLOR_GREEN = 243,
SUB_STYLE_COLOR_BLUE = 251,
SUB_STYLE_COLOR_TRAN = 255,
DIALOG_SCREEN_BG_COLOR = 0xFFFFFF, //0x929292,
DIALOG_SCREEN_BG_TRAN = 200,
//同一风格按键背景颜色
//同一风格按键字体颜色
//弹窗背景颜色
//弹窗字体颜色
//弹窗确认按键背景颜色
//弹窗确认按键字体颜色
//弹窗取消按键背景颜色
//弹窗取消按键字体颜色
//键盘背景颜色
//键盘按键颜色
//键盘字体颜色
//人脸库管理每页显示人数
LOCAL_FACE_QUANTITY_EACH_PAGE = 20,
//设置界面item条目高度
SETTING_PAGE_ITEM_HEIGHT = 41,
//设置界面到边框距离
SETTING_PAGE_WIDGET_TO_FRAME = 30,
//识别界面鼠标点击进入设置界面两次点击间最长间隔,单位:毫秒
MOUSE_CLICK_INTERVAL_MAX = 1000,
}UiConfig_E;
~UiConfig();
static UiConfig* GetInstance();
void setUiConfig(const ScreenSize_E config);
void setUiFaceFrameSize(const FaceFrameSize_E config);
int getUiWidth() const;
int getUiHeight() const;
const QString& getWelcome() const;
#if 0
bool is7inch() const;
bool is8inch() const;
bool is5inch() const;
#endif
bool is8inchA038HaimanFaceFrame() const;
bool is8inchA038JinggongFaceFrame() const;
int getScreenConfigIndex() const;
int getGlobalFontSize() const;
int setLanguageType(const int);
int getLanguageType() const;
int getQRCodeAreaCoordinateX() const;
int getQRCodeAreaCoordinateY() const;
int getQRCodeAreaWidth() const;
int getQRCodeAreaHeight() const;
#ifdef CUSTOM_QRCODE_AREA //自定义扫描框
void setQRCodeAreaCoordinateX(const int);
void setQRCodeAreaCoordinateY(const int);
#endif
void setHardwareTesting(bool sw);
bool getHardwareTesting() const;
void showFaceFrameByTempExist(bool set);
bool isFaceFrameShowByTempExist() const;
void setTpAvailable(bool available);
bool isTpAvailable() const;
void setfuncNotSupport(Func_E func);
bool isFuncNotSupport(Func_E func) const;
void setRecoUiStyle(int style);
bool isRecoUiStyleClassical() const;
bool isRecoUiStyleStandard() const;
bool isRecoUiStyleColor() const;
bool isRecoUiStyleAd() const;
bool isRecoUiStyleScene() const;
#if 0
void setRecoUiFontSizeScale(int sizeType);
float recoUiFontSizeScale() const;
#endif
void setRecoUiFontSize(unsigned index, int size);
int recoUiFontSize(unsigned index) const;
bool isRkDevice() const;
int setRecoUITextCfg(RecoUiTextCfg::enTextType type, RecoUiTextCfg::enDisMode mode, const char* cusText, RecoUiTextCfg::enFontSize fontSize);
float recoUiTextCfgFontSize(RecoUiTextCfg::enTextType type);
void setDefaultScreensaver(int index);
int defaultScreensaver() const;
void setDevTestStatus(bool test);
bool isDevTesting() const;
void setFastCfgStatus(bool cfg);
bool isFastCfging() const;
private:
static UiConfig* m_instance;
ScreenSize_E m_screenSize;
int m_screenWidth;
int m_screenHeight;
int m_languageType;
FaceFrameSize_E m_faceFrameSize = FaceFrameSize_8inchJinggong_B020;
bool m_bShowFaceFrame = false;
bool m_bTpAvailable = true;
unsigned long long m_ullfuncNotSupp = 0;
#ifdef CUSTOM_QRCODE_AREA //自定义扫描框
int m_QRCodeAreaX;
int m_QRCodeAreaY;
#endif
bool m_bIsHardwareTesting = false; //do not enter setting if testing touch screen
int m_recoUiFontSizeType = 0;
int m_recoUiTunningFontSize[RecoUiTextCfg::TextCfgMax];
int m_recoUiStyle = 0;
int m_defaultScreensaver = 0;
bool m_isDevTesting = false;
bool m_isFastCfging = false;
UiConfig();
};
#endif // UICONFIG_H