app/headers/brseason.h

61 lines
1.4 KiB
C
Raw Normal View History

#ifndef BRSEASON_H
#define BRSEASON_H
#include <QObject>
#include "brwidget.h"
#include "brleague.h"
class BRSeason : public BRWidget
{
Q_OBJECT
Q_PROPERTY(int year READ getYear NOTIFY metadataChanged)
Q_PROPERTY(QString name READ getName NOTIFY metadataChanged)
Q_PROPERTY(QList<QObject*> leagues READ getLeaguesQML NOTIFY leaguesChanged)
Q_PROPERTY(QList<QObject*> competitions READ getCompetitionsQML NOTIFY competitionsChanged)
Q_PROPERTY(QList<QObject*> cups READ getCupsQML NOTIFY cupsChanged)
public:
friend class BRProvider;
typedef struct {
const BRSeason* season;
int year;
QString name;
bool nativeMultiLeagueSupport;
QList<BRLeague*> leagues;
} BRSeasonData;
BRWidget::BRWidgetStatusCode load() override;
Q_INVOKABLE int getYear() const;
Q_INVOKABLE QString getName();
Q_INVOKABLE QList<QObject*> getLeaguesQML();
QList<BRLeague*> getLeagues() const;
Q_INVOKABLE QList<QObject*> getCompetitionsQML();
Q_INVOKABLE QList<QObject*> getCupsQML();
private:
explicit BRSeason(BRProvider* provider, BRWidget::BRFederation federation, int id, BRSeasonData initialData);
void setData(BRSeasonData data);
int year;
QString name;
bool multiLeagueSupport;
QList<BRLeague*> leagues;
signals:
void metadataChanged();
void leaguesChanged();
void competitionsChanged();
void cupsChanged();
};
#endif // BRSEASON_H