1 #ifndef AGLSOCKETWRAPPER_H
2 #define AGLSOCKETWRAPPER_H
12 class AglSocketWrapper : public QObject
16 explicit AglSocketWrapper(QObject *parent = nullptr);
18 void open(const QUrl &url);
21 using ApiCallback = std::function<void(bool, const QJsonValue&)>;
22 void apiCall(const QString &api, const QString &verb, const QJsonValue &args = QJsonValue(),
23 ApiCallback callback = nullptr);
28 void eventReceived(const QString &eventName, const QJsonValue &data);
32 QMap<QString, ApiCallback> m_callbacks;
35 #endif // AGLSOCKETWRAPPER_H