QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppVCardIq.h
1 /*
2  * Copyright (C) 2008-2011 The QXmpp developers
3  *
4  * Author:
5  * Manjeet Dahiya
6  *
7  * Source:
8  * http://code.google.com/p/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 
25 #ifndef QXMPPVCARDIQ_H
26 #define QXMPPVCARDIQ_H
27 
28 #include "QXmppIq.h"
29 #include <QDate>
30 #include <QMap>
31 #include <QDomElement>
32 
33 class QImage;
34 
44 
45 class QXMPP_EXPORT QXmppVCardIq : public QXmppIq
46 {
47 public:
48  QXmppVCardIq(const QString& bareJid = "");
49 
50  QDate birthday() const;
51  void setBirthday(const QDate &birthday);
52 
53  QString email() const;
54  void setEmail(const QString&);
55 
56  QString firstName() const;
57  void setFirstName(const QString&);
58 
59  QString fullName() const;
60  void setFullName(const QString&);
61 
62  QString lastName() const;
63  void setLastName(const QString&);
64 
65  QString middleName() const;
66  void setMiddleName(const QString&);
67 
68  QString nickName() const;
69  void setNickName(const QString&);
70 
71  QByteArray photo() const;
72  void setPhoto(const QByteArray&);
73 
74  QString photoType() const;
75  void setPhotoType(const QString &type);
76 
77  QString url() const;
78  void setUrl(const QString&);
79 
81  static bool isVCard(const QDomElement &element);
83 
84 protected:
86  void parseElementFromChild(const QDomElement&);
87  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
89 
90 private:
91  QDate m_birthday;
92  QString m_email;
93  QString m_firstName;
94  QString m_fullName;
95  QString m_lastName;
96  QString m_middleName;
97  QString m_nickName;
98  QString m_url;
99 
100  // not as 64 base
101  QByteArray m_photo;
102  QString m_photoType;
103 };
104 
105 #endif // QXMPPVCARDIQ_H