2020-10-31 15:16:06 +01:00
|
|
|
#ifndef BRPROVIDER_H
|
|
|
|
#define BRPROVIDER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QtNetwork>
|
|
|
|
#include <QEventLoop>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include "brwidget.h"
|
|
|
|
#include "brcalendar.h"
|
2020-11-03 15:56:43 +01:00
|
|
|
#include "brseason.h"
|
|
|
|
#include "brleague.h"
|
2020-10-31 15:16:06 +01:00
|
|
|
#include "brcompetition.h"
|
2020-11-04 13:55:37 +01:00
|
|
|
#include "brathlete.h"
|
2020-10-31 15:16:06 +01:00
|
|
|
#include "brcup.h"
|
2020-11-04 13:55:37 +01:00
|
|
|
#include "brresult.h"
|
2020-10-31 15:16:06 +01:00
|
|
|
|
|
|
|
class BRProvider : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit BRProvider(QObject *parent = nullptr);
|
|
|
|
|
2020-11-03 15:56:43 +01:00
|
|
|
friend class BRController;
|
2020-10-31 15:16:06 +01:00
|
|
|
friend class BRCalendar;
|
2020-11-03 15:56:43 +01:00
|
|
|
friend class BRSeason;
|
|
|
|
friend class BRLeague;
|
|
|
|
friend class BRCompetition;
|
2020-11-04 13:55:37 +01:00
|
|
|
friend class BRCategory;
|
|
|
|
friend class BRAthlete;
|
|
|
|
friend class BRRound;
|
2020-10-31 15:16:06 +01:00
|
|
|
|
|
|
|
protected:
|
2020-11-03 15:56:43 +01:00
|
|
|
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;
|
2020-11-04 13:55:37 +01:00
|
|
|
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;
|
2020-11-03 15:56:43 +01:00
|
|
|
|
2020-11-04 17:25:28 +01:00
|
|
|
virtual void setCategoryData(BRCategory* category, BRCategory::BRCategoryData data) final {
|
|
|
|
category->setData(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void setRoundData(BRRound* round, BRRound::BRRoundData data) final {
|
|
|
|
round->setData(data);
|
|
|
|
}
|
|
|
|
|
2020-11-03 15:56:43 +01:00
|
|
|
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;
|
2020-10-31 15:16:06 +01:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BRCONTROLLER_H
|