diff options
Diffstat (limited to 'src/base/QXmppVCardIq.h')
| -rw-r--r-- | src/base/QXmppVCardIq.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/base/QXmppVCardIq.h b/src/base/QXmppVCardIq.h index b32cc5f6..0e9a9862 100644 --- a/src/base/QXmppVCardIq.h +++ b/src/base/QXmppVCardIq.h @@ -31,6 +31,7 @@ #include <QDomElement> class QXmppVCardEmailPrivate; +class QXmppVCardPhonePrivate; class QXmppVCardIqPrivate; /// \brief Represents a vCard e-mail address. @@ -70,6 +71,51 @@ private: QSharedDataPointer<QXmppVCardEmailPrivate> d; }; +/// \brief Represents a vCard phone number. + +class QXmppVCardPhone +{ +public: + /// \brief Describes phone number types. + enum TypeFlag { + None = 0x0, + Home = 0x1, + Work = 0x2, + Voice = 0x4, + Fax = 0x8, + Pager = 0x10, + Messaging = 0x20, + Cell = 0x40, + Video = 0x80, + BBS = 0x100, + Modem = 0x200, + ISDN = 0x400, + PCS = 0x800, + Preferred = 0x1000 + }; + Q_DECLARE_FLAGS(Type, TypeFlag); + + QXmppVCardPhone(); + QXmppVCardPhone(const QXmppVCardPhone &other); + ~QXmppVCardPhone(); + + QXmppVCardPhone& operator=(const QXmppVCardPhone &other); + + QString number() const; + void setNumber(const QString &number); + + Type type() const; + void setType(Type type); + + /// \cond + void parse(const QDomElement &element); + void toXml(QXmlStreamWriter *stream) const; + /// \endcond + +private: + QSharedDataPointer<QXmppVCardPhonePrivate> d; +}; + /// \brief Represents the XMPP vCard. /// /// The functions names are self explanatory. @@ -121,6 +167,9 @@ public: QList<QXmppVCardEmail> emails() const; void setEmails(const QList<QXmppVCardEmail> &emails); + + QList<QXmppVCardPhone> phones() const; + void setPhones(const QList<QXmppVCardPhone> &phones); /// \cond static bool isVCard(const QDomElement &element); |
