2021-08-02 21:58:39 +08:00
|
|
|
#ifndef SEARCHDIALOG_H
|
|
|
|
#define SEARCHDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2023-02-28 16:17:56 +08:00
|
|
|
#include <QTabBar>
|
2023-01-11 16:22:26 +08:00
|
|
|
#include <qsynedit/searcher/baseseacher.h>
|
2021-08-02 21:58:39 +08:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class SearchDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class SearchDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SearchDialog(QWidget *parent = nullptr);
|
|
|
|
~SearchDialog();
|
2021-08-02 23:42:10 +08:00
|
|
|
void find(const QString& text);
|
2023-02-28 16:17:56 +08:00
|
|
|
void replace(const QString& text);
|
2021-08-04 00:17:38 +08:00
|
|
|
void findNext();
|
|
|
|
void findPrevious();
|
2022-11-11 21:20:57 +08:00
|
|
|
private:
|
|
|
|
void doSearch(bool backward);
|
2023-02-28 16:17:56 +08:00
|
|
|
|
|
|
|
void doReplace(bool replaceAll);
|
|
|
|
|
|
|
|
void prepareOptions(bool backward);
|
2022-11-11 21:20:57 +08:00
|
|
|
private slots:
|
2023-02-28 16:17:56 +08:00
|
|
|
void onTabBarCurrentChanged(int currentIndex);
|
|
|
|
|
2022-11-11 21:20:57 +08:00
|
|
|
void on_cbFind_currentTextChanged(const QString &arg1);
|
2021-08-03 23:55:57 +08:00
|
|
|
|
2022-11-11 21:20:57 +08:00
|
|
|
void on_btnClose_clicked();
|
2021-08-04 00:17:38 +08:00
|
|
|
|
2022-11-11 21:20:57 +08:00
|
|
|
void on_btnNext_clicked();
|
2021-08-02 23:42:10 +08:00
|
|
|
|
2022-11-11 21:20:57 +08:00
|
|
|
void on_btnPrevious_clicked();
|
|
|
|
|
2023-02-28 16:17:56 +08:00
|
|
|
void on_btnReplace_clicked();
|
|
|
|
|
|
|
|
void on_btnReplaceAll_clicked();
|
|
|
|
|
2021-08-02 21:58:39 +08:00
|
|
|
private:
|
|
|
|
Ui::SearchDialog *ui;
|
2023-02-28 16:17:56 +08:00
|
|
|
QTabBar * mTabBar;
|
|
|
|
int mSearchTabIdx;
|
|
|
|
int mReplaceTabIdx;
|
2022-09-27 14:01:38 +08:00
|
|
|
QSynedit::SearchOptions mSearchOptions;
|
2022-09-25 09:55:18 +08:00
|
|
|
QSynedit::PSynSearchBase mBasicSearchEngine;
|
|
|
|
QSynedit::PSynSearchBase mRegexSearchEngine;
|
2021-08-02 21:58:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SEARCHDIALOG_H
|