2019-04-20 22:57:40 +02:00
|
|
|
#ifndef SERVERCONN_H
|
|
|
|
#define SERVERCONN_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QtNetwork>
|
|
|
|
#include <QEventLoop>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
class ServerConn : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QVariant foodplan READ getFoodplan NOTIFY foodplanChanged)
|
|
|
|
public:
|
|
|
|
explicit ServerConn(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QVariantMap senddata(QUrl serviceUrl, QUrlQuery pdata = QUrlQuery());
|
|
|
|
|
|
|
|
// variables
|
|
|
|
QVariant foodplan;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void foodplanChanged();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void refreshFoodplan();
|
|
|
|
|
2019-04-21 18:35:28 +02:00
|
|
|
QVariant getCalendar(QString nation, int year);
|
2019-04-20 22:57:40 +02:00
|
|
|
QVariant getRanking(int competitionId, int categoryId, bool registrationData = false, const int routeNumber = -2);
|
|
|
|
|
|
|
|
// functions for qml
|
|
|
|
QVariant getFoodplan();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SERVERCONN_H
|