goldendict-ng/src/ankiconnector.hh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
719 B
C++
Raw Normal View History

#ifndef ANKICONNECTOR_H
#define ANKICONNECTOR_H
#include "config.hh"
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>
class AnkiConnector: public QObject
{
Q_OBJECT
public:
explicit AnkiConnector( QObject * parent, Config::Class const & cfg );
void sendToAnki( QString const & word, QString text, QString const & sentence );
void ankiSearch( QString const & word );
private:
QNetworkAccessManager * mgr;
Config::Class const & cfg;
void postToAnki( QString const & postData );
2023-03-22 21:55:45 +00:00
static constexpr auto transfer_timeout = 3000;
2023-03-22 21:55:45 +00:00
public:
signals:
void errorText( QString const & );
private slots:
void finishedSlot( QNetworkReply * reply );
};
#endif // ANKICONNECTOR_H