app/headers/brprovider.h

65 lines
2.5 KiB
C
Raw Normal View History

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"
#include "brseason.h"
#include "brleague.h"
2020-10-31 15:16:06 +01:00
#include "brcompetition.h"
#include "brathlete.h"
2020-10-31 15:16:06 +01:00
#include "brcup.h"
#include "brresult.h"
2020-10-31 15:16:06 +01:00
class BRProvider : public QObject
{
Q_OBJECT
public:
explicit BRProvider(QObject *parent = nullptr);
friend class BRController;
2020-10-31 15:16:06 +01:00
friend class BRCalendar;
friend class BRSeason;
friend class BRLeague;
friend class BRCompetition;
friend class BRCategory;
friend class BRAthlete;
friend class BRRound;
2020-10-31 15:16:06 +01:00
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;
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);
}
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