#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include "form_texttips.h" #include "form_burnmode.h" #include "form_maininterface.h" #include #include #include "HGPdtToolDb.h" #include "sane/sane_ex.h" #include "base/HGLock.h" #include "hgscanner.h" #include "dialog_login.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, Dialog_logIn::LogInType loginType, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr); ~MainWindow(); static QString getLogInfo(HGResult ret); bool isExitApp(); void updateSplitter(); Form_mainInterface* FindInterface(const QString &sn); Form_mainInterface* FindInterfaceByDevName(const QString &devName); Form_mainInterface* FindInterface(SANE_Handle handle); bool AddInterface(Form_mainInterface * mainInterface); bool RemoveInterface(Form_mainInterface *mainInterface); void addTestingRef(); void releaseTesting(); bool isTesting(); QString getDevSn(SANE_Handle handle); protected: void closeEvent(QCloseEvent *event); private: static int sane_ex_callback(SANE_Handle hdev, int code, void* data, unsigned int* len, void* param); std::vector getDevices(); QString getDevType(SANE_Handle handle); QString getDevFwNum(SANE_Handle handle); signals: void sane_dev_arrive(QString devName); void sane_dev_remove(QString devName); private slots: void on_sane_dev_arrive(QString devName); void on_sane_dev_remove(QString devName); void on_update_userStatus(); private slots: void on_act_newDevice_triggered(); void on_act_manage_triggered(); void on_act_changePwd_triggered(); void on_act_export_triggered(); void on_act_logOut_triggered(); void on_act_close_triggered(); void on_act_upload_triggered(); void on_act_refreshDevice_triggered(); private: QSplitter *m_top_splitter; QSplitter *m_bot_splitter; bool m_isLogOut; private: Ui::MainWindow *ui; HGPdtToolDbUserMgr m_pdtToolDbuserMgr; HGLock m_lock; int m_testingRef; Dialog_logIn::LogInType m_loginType; class Dialog_InputSerialNum *m_inputSnDlg; Form_BurnMode *m_formBurnMode; public: QString m_ftpHost; unsigned short m_ftpPort; }; #endif // MAINWINDOW_H