#ifndef BRLEAGUE_H #define BRLEAGUE_H #include #include #include "brwidget.h" #include "brcompetition.h" #include "brcategory.h" #include "brcup.h" class BRLeague : public BRWidget { Q_OBJECT Q_PROPERTY(QString name READ getName NOTIFY metadataChanged) Q_PROPERTY(QColor color READ getColor NOTIFY metadataChanged) Q_PROPERTY(QList competitions READ getCompetitionsQML NOTIFY competitionsChanged) Q_PROPERTY(QList cups READ getCupsQML NOTIFY cupsChanged) public: friend class BRProvider; typedef struct { const BRLeague* league; QString name; QColor color; QList competitions; QList cups; } BRLeagueData; BRWidget::BRWidgetStatusCode load() override; int getId() const; Q_INVOKABLE QString getName(); Q_INVOKABLE QColor getColor(); Q_INVOKABLE QList getCompetitions(); Q_INVOKABLE QList getCompetitionsQML(); Q_INVOKABLE QList getCupsQML(); private: BRLeague(BRProvider* provider, BRWidget::BRFederation federation, int id, BRLeagueData initialData); void setData(BRLeagueData data); const int id; QString name; QColor color; QList competitions; QList cups; signals: void metadataChanged(); void competitionsChanged(); void cupsChanged(); }; #endif // BRLEAGUE_H