app/headers/brleague.h
Dorian Zedler c44380d1bf
Many more implementations!
Calendar works now for VL and DR API
2020-11-03 15:56:43 +01:00

60 lines
1.4 KiB
C++

#ifndef BRLEAGUE_H
#define BRLEAGUE_H
#include <QObject>
#include <QColor>
#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<QObject*> competitions READ getCompetitionsQML NOTIFY competitionsChanged)
Q_PROPERTY(QList<QObject*> cups READ getCupsQML NOTIFY cupsChanged)
public:
friend class BRProvider;
typedef struct {
const BRLeague* league;
QString name;
QColor color;
QList<BRCompetition*> competitions;
QList<BRCup*> cups;
} BRLeagueData;
BRWidget::BRWidgetStatusCode load() override;
int getId() const;
Q_INVOKABLE QString getName();
Q_INVOKABLE QColor getColor();
Q_INVOKABLE QList<BRCompetition*> getCompetitions();
Q_INVOKABLE QList<QObject*> getCompetitionsQML();
Q_INVOKABLE QList<QObject*> getCupsQML();
private:
BRLeague(BRProvider* provider, BRWidget::BRFederation federation, int id, BRLeagueData initialData);
void setData(BRLeagueData data);
const int id;
QString name;
QColor color;
QList<BRCompetition*> competitions;
QList<BRCup*> cups;
signals:
void metadataChanged();
void competitionsChanged();
void cupsChanged();
};
#endif // BRLEAGUE_H