app/headers/brcategory.h
Dorian Zedler 9b762ea246
many new implementations:
- Results are now starting to work on VL
2020-11-04 13:55:37 +01:00

55 lines
1.4 KiB
C++

#ifndef BRCATEGORY_H
#define BRCATEGORY_H
#include <QObject>
#include "brwidget.h"
#include "brround.h"
#include "brathlete.h"
class BRCompetition;
class BRCategory : public BRWidget
{
Q_OBJECT
Q_PROPERTY(QString name READ getName NOTIFY metadataChanged)
Q_PROPERTY(BRRound* currentRound READ getCurrentRound WRITE setCurrentRound NOTIFY currentRoundChanged)
Q_PROPERTY(QList<QObject*> rounds READ getRoundsQML NOTIFY roundsChanged)
public:
friend class BRProvider;
friend class BRCompetition;
typedef struct {
const BRCategory* category;
QString name;
BRRound* currentRound;
QList<BRRound*> rounds;
} BRCategoryData;
Q_INVOKABLE BRWidget::BRWidgetStatusCode load() override;
Q_INVOKABLE BRCompetition* getCompetition() const;
Q_INVOKABLE QString getName();
Q_INVOKABLE BRRound* getCurrentRound() const;
Q_INVOKABLE void setCurrentRound(BRRound* round);
Q_INVOKABLE QList<BRRound*> getRounds() const;
Q_INVOKABLE QList<QObject*> getRoundsQML();
private:
BRCategory(BRProvider* provider, BRWidget::BRFederation federation, int id, BRCategoryData initialData);
void setData(BRCategoryData data);
BRCompetition* competition;
BRRound* currentRound;
QString name;
QList<BRRound*> rounds;
signals:
void metadataChanged();
void currentRoundChanged();
void roundsChanged();
};
#endif // BRCATEGORY_H