code_app/app/scanner/dialog_export.h

68 lines
1.8 KiB
C++
Raw Permalink 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 DIALOG_EXPORT_H
#define DIALOG_EXPORT_H
#include <QDialog>
// u can ONLY comment following line if u want to use filedialog as system present !
#include "custom_file_dialog.h"
namespace Ui {
class Dialog_Export;
}
class Dialog_Export : public QDialog
#ifdef USE_FILE_DLG_WITHOUT_PROMPT
, public custom_file_dlg<Dialog_Export>
#endif
{
Q_OBJECT
public:
explicit Dialog_Export(int total, const std::vector<int> &selectedIndexs, QWidget *parent = nullptr);
~Dialog_Export();
QString getSavePath();
QString getSaveName();
QString getSaveExt();
int getJpegQuality();
int getTiffCompressionBW();
int getTiffCompression();
int getTiffQuality();
bool isOcr();
bool isSaveAsMultiPage();
void getSaveIndexs(std::vector<int> &indexs);
private slots:
void on_dialog_accepted();
void on_filterSelected(const QString& filterName);
void on_btn_option_clicked();
void on_radio_nominatedPages_toggled(bool checked);
void on_lineEdit_nominatePages_textChanged(const QString& arg1);
#ifdef USE_FILE_DLG_WITHOUT_PROMPT
void on_file_dialog_textChanged(const QString &path) override;
void on_file_dialog_returnPressed() override;
#endif
private:
bool isNominatedPagesLegal(const QString& page);
void makeSaveIndexs();
bool is_support_file_type(const QString& ext); // ext is like as '.bmp' '.png' ...
bool avoid_overwriting(const QString& path_file); // 判断文件是否存在若存在则提示用户是否覆盖。返回true表示用户希望重新选择
private:
Ui::Dialog_Export *ui;
int m_total;
std::vector<int> m_selectedIndexs;
QString m_savePath;
QString m_saveName;
QString m_saveExt;
std::vector<int> m_saveIndexs;
int m_suffix;
};
#endif // DIALOG_EXPORT_H