ScreenTranslator/Manager.h

48 lines
873 B
C
Raw Normal View History

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-24 19:43:37 +07:00
class QAction;
2013-11-23 13:48:34 +07:00
class QMenu;
class SelectionDialog;
class Manager : public QObject
{
Q_OBJECT
public:
explicit Manager(QObject *parent = 0);
~Manager ();
signals:
void showPixmap (QPixmap pixmap);
void recognize (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-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);
void showTranslation (QString sourceText, QString translatedText);
2013-11-24 19:43:37 +07:00
void showError (QString text);
2013-11-23 13:48:34 +07:00
private:
QMenu* trayContextMenu ();
private:
QSystemTrayIcon* trayIcon_;
SelectionDialog* selection_;
2013-11-24 19:43:37 +07:00
QAction* captureAction_;
2013-11-24 20:06:19 +07:00
QString lastMessage_;
2013-11-23 13:48:34 +07:00
};
#endif // MANAGER_H