mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
added a border to selected/mouseHover elements in the grid view
This commit is contained in:
102
YACReader/translator.h
Normal file
102
YACReader/translator.h
Normal file
@ -0,0 +1,102 @@
|
||||
#ifndef __TRANSLATOR_H
|
||||
#define __TRANSLATOR_H
|
||||
|
||||
class QUrl;
|
||||
class QMouseEvent;
|
||||
class QPoint;
|
||||
class QTextEdit;
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class YACReaderBusyWidget;
|
||||
|
||||
#include <QWidget>
|
||||
#include <QThread>
|
||||
#include <QUrl>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
class QMediaPlayer;
|
||||
#else
|
||||
#include<Phonon/MediaObject>
|
||||
using namespace Phonon;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class YACReaderTranslator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
YACReaderTranslator(QWidget * parent = 0);
|
||||
~YACReaderTranslator();
|
||||
|
||||
public slots:
|
||||
void play();
|
||||
|
||||
protected slots:
|
||||
void translate();
|
||||
void setSpeak(const QUrl & url);
|
||||
void setTranslation(const QString & string);
|
||||
void error();
|
||||
void clear();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent ( QMouseEvent * event );
|
||||
void hideResults();
|
||||
|
||||
void populateCombos();
|
||||
bool drag;
|
||||
QPoint click;
|
||||
private:
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
QMediaPlayer *player;
|
||||
#else
|
||||
MediaObject * music;
|
||||
#endif
|
||||
|
||||
QTextEdit * text;
|
||||
QComboBox * from;
|
||||
QComboBox * to;
|
||||
QLabel * resultsTitle;
|
||||
QPushButton * speakButton;
|
||||
QLabel * resultText;
|
||||
YACReaderBusyWidget * busyIndicator;
|
||||
QUrl ttsSource;
|
||||
QPushButton * clearButton;
|
||||
|
||||
};
|
||||
|
||||
class TranslationLoader : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TranslationLoader(QString text, QString from, QString to);
|
||||
signals:
|
||||
void requestFinished(QString);
|
||||
void timeOut();
|
||||
void error();
|
||||
private:
|
||||
QString text;
|
||||
QString from;
|
||||
QString to;
|
||||
void run();
|
||||
};
|
||||
|
||||
class TextToSpeachLoader : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TextToSpeachLoader(QString text, QString language);
|
||||
signals:
|
||||
void requestFinished(QUrl);
|
||||
void timeOut();
|
||||
void error();
|
||||
private:
|
||||
QString text;
|
||||
QString language;
|
||||
void run();
|
||||
};
|
||||
#endif
|
Reference in New Issue
Block a user