2020-10-31 15:16:06 +01:00
|
|
|
#ifndef BRCUP_H
|
|
|
|
#define BRCUP_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2020-11-03 15:56:43 +01:00
|
|
|
#include <QDebug>
|
|
|
|
|
2020-10-31 15:16:06 +01:00
|
|
|
#include "brwidget.h"
|
2020-11-03 15:56:43 +01:00
|
|
|
#include "brcategory.h"
|
2020-10-31 15:16:06 +01:00
|
|
|
|
|
|
|
class BRCup : public BRWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-11-03 15:56:43 +01:00
|
|
|
Q_PROPERTY(QString name READ getName NOTIFY metadataChanged)
|
|
|
|
Q_PROPERTY(QList<QObject*> categories READ getCategoriesQML NOTIFY categoriesChanged)
|
|
|
|
|
2020-10-31 15:16:06 +01:00
|
|
|
public:
|
2020-11-03 15:56:43 +01:00
|
|
|
friend class BRProvider;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const BRCup* cup;
|
|
|
|
QString name;
|
|
|
|
QList<BRCategory*> categories;
|
|
|
|
} BRCupData;
|
|
|
|
|
|
|
|
Q_INVOKABLE BRWidget::BRWidgetStatusCode load() override;
|
|
|
|
|
|
|
|
Q_INVOKABLE QString getName();
|
|
|
|
Q_INVOKABLE QList<QObject*> getCategoriesQML();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BRCup(BRProvider* provider, BRWidget::BRFederation federation, int id, BRCupData initialData);
|
|
|
|
void setData(BRCupData data);
|
|
|
|
|
|
|
|
QString name;
|
|
|
|
QList<BRCategory*> categories;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void metadataChanged();
|
|
|
|
void categoriesChanged();
|
2020-10-31 15:16:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BRCUP_H
|