app/headers/brprovider.h
Dorian Zedler 9b762ea246
many new implementations:
- Results are now starting to work on VL
2020-11-04 13:55:37 +01:00

58 lines
2.4 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"
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) final;
virtual BRResult* getResult(BRWidget::BRFederation federation, int id, BRResult::BRResultData initialData) final;
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;
virtual BRWidget::BRWidgetStatusCode getWidgetData(BRCategory::BRCategoryData* categoryData) = 0;
virtual BRWidget::BRWidgetStatusCode getWidgetData(BRRound::BRRoundData* roundData) = 0;
signals:
};
#endif // BRCONTROLLER_H