Loading...
Searching...
No Matches
QXmppVCardIq.h
// SPDX-FileCopyrightText: 2010 Manjeet Dahiya <manjeetdahiya@gmail.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPVCARDIQ_H
#define QXMPPVCARDIQ_H
#include "QXmppIq.h"
#include <QDate>
#include <QDomElement>
#include <QMap>
namespace QXmpp::Private {
struct VCardData;
}
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 &&);
~QXmppVCardAddress();
QXmppVCardAddress &operator=(const QXmppVCardAddress &other);
QXmppVCardAddress &operator=(QXmppVCardAddress &&);
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);
static constexpr std::tuple XmlTag = { u"ADR", QXmpp::Private::ns_vcard };
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);
static constexpr std::tuple XmlTag = { u"EMAIL", QXmpp::Private::ns_vcard };
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);
static constexpr std::tuple XmlTag = { u"TEL", QXmpp::Private::ns_vcard };
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() override;
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 constexpr std::tuple PayloadXmlTag = { u"vCard", QXmpp::Private::ns_vcard };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isVCard(const QDomElement &element);
[[deprecated]]
static bool checkIqType(const QString &tagName, const QString &xmlNamespace);
protected:
friend struct QXmpp::Private::VCardData;
void parseElementFromChild(const QDomElement &) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QSharedDataPointer<QXmppVCardIqPrivate> d;
};
QXMPP_EXPORT bool operator==(const QXmppVCardIq &, const QXmppVCardIq &);
QXMPP_EXPORT bool operator!=(const QXmppVCardIq &, const QXmppVCardIq &);
#endif // QXMPPVCARDIQ_H
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppIq::type
QXmppIq::Type type() const
Definition QXmppIq.cpp:60
QXmppVCardAddress
Represent a vCard address.
Definition QXmppVCardIq.h:27
QXmppVCardAddress::TypeFlag
TypeFlag
Describes e-mail address types.
Definition QXmppVCardIq.h:30
QXmppVCardAddress::setPostcode
void setPostcode(const QString &postcode)
Sets the postcode.
Definition QXmppVCardIq.cpp:141
QXmppVCardAddress::QXmppVCardAddress
QXmppVCardAddress(const QXmppVCardAddress &other)
Copy-constructor.
QXmppVCardAddress::setRegion
void setRegion(const QString &region)
Sets the region.
Definition QXmppVCardIq.cpp:153
QXmppVCardAddress::setType
void setType(Type type)
Sets the address type, which is a combination of TypeFlag.
Definition QXmppVCardIq.cpp:177
QXmppVCardAddress::QXmppVCardAddress
QXmppVCardAddress(QXmppVCardAddress &&)
Move-constructor.
QXmppVCardAddress::type
Type type() const
Returns the address type, which is a combination of TypeFlag.
Definition QXmppVCardIq.cpp:171
QXmppVCardAddress::region
QString region() const
Returns the region.
Definition QXmppVCardIq.cpp:147
QXmppVCardAddress::operator=
QXmppVCardAddress & operator=(const QXmppVCardAddress &other)
Assignment operator.
QXmppVCardAddress::setLocality
void setLocality(const QString &locality)
Sets the locality.
Definition QXmppVCardIq.cpp:128
QXmppVCardAddress::street
QString street() const
Returns the street address.
Definition QXmppVCardIq.cpp:159
QXmppVCardAddress::setStreet
void setStreet(const QString &street)
Sets the street address.
Definition QXmppVCardIq.cpp:165
QXmppVCardAddress::QXmppVCardAddress
QXmppVCardAddress()
Constructs an empty address.
Definition QXmppVCardIq.cpp:77
QXmppVCardAddress::postcode
QString postcode() const
Returns the postcode.
Definition QXmppVCardIq.cpp:135
QXmppVCardAddress::country
QString country() const
Returns the country.
Definition QXmppVCardIq.cpp:110
QXmppVCardAddress::locality
QString locality() const
Returns the locality.
Definition QXmppVCardIq.cpp:122
QXmppVCardAddress::operator=
QXmppVCardAddress & operator=(QXmppVCardAddress &&)
Move-assignment operator.
QXmppVCardAddress::setCountry
void setCountry(const QString &country)
Sets the country.
Definition QXmppVCardIq.cpp:116
QXmppVCardEmail
Represents a vCard e-mail address.
Definition QXmppVCardIq.h:81
QXmppVCardEmail::TypeFlag
TypeFlag
Describes e-mail address types.
Definition QXmppVCardIq.h:84
QXmppVCardEmail::setAddress
void setAddress(const QString &address)
Sets the e-mail address.
Definition QXmppVCardIq.cpp:264
QXmppVCardEmail::QXmppVCardEmail
QXmppVCardEmail(const QXmppVCardEmail &other)
Copy-constructor.
QXmppVCardEmail::address
QString address() const
Returns the e-mail address.
Definition QXmppVCardIq.cpp:258
QXmppVCardEmail::operator=
QXmppVCardEmail & operator=(const QXmppVCardEmail &other)
Copy-assignment operator.
QXmppVCardEmail::QXmppVCardEmail
QXmppVCardEmail()
Constructs an empty e-mail address.
Definition QXmppVCardIq.cpp:231
QXmppVCardEmail::setType
void setType(Type type)
Sets the e-mail type, which is a combination of TypeFlag.
Definition QXmppVCardIq.cpp:276
QXmppVCardEmail::type
Type type() const
Returns the e-mail type, which is a combination of TypeFlag.
Definition QXmppVCardIq.cpp:270
QXmppVCardIq
Represents the XMPP vCard.
Definition QXmppVCardIq.h:217
QXmppVCardIq::setPhoto
void setPhoto(const QByteArray &)
Sets the photo's binary contents.
Definition QXmppVCardIq.cpp:778
QXmppVCardIq::operator=
QXmppVCardIq & operator=(const QXmppVCardIq &other)
Assigns other to this vCard IQ.
Definition QXmppVCardIq.cpp:604
QXmppVCardIq::photo
QByteArray photo() const
Definition QXmppVCardIq.cpp:772
QXmppVCardIq::lastName
QString lastName() const
Returns the last name.
Definition QXmppVCardIq.cpp:704
QXmppVCardIq::nickName
QString nickName() const
Returns the nickname.
Definition QXmppVCardIq.cpp:728
QXmppVCardIq::birthday
QDate birthday() const
Returns the date of birth of the individual associated with the vCard.
Definition QXmppVCardIq.cpp:637
QXmppVCardIq::email
QString email() const
Returns the email address.
Definition QXmppVCardIq.cpp:661
QXmppVCardIq::photoType
QString photoType() const
Returns the photo's MIME type.
Definition QXmppVCardIq.cpp:784
QXmppVCardIq::setOrganization
void setOrganization(const QXmppVCardOrganization &)
Sets the organization info.
Definition QXmppVCardIq.cpp:838
QXmppVCardIq::setFullName
void setFullName(const QString &)
Sets the full name.
Definition QXmppVCardIq.cpp:698
QXmppVCardIq::fullName
QString fullName() const
Returns the full name.
Definition QXmppVCardIq.cpp:692
QXmppVCardIq::firstName
QString firstName() const
Returns the first name.
Definition QXmppVCardIq.cpp:680
QXmppVCardIq::middleName
QString middleName() const
Returns the middle name.
Definition QXmppVCardIq.cpp:716
QXmppVCardIq::setUrl
void setUrl(const QString &)
Definition QXmppVCardIq.cpp:754
QXmppVCardIq::organization
QXmppVCardOrganization organization() const
Returns the organization info.
Definition QXmppVCardIq.cpp:832
QXmppVCardIq::QXmppVCardIq
QXmppVCardIq(const QString &bareJid=QString())
Constructs a QXmppVCardIq for the specified recipient.
Definition QXmppVCardIq.cpp:586
QXmppVCardIq::emails
QList< QXmppVCardEmail > emails() const
Returns the e-mail addresses.
Definition QXmppVCardIq.cpp:808
QXmppVCardIq::url
QString url() const
Definition QXmppVCardIq.cpp:744
QXmppVCardIq::setFirstName
void setFirstName(const QString &)
Sets the first name.
Definition QXmppVCardIq.cpp:686
QXmppVCardIq::setDescription
void setDescription(const QString &description)
Sets the free-form descriptive text.
Definition QXmppVCardIq.cpp:655
QXmppVCardIq::setNickName
void setNickName(const QString &)
Sets the nickname.
Definition QXmppVCardIq.cpp:734
QXmppVCardIq::setMiddleName
void setMiddleName(const QString &)
Sets the middle name.
Definition QXmppVCardIq.cpp:722
QXmppVCardIq::setEmail
void setEmail(const QString &)
Sets the email address.
Definition QXmppVCardIq.cpp:671
QXmppVCardIq::phones
QList< QXmppVCardPhone > phones() const
Returns the phone numbers.
Definition QXmppVCardIq.cpp:820
QXmppVCardIq::setBirthday
void setBirthday(const QDate &birthday)
Sets the date of birth of the individual associated with the vCard.
Definition QXmppVCardIq.cpp:643
QXmppVCardIq::setPhotoType
void setPhotoType(const QString &type)
Sets the photo's MIME type.
Definition QXmppVCardIq.cpp:790
QXmppVCardIq::description
QString description() const
Returns the free-form descriptive text.
Definition QXmppVCardIq.cpp:649
QXmppVCardIq::setAddresses
void setAddresses(const QList< QXmppVCardAddress > &addresses)
Sets the addresses.
Definition QXmppVCardIq.cpp:802
QXmppVCardIq::setLastName
void setLastName(const QString &)
Sets the last name.
Definition QXmppVCardIq.cpp:710
QXmppVCardIq::addresses
QList< QXmppVCardAddress > addresses() const
Returns the addresses.
Definition QXmppVCardIq.cpp:796
QXmppVCardIq::setEmails
void setEmails(const QList< QXmppVCardEmail > &emails)
Sets the e-mail addresses.
Definition QXmppVCardIq.cpp:814
QXmppVCardIq::setPhones
void setPhones(const QList< QXmppVCardPhone > &phones)
Sets the phone numbers.
Definition QXmppVCardIq.cpp:826
QXmppVCardOrganization
Represents organization information in XMPP vCards.
Definition QXmppVCardIq.h:174
QXmppVCardOrganization::title
QString title() const
Returns the job title within the organization.
Definition QXmppVCardIq.cpp:524
QXmppVCardOrganization::role
QString role() const
Returns the job role within the organization.
Definition QXmppVCardIq.cpp:512
QXmppVCardOrganization::unit
QString unit() const
Returns the organization unit (also known as department).
Definition QXmppVCardIq.cpp:500
QXmppVCardOrganization::setRole
void setRole(const QString &)
Sets the job role within the organization.
Definition QXmppVCardIq.cpp:518
QXmppVCardOrganization::setTitle
void setTitle(const QString &)
Sets the job title within the organization.
Definition QXmppVCardIq.cpp:530
QXmppVCardOrganization::setUnit
void setUnit(const QString &)
Sets the unit within the organization.
Definition QXmppVCardIq.cpp:506
QXmppVCardOrganization::organization
QString organization() const
Returns the name of the organization.
Definition QXmppVCardIq.cpp:488
QXmppVCardOrganization::setOrganization
void setOrganization(const QString &)
Sets the organization name.
Definition QXmppVCardIq.cpp:494
QXmppVCardOrganization::operator=
QXmppVCardOrganization & operator=(const QXmppVCardOrganization &other)
Assigns other to this organization info.
Definition QXmppVCardIq.cpp:466
QXmppVCardOrganization::QXmppVCardOrganization
QXmppVCardOrganization()
Constructs an empty organization information.
Definition QXmppVCardIq.cpp:452
QXmppVCardPhone
Represents a vCard phone number.
Definition QXmppVCardIq.h:122
QXmppVCardPhone::setNumber
void setNumber(const QString &number)
Sets the phone number.
Definition QXmppVCardIq.cpp:358
QXmppVCardPhone::TypeFlag
TypeFlag
Describes phone number types.
Definition QXmppVCardIq.h:125
QXmppVCardPhone::type
Type type() const
Returns the phone number type, which is a combination of TypeFlag.
Definition QXmppVCardIq.cpp:364
QXmppVCardPhone::operator=
QXmppVCardPhone & operator=(const QXmppVCardPhone &other)
Copy-assignment operator.
QXmppVCardPhone::number
QString number() const
Returns the phone number.
Definition QXmppVCardIq.cpp:339
QXmppVCardPhone::QXmppVCardPhone
QXmppVCardPhone()
Constructs an empty phone number.
Definition QXmppVCardIq.cpp:325
QXmppVCardPhone::QXmppVCardPhone
QXmppVCardPhone(const QXmppVCardPhone &other)
Copy-constructor.
QXmppVCardPhone::setType
void setType(Type type)
Sets the phone number type, which is a combination of TypeFlag.
Definition QXmppVCardIq.cpp:370