2020-11-04 13:55:37 +01:00
|
|
|
#ifndef BRROUND_H
|
|
|
|
#define BRROUND_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include "brwidget.h"
|
|
|
|
#include "brresult.h"
|
|
|
|
|
|
|
|
class BRCategory;
|
|
|
|
|
|
|
|
class BRRound : public BRWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString name READ getName NOTIFY metadataChanged)
|
|
|
|
Q_PROPERTY(QList<QObject*> results READ getResultsQML NOTIFY resultsChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
friend class BRProvider;
|
|
|
|
friend class BRCategory;
|
|
|
|
|
|
|
|
typedef struct {
|
2020-11-15 14:48:12 +01:00
|
|
|
BRRound* round;
|
2020-11-04 13:55:37 +01:00
|
|
|
|
|
|
|
QString name;
|
|
|
|
QList<BRResult*> results;
|
|
|
|
} BRRoundData;
|
|
|
|
|
|
|
|
BRWidget::BRWidgetStatusCode load() override;
|
|
|
|
|
|
|
|
Q_INVOKABLE BRCategory* getCategory() const;
|
|
|
|
|
2020-11-15 14:48:12 +01:00
|
|
|
Q_INVOKABLE bool isGeneralResult() const;
|
|
|
|
|
2020-11-04 13:55:37 +01:00
|
|
|
Q_INVOKABLE QString getName();
|
2020-11-15 14:48:12 +01:00
|
|
|
Q_INVOKABLE QList<BRResult*> getResults();
|
2020-11-04 13:55:37 +01:00
|
|
|
Q_INVOKABLE QList<QObject*> getResultsQML();
|
|
|
|
|
2020-11-04 17:25:28 +01:00
|
|
|
BRRoundData getData();
|
2020-11-04 13:55:37 +01:00
|
|
|
|
2020-11-15 14:48:12 +01:00
|
|
|
static bool lessThan(BRRound* round1, BRRound* round2);
|
|
|
|
|
2020-11-04 13:55:37 +01:00
|
|
|
private:
|
2020-11-15 14:48:12 +01:00
|
|
|
BRRound(BRProvider* provider, BRWidget::BRFederation federation, int id, BRRoundData initialData, bool generalResult = false);
|
2020-11-04 13:55:37 +01:00
|
|
|
void setData(BRRoundData data);
|
|
|
|
|
|
|
|
BRCategory* category;
|
2020-11-15 14:48:12 +01:00
|
|
|
bool generalResult;
|
2020-11-04 13:55:37 +01:00
|
|
|
|
|
|
|
QString name;
|
|
|
|
QList<BRResult*> results;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void metadataChanged();
|
|
|
|
void resultsChanged();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BRROUND_H
|