| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_OCRWINDOW_H |
| 21 |
#define KSNIP_OCRWINDOW_H |
| 22 |
|
| 23 |
#include <QTextEdit> |
| 24 |
#include <QGridLayout> |
| 25 |
#include <QtConcurrent/QtConcurrent> |
| 26 |
|
| 27 |
#include "src/gui/modelessWindows/IModelessWindow.h" |
| 28 |
#include "src/widgets/ProcessIndicator.h" |
| 29 |
#include "src/plugins/IPluginManager.h" |
| 30 |
#include "src/plugins/interfaces/IPluginOcr.h" |
| 31 |
|
| 32 |
class OcrWindow : public IModelessWindow |
| 33 |
{ |
| 34 |
public: |
| 35 |
explicit OcrWindow(const QPixmap &pixmap, const QString &title, const QSharedPointer<IPluginManager> &pluginManager); |
| 36 |
~OcrWindow() override = default; |
| 37 |
|
| 38 |
protected: |
| 39 |
void closeEvent(QCloseEvent *event) override; |
| 40 |
|
| 41 |
private: |
| 42 |
QTextEdit *mTextEdit; |
| 43 |
ProcessIndicator *mProcessIndicator; |
| 44 |
QGridLayout *mLayout; |
| 45 |
QFutureWatcher<QString> mOcrProcessFutureWatcher; |
| 46 |
|
| 47 |
virtual QString process(const QPixmap &pixmap, const QSharedPointer<IPluginManager> &pluginManager); |
| 48 |
void setProcessingVisible(bool isVisible); |
| 49 |
|
| 50 |
private slots: |
| 51 |
void processingFinished(); |
| 52 |
}; |
| 53 |
|
| 54 |
#endif |