Herunterladen als
root/samples/example/models/contact.h @ e2ee17bf
1cee0f5b | Christian Ehringfeld | #ifndef CONTACT_H
|
|
#define CONTACT_H
|
|||
#include <QString>
|
|||
#include "entity.h"
|
|||
af84b9c4 | Christian Ehringfeld | class Relation;
|
|
class Person;
|
|||
class Pupil;
|
|||
5c3d9487 | Christian Ehringfeld | class Contact: public CuteEntityManager::Entity {
|
|
1cee0f5b | Christian Ehringfeld | Q_OBJECT
|
|
3fd96253 | Christian Ehringfeld | Q_PROPERTY(QString content READ getContent WRITE setContent)
|
|
5c3d9487 | Christian Ehringfeld | Q_PROPERTY(Category category READ getCategory WRITE setCategory)
|
|
3fd96253 | Christian Ehringfeld | Q_PROPERTY(QString label READ getLabel WRITE setLabel)
|
|
af84b9c4 | Christian Ehringfeld | Q_PROPERTY(QList<QSharedPointer<Person>> persons READ
|
|
getPersons WRITE setPersons)
|
|||
Q_PROPERTY(QList<QSharedPointer<Pupil>> pupils READ
|
|||
getPupils WRITE setPupils)
|
|||
1cee0f5b | Christian Ehringfeld | ||
5c3d9487 | Christian Ehringfeld | public:
|
|
enum Category {EMAIL, MOBILE, LANDLINE, MESSENGER, EXTRA} ;
|
|||
Q_ENUM(Category)
|
|||
1cee0f5b | Christian Ehringfeld | Q_INVOKABLE Contact() {}
|
|
5c3d9487 | Christian Ehringfeld | Contact(QString label, Category category, QString content);
|
|
af84b9c4 | Christian Ehringfeld | const QHash<QString, CuteEntityManager::Relation> getRelations() const
|
|
override;
|
|||
1cee0f5b | Christian Ehringfeld | ||
3fd96253 | Christian Ehringfeld | QString getContent() const;
|
|
void setContent(const QString &value);
|
|||
1cee0f5b | Christian Ehringfeld | ||
3fd96253 | Christian Ehringfeld | QString getLabel() const;
|
|
void setLabel(const QString &value);
|
|||
1cee0f5b | Christian Ehringfeld | ||
5c3d9487 | Christian Ehringfeld | Category getCategory() const;
|
|
void setCategory(const Category &value);
|
|||
af84b9c4 | Christian Ehringfeld | QList<QSharedPointer<Person> > getPersons() const;
|
|
void setPersons(const QList<QSharedPointer<Person> > &value);
|
|||
QList<QSharedPointer<Pupil> > getPupils() const;
|
|||
void setPupils(const QList<QSharedPointer<Pupil> > &value);
|
|||
1cee0f5b | Christian Ehringfeld | protected:
|
|
3fd96253 | Christian Ehringfeld | QString content;
|
|
5c3d9487 | Christian Ehringfeld | Category category;
|
|
3fd96253 | Christian Ehringfeld | QString label;
|
|
af84b9c4 | Christian Ehringfeld | QList<QSharedPointer<Person>> persons;
|
|
QList<QSharedPointer<Pupil>> pupils;
|
|||
1cee0f5b | Christian Ehringfeld | };
|
|
#endif // CONTACT_H
|