#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(bool enabled READ getEnabled WRITE setEnabled NOTIFY enabledChanged) 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; bool enabled; QList competitions; QList cups; } BRLeagueData; BRWidget::BRWidgetStatusCode load() override; Q_INVOKABLE QString getName(); Q_INVOKABLE QColor getColor(); Q_INVOKABLE bool getEnabled(); Q_INVOKABLE void setEnabled(bool enabled); 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); QString name; QColor color; bool enabled; QList competitions; QList cups; signals: void metadataChanged(); void enabledChanged(); void competitionsChanged(); void cupsChanged(); }; #endif // BRLEAGUE_H