storevcard.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef STOREVCARD_H
  2. #define STOREVCARD_H
  3. #include <QObject>
  4. #include <QDomDocument>
  5. #include <QDomElement>
  6. class vCardData
  7. {
  8. public:
  9. QString nickName;
  10. QString firstName;
  11. QString middleName;
  12. QString lastName;
  13. QString url;
  14. QString eMail;
  15. QString fullName;
  16. vCardData() {
  17. nickName = "";
  18. firstName = "";
  19. middleName = "";
  20. lastName = "";
  21. url = "";
  22. eMail = "";
  23. fullName = "";
  24. }
  25. bool isEmpty() {
  26. return (nickName.isEmpty() &&
  27. firstName.isEmpty() &&
  28. middleName.isEmpty() &&
  29. lastName.isEmpty() &&
  30. url.isEmpty() &&
  31. eMail.isEmpty() &&
  32. fullName.isEmpty()
  33. );
  34. }
  35. };
  36. class StoreVCard : public QObject
  37. {
  38. Q_OBJECT
  39. //QDomDocument *vCardXMLDoc;
  40. //QDomElement rootVCard;
  41. QString pathCache;
  42. //void setElementStore( const QString &nodeName, const QString &text );
  43. QString getElementStore( const QDomDocument *doc, const QString &nodeName );
  44. public:
  45. explicit StoreVCard(QObject *parent = 0);
  46. void setCachePath( const QString &path ) {
  47. pathCache = path;
  48. }
  49. bool setVCard( const QString &bareJid, vCardData &vCard );
  50. vCardData getVCard( const QString &bareJid );
  51. signals:
  52. public slots:
  53. private:
  54. QString m_birthday;
  55. QString m_url;
  56. };
  57. #endif // STOREVCARD_H