goldendict-ng/ankiconnector.h
Ren Tatsumoto 1a0af48a7a
Improve Anki support (#384)
* allow the user to configure word,text,sentence Anki fields

* if sentence field is not set, don't add it

* mark the target word bold, if possible

* Update how to connect with anki.md

* rename default field names
2023-03-16 19:55:47 +08:00

29 lines
586 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 const & text, QString const & sentence );
private:
QNetworkAccessManager * mgr;
Config::Class const & cfg;
public :
signals:
void errorText( QString const & );
private slots:
void finishedSlot(QNetworkReply * reply);
};
#endif // ANKICONNECTOR_H