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

73 lines
1.9 KiB
C++

#ifndef BRATHLETE_H
#define BRATHLETE_H
#include <QObject>
#include <QUrl>
#include "brwidget.h"
class BRAthlete : public BRWidget
{
Q_OBJECT
Q_PROPERTY(QString firstName READ getFirstName NOTIFY metadataChanged)
Q_PROPERTY(QString lastName READ getLastName NOTIFY metadataChanged)
Q_PROPERTY(QString city READ getCity NOTIFY metadataChanged)
Q_PROPERTY(QString federation READ getFederation NOTIFY metadataChanged)
Q_PROPERTY(QUrl federationUrl READ getFederationUrl NOTIFY metadataChanged)
Q_PROPERTY(int yearOfBirth READ getYearOfBirth NOTIFY metadataChanged)
Q_PROPERTY(BRAthleteGender gender READ getGender NOTIFY metadataChanged)
Q_PROPERTY(QString nation READ getNation NOTIFY metadataChanged)
Q_PROPERTY(int age READ getAge NOTIFY metadataChanged)
public:
friend class BRProvider;
enum BRAthleteGender {
Unknown = -1,
Male,
Female
};
typedef struct {
const BRAthlete* athlete;
QString firstName;
QString lastName;
QString city;
QString federation;
QUrl federationUrl;
int yearOfBirth;
BRAthleteGender gender;
QString nation;
int age;
} BRAthleteData;
BRWidget::BRWidgetStatusCode load() override;
QString getFirstName();
QString getLastName();
QString getCity();
QString getFederation();
QUrl getFederationUrl();
int getYearOfBirth();
BRAthleteGender getGender();
QString getNation();
int getAge();
private:
BRAthlete(BRProvider* provider, BRWidget::BRFederation federation, int id, BRAthleteData initialData);
void setData(BRAthleteData data);
QString firstName;
QString lastName;
QString city;
QString federation;
QUrl federationUrl;
int yearOfBirth;
BRAthleteGender gender;
QString nation;
int age;
signals:
void metadataChanged();
};
#endif // BRATHLETE_H