looqs/gui/mainwindow.h

59 rindas
1.5 KiB
C

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QThread>
#include <QTreeWidgetItem>
#include <QFileIconProvider>
#include <QKeyEvent>
2019-04-27 21:24:53 +02:00
#include <QFutureWatcher>
#include <QSqlDatabase>
#include "pdfworker.h"
2021-06-12 14:59:58 +02:00
#include "../shared/looqsquery.h"
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
signals:
2018-09-02 12:27:23 +02:00
void beginSearch(const QString &query);
void startPdfPreviewGeneration(QVector<SearchResult> paths, double scalefactor);
private:
Ui::MainWindow *ui;
QFileIconProvider iconProvider;
bool pdfDirty;
2019-04-27 21:24:53 +02:00
QSqlDatabase db;
QFutureWatcher<QVector<SearchResult>> searchWatcher;
QFutureWatcher<PdfPreview> pdfWorkerWatcher;
void add(QString path, unsigned int page);
QVector<SearchResult> pdfSearchResults;
void connectSignals();
2019-08-26 09:20:21 +02:00
void makePdfPreview(int page);
bool pdfTabActive();
void keyPressEvent(QKeyEvent *event) override;
unsigned int processedPdfPreviews;
void handleSearchResults(const QVector<SearchResult> &results);
void handleSearchError(QString error);
2021-06-12 14:59:58 +02:00
LooqsQuery currentQuery;
2019-08-26 09:20:21 +02:00
int pdfPreviewsPerPage;
void createSearchResutlMenu(QMenu &menu, const QFileInfo &fileInfo);
private slots:
void lineEditReturnPressed();
void treeSearchItemActivated(QTreeWidgetItem *item, int i);
void showSearchResultsContextMenu(const QPoint &point);
void tabChanged();
void pdfPreviewReceived(PdfPreview preview);
2021-06-12 23:01:14 +02:00
void comboScaleChanged(int i);
2019-08-26 09:20:21 +02:00
void spinPdfPreviewPageValueChanged(int val);
};
#endif // MAINWINDOW_H