app/headers/provider/brprovider.h
Dorian Zedler 85c8760bed
- moved some stuff
- results work now (still basic)
2020-11-15 14:48:12 +01:00

65 lines
2.5 KiB
C++

#ifndef BRPROVIDER_H
#define BRPROVIDER_H
#include <QObject>
#include <QtNetwork>
#include <QEventLoop>
#include <QTimer>
#include <QUrl>
#include "brwidget.h"
#include "brcalendar.h"
#include "brseason.h"
#include "brleague.h"
#include "brcompetition.h"
#include "brathlete.h"
#include "brcup.h"
#include "brresult.h"
#include "brresultdetailsunknown.h"
class BRProvider : public QObject
{
Q_OBJECT
public:
explicit BRProvider(QObject *parent = nullptr);
friend class BRController;
friend class BRCalendar;
friend class BRSeason;
friend class BRLeague;
friend class BRCompetition;
friend class BRCategory;
friend class BRAthlete;
friend class BRRound;
protected:
QVariantMap serverRequest(QUrl serviceUrl, QList<QStringList> additionalHeaders = {}, QUrlQuery postData = QUrlQuery());
virtual BRCalendar* getCalendar(BRWidget::BRFederation federation) final;
virtual BRSeason* getSeason(BRWidget::BRFederation federation, int id, BRSeason::BRSeasonData initialData) final;
virtual BRLeague* getLeague(BRWidget::BRFederation federation, int id, BRLeague::BRLeagueData initialData) final;
virtual BRCompetition* getCompetition(BRWidget::BRFederation federation, int id, BRCompetition::BRCompetitionData initialData) final;
virtual BRCup* getCup(BRWidget::BRFederation federation, int id, BRCup::BRCupData initialData) final;
virtual BRCategory* getCategory(BRWidget::BRFederation federation, int id, BRCategory::BRCategoryData initialData) final;
virtual BRAthlete* getAthlete(BRWidget::BRFederation federation, int id, BRAthlete::BRAthleteData initialData) final;
virtual BRRound* getRound(BRWidget::BRFederation federation, int id, BRRound::BRRoundData initialData, bool generalResult = false) final;
virtual BRResult* getResult(BRResult::BRResultData initialData) final;
virtual void setCategoryData(BRCategory* category, BRCategory::BRCategoryData data) final {
category->setData(data);
}
virtual void setRoundData(BRRound* round, BRRound::BRRoundData data) final {
round->setData(data);
}
virtual BRWidget::BRWidgetStatusCode getWidgetData(BRCalendar::BRCalendarData* calendarData) = 0;
virtual BRWidget::BRWidgetStatusCode getWidgetData(BRSeason::BRSeasonData* seasonData) = 0;
virtual BRWidget::BRWidgetStatusCode getWidgetData(BRLeague::BRLeagueData* leagueData) = 0;
virtual BRWidget::BRWidgetStatusCode getWidgetData(BRCompetition::BRCompetitionData* competitionData) = 0;
signals:
};
#endif // BRCONTROLLER_H