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

84 lines
2.8 KiB
C++

#ifndef RECOUICALLCONSOLE_H
#define RECOUICALLCONSOLE_H
#include "UiTools.h"
#include "UiConfig.h"
class recoUiCallConsole : public WidgetWithBackstageInterface
{
Q_OBJECT
public:
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];
enum Status {
PlatformCallIn = 60, // 平台打过来
ShowVideo = 101, // 背景透明,显示对方视频
HideVideo = 102, // 背景不透明, 不显示对方视频
};
explicit recoUiCallConsole(QWidget *parent = nullptr);
void reset(const QString& contactName);
void setStatus(int status, const QString& text = QString());
void setVideoButtonVisible(bool visible);
signals:
void signalShowRecognizePage();
void signalCallAgain();
public slots:
void slotBtnClicked();
void slotTimeout();
protected:
/**
* @brief 透明背景能够显示视频
*
* @param transparent
*/
void setBackgroundTransparent(bool transparent);
private:
enum{
TIMEOUT = 30000,
};
QLabel* m_labelContactName;
QLabel* m_labelTip;
QPushButton* m_btnCancel;
QPushButton* m_btnHungUp;
QPushButton* m_btnCallAgain;
QPushButton* m_btnVideoCtrl;
QPushButton* m_btnAccept;
QPushButton* m_btnReject;
QPushButton *m_btnOpenDoor = nullptr;
QTimer* m_timer;
bool m_videoButtonVisible = false;
bool m_videoEnable = false;
bool m_initiatorVideoCfg = false;
bool m_initiatorDoorCfg = false;
int m_timeCount = 0;
QPushButton* createButton(const QPixmap& icon, const QString& btnText);
void videoCtrl(bool enable);
void updateCallTime(int second);
};
#endif // RECOUICALLCONSOLE_H