qmlvcard.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef QMLVCARD_H
  2. #define QMLVCARD_H
  3. #include <QObject>
  4. class QMLVCard : public QObject
  5. {
  6. Q_OBJECT
  7. Q_DISABLE_COPY( QMLVCard )
  8. Q_PROPERTY( QString photo READ getPhoto NOTIFY vCardChanged )
  9. Q_PROPERTY( QString nickname READ getNickName NOTIFY vCardChanged )
  10. Q_PROPERTY( QString name READ getName NOTIFY vCardChanged )
  11. Q_PROPERTY( QString middlename READ getMiddleName NOTIFY vCardChanged )
  12. Q_PROPERTY( QString lastname READ getLastName NOTIFY vCardChanged )
  13. Q_PROPERTY( QString fullname READ getFullName NOTIFY vCardChanged )
  14. Q_PROPERTY( QString email READ getEMail NOTIFY vCardChanged )
  15. Q_PROPERTY( QString birthday READ getBirthday NOTIFY vCardChanged )
  16. Q_PROPERTY( QString url READ getUrl NOTIFY vCardChanged )
  17. Q_PROPERTY( QString jid READ getJid NOTIFY vCardChanged )
  18. Q_PROPERTY( QMLVCard* vcard READ getVCard WRITE setVCard NOTIFY vCardChanged )
  19. public:
  20. explicit QMLVCard(QObject *parent = 0);
  21. QString getPhoto() const { return m_photo; }
  22. void setPhoto( const QString &photo ) { if(photo != m_photo) { m_photo =photo; } }
  23. QString getNickName() const { return m_nickname; }
  24. void setNickName( const QString &value ) { if(value != m_nickname) { m_nickname =value; } }
  25. QString getName() const { return m_name; }
  26. void setName( const QString &value ) { if(value != m_name) { m_name =value; } }
  27. QString getMiddleName() const { return m_middlename; }
  28. void setMiddleName( const QString &value ) { if(value != m_middlename) { m_middlename =value; } }
  29. QString getLastName() const { return m_lastname; }
  30. void setLastName( const QString &value ) { if(value != m_lastname) { m_lastname =value; } }
  31. QString getFullName() const { return m_fullname; }
  32. void setFullName( const QString &value ) { if(value != m_fullname) { m_fullname =value; } }
  33. QString getEMail() const { return m_email; }
  34. void setEMail( const QString &value ) { if(value != m_email) { m_email =value; } }
  35. QString getBirthday() const { return m_birthday; }
  36. void setBirthday( const QString &value ) { if(value != m_birthday) { m_birthday =value; } }
  37. QString getUrl() const { return m_url; }
  38. void setUrl( const QString &value ) { if(value != m_url) { m_url =value; } }
  39. QMLVCard* getVCard() const { return m_vcard; }
  40. void setVCard( QMLVCard *value );
  41. QString getJid() const { return m_jid; }
  42. void setJid( const QString &value ) { if(value != m_jid) { m_jid =value; } }
  43. Q_INVOKABLE void clearData();
  44. signals:
  45. void vCardChanged();
  46. public slots:
  47. private:
  48. QString m_photo;
  49. QString m_nickname;
  50. QString m_name;
  51. QString m_middlename;
  52. QString m_lastname;
  53. QString m_fullname;
  54. QString m_email;
  55. QString m_birthday;
  56. QString m_url;
  57. QString m_jid;
  58. QMLVCard *m_vcard;
  59. };
  60. #endif // QMLVCARD_H