2020-11-03 15:56:43 +01:00
|
|
|
#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)
|
2020-11-05 19:37:13 +01:00
|
|
|
Q_PROPERTY(bool enabled READ getEnabled WRITE setEnabled NOTIFY enabledChanged)
|
2020-11-03 15:56:43 +01:00
|
|
|
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;
|
2020-11-05 19:37:13 +01:00
|
|
|
bool enabled;
|
2020-11-03 15:56:43 +01:00
|
|
|
|
|
|
|
QList<BRCompetition*> competitions;
|
|
|
|
QList<BRCup*> cups;
|
|
|
|
} BRLeagueData;
|
|
|
|
|
|
|
|
BRWidget::BRWidgetStatusCode load() override;
|
|
|
|
|
|
|
|
Q_INVOKABLE QString getName();
|
|
|
|
Q_INVOKABLE QColor getColor();
|
2020-11-05 19:37:13 +01:00
|
|
|
Q_INVOKABLE bool getEnabled();
|
|
|
|
Q_INVOKABLE void setEnabled(bool enabled);
|
2020-11-03 15:56:43 +01:00
|
|
|
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);
|
|
|
|
|
|
|
|
QString name;
|
|
|
|
QColor color;
|
2020-11-05 19:37:13 +01:00
|
|
|
bool enabled;
|
2020-11-03 15:56:43 +01:00
|
|
|
|
|
|
|
QList<BRCompetition*> competitions;
|
|
|
|
QList<BRCup*> cups;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void metadataChanged();
|
2020-11-05 19:37:13 +01:00
|
|
|
void enabledChanged();
|
2020-11-03 15:56:43 +01:00
|
|
|
void competitionsChanged();
|
|
|
|
void cupsChanged();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BRLEAGUE_H
|