2023-04-20 09:49:48 +00:00
|
|
|
#ifndef DIALOG_PROGRESS_UI_H
|
|
|
|
#define DIALOG_PROGRESS_UI_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2023-04-23 01:25:52 +00:00
|
|
|
#include <qtranslator.h>
|
2023-05-06 02:55:17 +00:00
|
|
|
#include "twain_user/twainui.h"
|
2023-04-20 09:49:48 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class Dialog_progress_ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Dialog_progress_ui : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-05-24 06:40:06 +00:00
|
|
|
bool quit_ = false;
|
2023-04-20 09:49:48 +00:00
|
|
|
public:
|
2023-06-28 10:14:37 +00:00
|
|
|
explicit Dialog_progress_ui(class Manager *mgr, std::function<void (ui_result)> callback, std::function<void (int, void *, int)> *notify, QWidget *parent = nullptr);
|
2023-04-20 09:49:48 +00:00
|
|
|
~Dialog_progress_ui();
|
|
|
|
|
2023-05-30 02:46:09 +00:00
|
|
|
protected:
|
|
|
|
void keyPressEvent(QKeyEvent *e) override;
|
|
|
|
|
2023-04-20 09:49:48 +00:00
|
|
|
signals:
|
2023-04-27 03:04:52 +00:00
|
|
|
void scan_status(QString finishInfo, bool isScanning);
|
2023-05-24 06:40:06 +00:00
|
|
|
void scan_finish(int flag, QString finishInfo);
|
2023-05-26 09:25:01 +00:00
|
|
|
void image_recived();
|
2023-04-20 09:49:48 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_pbtn_cancelScan_clicked();
|
2023-04-25 06:46:50 +00:00
|
|
|
void on_pbtn_close_clicked();
|
|
|
|
|
2023-04-27 03:04:52 +00:00
|
|
|
void on_scan_status(QString finishInfo, bool isScanning);
|
2023-05-24 06:40:06 +00:00
|
|
|
void on_scan_finish(int flag, QString finishInfo);
|
2023-05-26 09:25:01 +00:00
|
|
|
void on_image_recived();
|
2023-04-20 09:49:48 +00:00
|
|
|
|
2023-05-10 12:30:07 +00:00
|
|
|
public:
|
2023-04-20 09:49:48 +00:00
|
|
|
static void FuncNotify(int event, void *msg, int flag);
|
2023-05-24 06:40:06 +00:00
|
|
|
void clear_callback(void)
|
|
|
|
{
|
|
|
|
quit_ = true;
|
|
|
|
m_callback = std::function<void(ui_result)>();
|
|
|
|
}
|
2023-04-20 09:49:48 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::Dialog_progress_ui *ui;
|
|
|
|
|
2023-06-28 10:14:37 +00:00
|
|
|
class Manager *m_mgr;
|
2023-04-20 09:49:48 +00:00
|
|
|
std::function<void (ui_result)> m_callback;
|
2023-04-27 03:04:52 +00:00
|
|
|
QTimer *m_timer;
|
2023-05-10 12:30:07 +00:00
|
|
|
bool m_isScanning;
|
2023-04-20 09:49:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIALOG_PROGRESS_UI_H
|