app/headers/brcalendar.h

49 lines
1.2 KiB
C
Raw Normal View History

2020-10-31 15:16:06 +01:00
#ifndef BRCALENDAR_H
#define BRCALENDAR_H
#include <QObject>
#include "brwidget.h"
#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
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;
typedef struct {
BRCalendar* calendar;
BRSeason* currentSeason;
QList<BRSeason*> seasons;
} BRCalendarData;
Q_INVOKABLE BRWidget::BRWidgetStatusCode load() override;
2020-10-31 15:16:06 +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:
explicit BRCalendar(BRProvider* provider, BRFederation federation);
void setData(BRCalendarData data);
2020-10-31 15:16:06 +01:00
QList<BRSeason*> seasons;
BRSeason* currentSeason;
2020-10-31 15:16:06 +01:00
signals:
void titleChanged();
void seasonsChanged();
void currentSeasonChanged();
2020-10-31 15:16:06 +01:00
};
#endif // BRCALENDAR_H