2013-11-23 13:48:34 +07:00
|
|
|
#ifndef MANAGER_H
|
|
|
|
#define MANAGER_H
|
|
|
|
|
|
|
|
#include <QPixmap>
|
2013-11-24 20:06:19 +07:00
|
|
|
#include <QSystemTrayIcon>
|
2013-11-23 13:48:34 +07:00
|
|
|
|
2013-11-26 13:44:00 +07:00
|
|
|
#include "ProcessingItem.h"
|
|
|
|
|
2013-11-24 19:43:37 +07:00
|
|
|
class QAction;
|
2013-11-23 13:48:34 +07:00
|
|
|
class QMenu;
|
|
|
|
|
|
|
|
class SelectionDialog;
|
2013-11-26 13:44:00 +07:00
|
|
|
class ResultDialog;
|
2014-04-04 21:39:10 +07:00
|
|
|
class LanguageHelper;
|
2013-11-23 13:48:34 +07:00
|
|
|
|
2015-09-23 01:41:08 +07:00
|
|
|
class Manager : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2013-11-23 13:48:34 +07:00
|
|
|
public:
|
2015-09-23 01:41:08 +07:00
|
|
|
explicit Manager (QObject *parent = 0);
|
2013-11-23 13:48:34 +07:00
|
|
|
~Manager ();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void showPixmap (QPixmap pixmap);
|
2013-11-24 19:43:37 +07:00
|
|
|
void settingsEdited ();
|
2013-11-23 13:48:34 +07:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void capture ();
|
|
|
|
void settings ();
|
|
|
|
void close ();
|
2013-11-24 20:06:19 +07:00
|
|
|
void about ();
|
2013-11-26 23:59:47 +07:00
|
|
|
void showLast ();
|
|
|
|
void copyLastToClipboard ();
|
2013-11-23 13:48:34 +07:00
|
|
|
|
2013-11-24 19:43:37 +07:00
|
|
|
void applySettings ();
|
|
|
|
|
2013-11-24 20:06:19 +07:00
|
|
|
void processTrayAction (QSystemTrayIcon::ActivationReason reason);
|
|
|
|
|
2013-11-26 13:44:00 +07:00
|
|
|
void showResult (ProcessingItem item);
|
2013-11-24 19:43:37 +07:00
|
|
|
void showError (QString text);
|
2013-11-23 13:48:34 +07:00
|
|
|
|
|
|
|
private:
|
2015-09-23 01:41:08 +07:00
|
|
|
QMenu * trayContextMenu ();
|
2013-11-23 13:48:34 +07:00
|
|
|
|
|
|
|
private:
|
2015-09-23 01:41:08 +07:00
|
|
|
QSystemTrayIcon *trayIcon_;
|
|
|
|
LanguageHelper *dictionary_;
|
|
|
|
SelectionDialog *selection_;
|
|
|
|
ResultDialog *resultDialog_;
|
|
|
|
QAction *captureAction_;
|
|
|
|
QAction *repeatAction_;
|
|
|
|
QAction *clipboardAction_;
|
2013-11-26 23:59:47 +07:00
|
|
|
ProcessingItem lastItem_;
|
|
|
|
bool useResultDialog_;
|
2013-11-23 13:48:34 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MANAGER_H
|