mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-12 19:04:05 +00:00
b5349478cf
The next commit will add `.git-blame-ignore-revs` https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
34 lines
719 B
C++
34 lines
719 B
C++
#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 );
|
|
static constexpr auto transfer_timeout = 3000;
|
|
|
|
public:
|
|
signals:
|
|
void errorText( QString const & );
|
|
private slots:
|
|
void finishedSlot( QNetworkReply * reply );
|
|
};
|
|
|
|
#endif // ANKICONNECTOR_H
|