80 lines
2.6 KiB
C
80 lines
2.6 KiB
C
|
#ifndef RECOUICALLDIAL_H
|
||
|
#define RECOUICALLDIAL_H
|
||
|
|
||
|
#include "UiTools.h"
|
||
|
#include "UiConfig.h"
|
||
|
|
||
|
class CenterMsgWidget;
|
||
|
|
||
|
class recoUiCallDial : public WidgetWithBackstageInterface
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
static const int DEV_CODE_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 CALL_BTN_FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY][UiConfig::SUPPORT_LANGUAGE_QUANTITY];
|
||
|
static const QString DIAL_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
|
||
|
static const QString CALL_BTN_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
|
||
|
static const QString CALL_BTN_DISABLE_BG[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
|
||
|
static const int CALL_BTN_W[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY];
|
||
|
static const int CALL_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];
|
||
|
|
||
|
explicit recoUiCallDial(QWidget *parent = nullptr);
|
||
|
void reset();
|
||
|
void setToolip(const QString &message, int millisecondTimeout);
|
||
|
void setPlatformConnected(bool connected);
|
||
|
|
||
|
signals:
|
||
|
void signalShowRecognizePage();
|
||
|
void signalCallBtnPressed(const QString&);
|
||
|
|
||
|
public slots:
|
||
|
void slotBtnClicked();
|
||
|
void slotBtnPressed();
|
||
|
void slotBtnReleased();
|
||
|
|
||
|
void slotTimeout();
|
||
|
void slotItemChoosed(int index);
|
||
|
void slotTextChanged(const QString& text);
|
||
|
|
||
|
void slotCall();
|
||
|
|
||
|
protected:
|
||
|
void onTooltipTimeout();
|
||
|
|
||
|
private:
|
||
|
enum{
|
||
|
NUM_BTNS_QTY = 10,
|
||
|
TIMEOUT = 30000,
|
||
|
CODE_LEN_MIN = 3,
|
||
|
CODE_LEN_MAX = 16,
|
||
|
};
|
||
|
|
||
|
QPushButton* m_btnBack;
|
||
|
QLineEdit* m_editDevCode;
|
||
|
QPushButton* m_btnsNum[NUM_BTNS_QTY];
|
||
|
QPushButton* m_btnBackspace;
|
||
|
QPushButton* m_btnCall;
|
||
|
SearchBarCandidate* m_candidate = nullptr;
|
||
|
|
||
|
CenterMsgWidget *m_tooltip = nullptr;
|
||
|
QTimer *m_tooltipTimer = nullptr;
|
||
|
|
||
|
QTimer* m_timer;
|
||
|
|
||
|
bool m_platformConnected = false;
|
||
|
std::vector<stCallDev> m_devList;
|
||
|
|
||
|
void showCandidate(const QVector<myListWidget::SetOpnCfg>& opns);
|
||
|
void exit();
|
||
|
};
|
||
|
|
||
|
#endif // RECOUICALLDIAL_H
|