2020-08-10 15:17:29 +03:00
|
|
|
#ifndef TDLIBWRAPPER_H
|
|
|
|
#define TDLIBWRAPPER_H
|
|
|
|
|
2020-08-10 21:17:13 +03:00
|
|
|
#include <QCoreApplication>
|
2020-08-10 15:17:29 +03:00
|
|
|
#include <QObject>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <td/telegram/td_json_client.h>
|
2020-08-10 21:17:13 +03:00
|
|
|
#include "tdlibreceiver.h"
|
2020-08-10 15:17:29 +03:00
|
|
|
|
|
|
|
class TDLibWrapper : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TDLibWrapper(QObject *parent = nullptr);
|
|
|
|
~TDLibWrapper();
|
|
|
|
|
2020-08-12 11:50:01 +03:00
|
|
|
Q_INVOKABLE QString getVersion();
|
|
|
|
Q_INVOKABLE QString getAuthorizationState();
|
|
|
|
|
2020-08-10 15:17:29 +03:00
|
|
|
signals:
|
2020-08-12 11:50:01 +03:00
|
|
|
void versionDetected(const QString &version);
|
|
|
|
void authorizationStateChanged(const QString &authorizationState);
|
2020-08-10 15:17:29 +03:00
|
|
|
|
|
|
|
public slots:
|
2020-08-12 11:50:01 +03:00
|
|
|
void handleVersionDetected(const QString &version);
|
|
|
|
void handleAuthorizationStateChanged(const QString &authorizationState);
|
2020-08-10 15:17:29 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
void *tdLibClient;
|
2020-08-10 21:17:13 +03:00
|
|
|
TDLibReceiver *tdLibReceiver;
|
2020-08-10 15:17:29 +03:00
|
|
|
|
2020-08-12 11:50:01 +03:00
|
|
|
QString version;
|
|
|
|
QString authorizationState;
|
|
|
|
|
2020-08-10 15:17:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TDLIBWRAPPER_H
|