2022-05-21 06:03:26 +00:00
|
|
|
#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 );
|
|
|
|
|
2023-03-16 11:55:47 +00:00
|
|
|
void sendToAnki( QString const & word, QString const & text, QString const & sentence );
|
2023-03-22 02:04:54 +00:00
|
|
|
void ankiSearch( QString const & word);
|
2022-05-21 06:03:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QNetworkAccessManager * mgr;
|
|
|
|
Config::Class const & cfg;
|
2023-03-22 02:04:54 +00:00
|
|
|
void postToAnki( QString const & postData );
|
2022-05-21 06:03:26 +00:00
|
|
|
public :
|
|
|
|
signals:
|
|
|
|
void errorText( QString const & );
|
|
|
|
private slots:
|
|
|
|
void finishedSlot(QNetworkReply * reply);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ANKICONNECTOR_H
|