2013-11-23 14:00:22 +07:00
|
|
|
#ifndef TRANSLATOR_H
|
|
|
|
#define TRANSLATOR_H
|
|
|
|
|
2013-11-24 19:43:37 +07:00
|
|
|
#include <QNetworkAccessManager>
|
2013-11-23 14:00:22 +07:00
|
|
|
|
2013-11-26 13:44:00 +07:00
|
|
|
#include "ProcessingItem.h"
|
|
|
|
|
2013-11-23 14:00:22 +07:00
|
|
|
class Translator : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit Translator(QObject *parent = 0);
|
|
|
|
|
|
|
|
signals:
|
2013-11-26 13:44:00 +07:00
|
|
|
void translated (ProcessingItem item);
|
2013-11-24 19:43:37 +07:00
|
|
|
void error (QString text);
|
2013-11-23 14:00:22 +07:00
|
|
|
|
|
|
|
public slots:
|
2013-11-26 13:44:00 +07:00
|
|
|
void translate (ProcessingItem item);
|
2013-11-24 19:43:37 +07:00
|
|
|
void applySettings ();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void replyFinished (QNetworkReply* reply);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QNetworkAccessManager network_;
|
|
|
|
QString translationLanguage_;
|
2014-03-30 17:56:21 +07:00
|
|
|
QString sourceLanguage_;
|
2013-11-26 13:44:00 +07:00
|
|
|
QHash<QNetworkReply*, ProcessingItem> items_;
|
2013-11-23 14:00:22 +07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRANSLATOR_H
|