app/headers/cup/brcup.h

43 lines
920 B
C
Raw Normal View History

2020-10-31 15:16:06 +01:00
#ifndef BRCUP_H
#define BRCUP_H
#include <QObject>
#include <QDebug>
2020-10-31 15:16:06 +01:00
#include "brwidget.h"
#include "brcategory.h"
2020-10-31 15:16:06 +01:00
class BRCup : public BRWidget
{
Q_OBJECT
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:
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