#ifndef SERVERCONN_H #define SERVERCONN_H #include #include #include #include #include #include #include #include #include "headers/appsettings.h" #ifdef Q_OS_ANDROID #include #endif typedef struct strReturnData{ int status_code; QString text; }ReturnData_t; class ServerConn : public QObject { Q_OBJECT public: QString username; QString password; QNetworkAccessManager *networkManager; QNetworkAccessManager *refreshNetworkManager; float progress; public: explicit ServerConn(QObject *parent = nullptr); ~ServerConn(); Q_INVOKABLE QString login(QString username, QString password, bool permanent); Q_INVOKABLE int logout(); Q_INVOKABLE QString getDay(QString day); Q_INVOKABLE int checkConn(); Q_INVOKABLE float getProgress(); Q_INVOKABLE int getFoodPlan(); Q_INVOKABLE QVariantMap getFoodPlanData(int index); Q_INVOKABLE QVariantMap getEventData(int index); Q_INVOKABLE int getEvents(); Q_INVOKABLE int getEventCount(); ReturnData_t senddata(QUrl serviceUrl, QUrlQuery postData); signals: public slots: Q_INVOKABLE void updateProgress(qint64 read, qint64 total); private: struct Day { QString Cookteam; QString Date; QString Main; QString Main_veg; QString Salad; QString Dessert; }; QList> m_weekplan; QList m_eventlist; }; #endif // SERVERCONN_H