QXmppRosterIq.h
/*
* Copyright (C) 2008-2021 The QXmpp developers
*
* Authors:
* Manjeet Dahiya
* Jeremy Lainé
*
* 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 QXMPPROSTERIQ_H
#define QXMPPROSTERIQ_H
#include "QXmppIq.h"
#include <QList>
#include <QSet>
#include <QSharedDataPointer>
class QXmppRosterIqPrivate;
class QXMPP_EXPORT QXmppRosterIq : public QXmppIq
{
public:
class ItemPrivate;
class QXMPP_EXPORT Item
{
public:
enum SubscriptionType {
None = 0,
From = 1,
To = 2,
Both = 3,
Remove = 4,
NotSet = 8
};
Item();
Item(const Item &other);
~Item();
Item &operator=(const Item &other);
QString bareJid() const;
QSet<QString> groups() const;
QString name() const;
QString subscriptionStatus() const;
SubscriptionType subscriptionType() const;
bool isApproved() const;
void setBareJid(const QString &);
void setGroups(const QSet<QString> &);
void setName(const QString &);
void setSubscriptionStatus(const QString &);
void setSubscriptionType(SubscriptionType);
void setIsApproved(bool);
// XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
bool isMixChannel() const;
void setIsMixChannel(bool);
QString mixParticipantId() const;
void setMixParticipantId(const QString &);
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
private:
QString getSubscriptionTypeStr() const;
void setSubscriptionTypeFromStr(const QString &);
QSharedDataPointer<ItemPrivate> d;
};
QXmppRosterIq();
QXmppRosterIq(const QXmppRosterIq &);
~QXmppRosterIq() override;
QXmppRosterIq &operator=(const QXmppRosterIq &);
QString version() const;
void setVersion(const QString &);
void addItem(const Item &);
QList<Item> items() const;
// XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
bool mixAnnotate() const;
void setMixAnnotate(bool);
static bool isRosterIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QSharedDataPointer<QXmppRosterIqPrivate> d;
};
#endif // QXMPPROSTERIQ_H
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppIq::operator=
QXmppIq & operator=(const QXmppIq &other)
Assigns other to this IQ.
Definition: QXmppIq.cpp:68
QXmppRosterIq::Item
The QXmppRosterIq::Item class represents a roster entry.
Definition: QXmppRosterIq.h:47
QXmppRosterIq::Item::SubscriptionType
SubscriptionType
An enumeration for type of subscription with the bareJid in the roster.
Definition: QXmppRosterIq.h:50
QXmppRosterIq
The QXmppRosterIq class represents a roster IQ.
Definition: QXmppRosterIq.h:41