2020-10-31 15:16:06 +01:00
|
|
|
#ifndef BRCALENDAR_H
|
|
|
|
#define BRCALENDAR_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include "brwidget.h"
|
2020-11-03 15:56:43 +01:00
|
|
|
#include "brseason.h"
|
|
|
|
#include "brcompetition.h"
|
2020-10-31 15:16:06 +01:00
|
|
|
#include "brcategory.h"
|
|
|
|
#include "brcup.h"
|
|
|
|
|
|
|
|
class BRCalendar : public BRWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-11-03 15:56:43 +01:00
|
|
|
Q_PROPERTY(QString title READ getTitle NOTIFY titleChanged)
|
|
|
|
Q_PROPERTY(QList<QObject*> seasons READ getSeasonsQML NOTIFY seasonsChanged)
|
|
|
|
Q_PROPERTY(BRSeason* currentSeason READ getCurrentSeason WRITE setCurrentSeason NOTIFY currentSeasonChanged)
|
|
|
|
|
2020-10-31 15:16:06 +01:00
|
|
|
public:
|
|
|
|
friend class BRProvider;
|
|
|
|
|
2020-11-03 15:56:43 +01:00
|
|
|
typedef struct {
|
|
|
|
BRCalendar* calendar;
|
|
|
|
BRSeason* currentSeason;
|
|
|
|
QList<BRSeason*> seasons;
|
|
|
|
} BRCalendarData;
|
|
|
|
|
|
|
|
Q_INVOKABLE BRWidget::BRWidgetStatusCode load() override;
|
2020-10-31 15:16:06 +01:00
|
|
|
|
2020-11-03 15:56:43 +01:00
|
|
|
Q_INVOKABLE QString getTitle();
|
|
|
|
Q_INVOKABLE QList<QObject*> getSeasonsQML();
|
|
|
|
Q_INVOKABLE BRSeason* getCurrentSeason();
|
|
|
|
Q_INVOKABLE void setCurrentSeason(BRSeason* season);
|
2020-10-31 15:16:06 +01:00
|
|
|
|
|
|
|
private:
|
2020-11-03 15:56:43 +01:00
|
|
|
explicit BRCalendar(BRProvider* provider, BRFederation federation);
|
|
|
|
void setData(BRCalendarData data);
|
2020-10-31 15:16:06 +01:00
|
|
|
|
2020-11-03 15:56:43 +01:00
|
|
|
QList<BRSeason*> seasons;
|
|
|
|
BRSeason* currentSeason;
|
2020-10-31 15:16:06 +01:00
|
|
|
|
|
|
|
signals:
|
2020-11-03 15:56:43 +01:00
|
|
|
void titleChanged();
|
|
|
|
void seasonsChanged();
|
|
|
|
void currentSeasonChanged();
|
2020-10-31 15:16:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BRCALENDAR_H
|