Herunterladen als
root/example/models/person.h @ 6d91d381
9d05e414 | Christian Ehringfeld | #ifndef PERSON_H
|
|
#define PERSON_H
|
|||
#include <QDateTime>
|
|||
#include <QString>
|
|||
#include <QList>
|
|||
#include <QObject>
|
|||
bb5e9339 | SebastianDiel | #include "../../src/entity.h"
|
|
9d05e414 | Christian Ehringfeld | #include <QAbstractListModel>
|
|
#include <QDebug>
|
|||
ba6f6521 | Christian Ehringfeld | enum Gender {MALE, FEMALE, UNKNOWNGENDER};
|
|
Q_DECLARE_METATYPE(Gender)
|
|||
9d05e414 | Christian Ehringfeld | class Person: public CuteEntityManager::Entity {
|
|
Q_OBJECT
|
|||
ba6f6521 | Christian Ehringfeld | //Q_ENUMS(Gender)
|
|
Q_PROPERTY(QString firstName READ getFirstName WRITE setFirstName NOTIFY
|
|||
firstNameChanged)
|
|||
Q_PROPERTY(QString familyName READ getFamilyName WRITE setFamilyName NOTIFY
|
|||
familyNameChanged)
|
|||
Q_PROPERTY(QString namePrefix READ getNamePrefix WRITE setNamePrefix NOTIFY
|
|||
namePrefixChanged)
|
|||
Q_PROPERTY(QString nickName READ getNickName WRITE setNickName NOTIFY
|
|||
nickNameChanged)
|
|||
Q_PROPERTY(QString customPictureFileName READ getCustomPictureFileName WRITE
|
|||
setCustomPictureFileName NOTIFY
|
|||
customPictureFileNameChanged)
|
|||
Q_PROPERTY(QDate birthday READ getBirthday WRITE setBirthday NOTIFY
|
|||
birthdayChanged)
|
|||
Q_PROPERTY(Gender gender READ getGender WRITE setGender NOTIFY genderChanged)
|
|||
9d05e414 | Christian Ehringfeld | ||
signals:
|
|||
void firstNameChanged();
|
|||
void familyNameChanged();
|
|||
void namePrefixChanged();
|
|||
void nickNameChanged();
|
|||
void birthdayChanged();
|
|||
void genderChanged();
|
|||
void customPictureFileNameChanged();
|
|||
public:
|
|||
QString toString();
|
|||
ba6f6521 | Christian Ehringfeld | Person(QObject *parent = 0);
|
|
9d05e414 | Christian Ehringfeld | Person(QString firstName,
|
|
QString familyName,
|
|||
ba6f6521 | Christian Ehringfeld | Gender gender = UNKNOWNGENDER,
|
|
9d05e414 | Christian Ehringfeld | QString customPictureFileName = QString(),
|
|
QString namePrefix = QString(),
|
|||
QString nickName = QString(),
|
|||
QDate birthday = QDate(),
|
|||
QObject *parent = 0);
|
|||
ba6f6521 | Christian Ehringfeld | virtual ~Person() {}
|
|
9d05e414 | Christian Ehringfeld | ||
ba6f6521 | Christian Ehringfeld | QString getCustomPictureFileName() const;
|
|
void setCustomPictureFileName(const QString &value);
|
|||
9d05e414 | Christian Ehringfeld | ||
ba6f6521 | Christian Ehringfeld | Gender getGender() const;
|
|
void setGender(const Gender &value);
|
|||
9d05e414 | Christian Ehringfeld | ||
ba6f6521 | Christian Ehringfeld | QDate getBirthday() const;
|
|
void setBirthday(const QDate &value);
|
|||
9d05e414 | Christian Ehringfeld | ||
ba6f6521 | Christian Ehringfeld | QString getNickName() const;
|
|
void setNickName(const QString &value);
|
|||
QString getNamePrefix() const;
|
|||
void setNamePrefix(const QString &value);
|
|||
QString getFamilyName() const;
|
|||
void setFamilyName(const QString &value);
|
|||
QString getFirstName() const;
|
|||
void setFirstName(const QString &value);
|
|||
9d05e414 | Christian Ehringfeld | ||
protected:
|
|||
// members
|
|||
ba6f6521 | Christian Ehringfeld | QString firstName;
|
|
QString familyName;
|
|||
QString namePrefix;
|
|||
QString nickName;
|
|||
QDate birthday;
|
|||
Gender gender;
|
|||
QString customPictureFileName;
|
|||
9d05e414 | Christian Ehringfeld | ||
};
|
|||
ba6f6521 | Christian Ehringfeld | ||
9d05e414 | Christian Ehringfeld | #endif // PERSON_H
|