diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-08-03 15:46:40 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-08-03 15:46:40 +0200 |
| commit | becafc386f14967df87659cd408b5cee5835227d (patch) | |
| tree | fd20c05e26b5118682299db9ecf005241acd2a68 /src/base/QXmppVCardIq.h | |
| parent | a27aaa6f0dd18c859cee848dd5aac48cc6d1c89a (diff) | |
| download | qxmpp-becafc386f14967df87659cd408b5cee5835227d.tar.gz | |
add support for phone numbers to vCards
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); |
