QXmppVCardIq.h
/*
* Copyright (C) 2008-2014 The QXmpp developers
*
* Author:
* Manjeet Dahiya
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
#ifndef QXMPPVCARDIQ_H
#define QXMPPVCARDIQ_H
#include "QXmppIq.h"
#include <QDate>
#include <QMap>
#include <QDomElement>
class QXmppVCardAddressPrivate;
class QXmppVCardEmailPrivate;
class QXmppVCardPhonePrivate;
class QXmppVCardOrganizationPrivate;
class QXmppVCardIqPrivate;
class QXMPP_EXPORT QXmppVCardAddress
{
public:
enum TypeFlag {
None = 0x0,
Home = 0x1,
Work = 0x2,
Postal = 0x4,
Preferred = 0x8
};
Q_DECLARE_FLAGS(Type, TypeFlag)
QXmppVCardAddress();
QXmppVCardAddress(const QXmppVCardAddress &other);
~QXmppVCardAddress();
QXmppVCardAddress& operator=(const QXmppVCardAddress &other);
QString country() const;
void setCountry(const QString &country);
QString locality() const;
void setLocality(const QString &locality);
QString postcode() const;
void setPostcode(const QString &postcode);
QString region() const;
void setRegion(const QString &region);
QString street() const;
void setStreet(const QString &street);
Type type() const;
void setType(Type type);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *stream) const;
private:
QSharedDataPointer<QXmppVCardAddressPrivate> d;
};
QXMPP_EXPORT bool operator==(const QXmppVCardAddress&, const QXmppVCardAddress&);
QXMPP_EXPORT bool operator!=(const QXmppVCardAddress&, const QXmppVCardAddress&);
class QXMPP_EXPORT QXmppVCardEmail
{
public:
enum TypeFlag {
None = 0x0,
Home = 0x1,
Work = 0x2,
Internet = 0x4,
Preferred = 0x8,
X400 = 0x10
};
Q_DECLARE_FLAGS(Type, TypeFlag)
QXmppVCardEmail();
QXmppVCardEmail(const QXmppVCardEmail &other);
~QXmppVCardEmail();
QXmppVCardEmail& operator=(const QXmppVCardEmail &other);
QString address() const;
void setAddress(const QString &address);
Type type() const;
void setType(Type type);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *stream) const;
private:
QSharedDataPointer<QXmppVCardEmailPrivate> d;
};
QXMPP_EXPORT bool operator==(const QXmppVCardEmail&, const QXmppVCardEmail&);
QXMPP_EXPORT bool operator!=(const QXmppVCardEmail&, const QXmppVCardEmail&);
class QXMPP_EXPORT QXmppVCardPhone
{
public:
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);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *stream) const;
private:
QSharedDataPointer<QXmppVCardPhonePrivate> d;
};
QXMPP_EXPORT bool operator==(const QXmppVCardPhone&, const QXmppVCardPhone&);
QXMPP_EXPORT bool operator!=(const QXmppVCardPhone&, const QXmppVCardPhone&);
class QXMPP_EXPORT QXmppVCardOrganization
{
public:
QXmppVCardOrganization();
QXmppVCardOrganization(const QXmppVCardOrganization &other);
~QXmppVCardOrganization();
QXmppVCardOrganization& operator=(const QXmppVCardOrganization &other);
QString organization() const;
void setOrganization(const QString&);
QString unit() const;
void setUnit(const QString&);
QString title() const;
void setTitle(const QString&);
QString role() const;
void setRole(const QString&);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *stream) const;
private:
QSharedDataPointer<QXmppVCardOrganizationPrivate> d;
};
QXMPP_EXPORT bool operator==(const QXmppVCardOrganization&, const QXmppVCardOrganization&);
QXMPP_EXPORT bool operator!=(const QXmppVCardOrganization&, const QXmppVCardOrganization&);
class QXMPP_EXPORT QXmppVCardIq : public QXmppIq
{
public:
QXmppVCardIq(const QString& bareJid = QString());
QXmppVCardIq(const QXmppVCardIq &other);
~QXmppVCardIq();
QXmppVCardIq& operator=(const QXmppVCardIq &other);
QDate birthday() const;
void setBirthday(const QDate &birthday);
QString description() const;
void setDescription(const QString &description);
QString email() const;
void setEmail(const QString&);
QString firstName() const;
void setFirstName(const QString&);
QString fullName() const;
void setFullName(const QString&);
QString lastName() const;
void setLastName(const QString&);
QString middleName() const;
void setMiddleName(const QString&);
QString nickName() const;
void setNickName(const QString&);
QByteArray photo() const;
void setPhoto(const QByteArray&);
QString photoType() const;
void setPhotoType(const QString &type);
QString url() const;
void setUrl(const QString&);
QList<QXmppVCardAddress> addresses() const;
void setAddresses(const QList<QXmppVCardAddress> &addresses);
QList<QXmppVCardEmail> emails() const;
void setEmails(const QList<QXmppVCardEmail> &emails);
QList<QXmppVCardPhone> phones() const;
void setPhones(const QList<QXmppVCardPhone> &phones);
QXmppVCardOrganization organization() const;
void setOrganization(const QXmppVCardOrganization&);
static bool isVCard(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement&);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
private:
QSharedDataPointer<QXmppVCardIqPrivate> d;
};
QXMPP_EXPORT bool operator==(const QXmppVCardIq&, const QXmppVCardIq&);
QXMPP_EXPORT bool operator!=(const QXmppVCardIq&, const QXmppVCardIq&);
#endif // QXMPPVCARDIQ_H
QXmppVCardPhone
Represents a vCard phone number.
Definition: QXmppVCardIq.h:132
QXmppVCardAddress::TypeFlag
TypeFlag
Describes e-mail address types.
Definition: QXmppVCardIq.h:45
QXmppVCardPhone::TypeFlag
TypeFlag
Describes phone number types.
Definition: QXmppVCardIq.h:136
QXmppVCardEmail::TypeFlag
TypeFlag
Describes e-mail address types.
Definition: QXmppVCardIq.h:96
QXmppVCardIq
Represents the XMPP vCard.
Definition: QXmppVCardIq.h:226
QXmppVCardEmail
Represents a vCard e-mail address.
Definition: QXmppVCardIq.h:92
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppVCardAddress
Represent a vCard address.
Definition: QXmppVCardIq.h:41
QXmppVCardOrganization
Represents organization information in XMPP vCards.
Definition: QXmppVCardIq.h:183
QXmppIq::operator=
QXmppIq & operator=(const QXmppIq &other)
Assigns other to this IQ.
Definition: QXmppIq.cpp:70