48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#ifndef BRCALENDAR_H
|
|
#define BRCALENDAR_H
|
|
|
|
#include <QObject>
|
|
|
|
#include "brwidget.h"
|
|
#include "brseason.h"
|
|
#include "brcompetition.h"
|
|
#include "brcategory.h"
|
|
#include "brcup.h"
|
|
|
|
class BRCalendar : public BRWidget
|
|
{
|
|
Q_OBJECT
|
|
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)
|
|
|
|
public:
|
|
friend class BRProvider;
|
|
|
|
typedef struct {
|
|
BRCalendar* calendar;
|
|
BRSeason* currentSeason;
|
|
QList<BRSeason*> seasons;
|
|
} BRCalendarData;
|
|
|
|
Q_INVOKABLE BRWidget::BRWidgetStatusCode load() override;
|
|
|
|
Q_INVOKABLE QString getTitle();
|
|
Q_INVOKABLE QList<QObject*> getSeasonsQML();
|
|
Q_INVOKABLE BRSeason* getCurrentSeason();
|
|
Q_INVOKABLE void setCurrentSeason(BRSeason* season);
|
|
|
|
private:
|
|
explicit BRCalendar(BRProvider* provider, BRFederation federation);
|
|
void setData(BRCalendarData data);
|
|
|
|
QList<BRSeason*> seasons;
|
|
BRSeason* currentSeason;
|
|
|
|
signals:
|
|
void titleChanged();
|
|
void seasonsChanged();
|
|
void currentSeasonChanged();
|
|
};
|
|
|
|
#endif // BRCALENDAR_H
|