42 lines
920 B
C++
42 lines
920 B
C++
#ifndef BRCUP_H
|
|
#define BRCUP_H
|
|
|
|
#include <QObject>
|
|
#include <QDebug>
|
|
|
|
#include "brwidget.h"
|
|
#include "brcategory.h"
|
|
|
|
class BRCup : public BRWidget
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QString name READ getName NOTIFY metadataChanged)
|
|
Q_PROPERTY(QList<QObject*> categories READ getCategoriesQML NOTIFY categoriesChanged)
|
|
|
|
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();
|
|
};
|
|
|
|
#endif // BRCUP_H
|