QXmpp Version: 1.4.0
Loading...
Searching...
No Matches
QXmppPubSubIq.h
1/*
2 * Copyright (C) 2008-2021 The QXmpp developers
3 *
4 * Author:
5 * Jeremy Lainé
6 *
7 * Source:
8 * https://github.com/qxmpp-project/qxmpp
9 *
10 * This file is a part of QXmpp library.
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 */
23
24#ifndef QXMPPPUBSUBIQ_H
25#define QXMPPPUBSUBIQ_H
26
27#include "QXmppIq.h"
28
29#include <QSharedDataPointer>
30
31#if QXMPP_DEPRECATED_SINCE(1, 2)
32#include "QXmppPubSubItem.h"
33#endif
34
35class QXmppPubSubIqPrivate;
36
41
42class QXMPP_EXPORT QXmppPubSubIq : public QXmppIq
43{
44public:
46 enum QueryType {
47 AffiliationsQuery,
48 DefaultQuery,
49 ItemsQuery,
50 PublishQuery,
51 RetractQuery,
52 SubscribeQuery,
53 SubscriptionQuery,
54 SubscriptionsQuery,
55 UnsubscribeQuery
56 };
57
61
63
64 QXmppPubSubIq::QueryType queryType() const;
65 void setQueryType(QXmppPubSubIq::QueryType queryType);
66
67 QString queryJid() const;
68 void setQueryJid(const QString &jid);
69
70 QString queryNode() const;
71 void setQueryNode(const QString &node);
72
73 QList<QXmppPubSubItem> items() const;
74 void setItems(const QList<QXmppPubSubItem> &items);
75
76 QString subscriptionId() const;
77 void setSubscriptionId(const QString &id);
78
80 static bool isPubSubIq(const QDomElement &element);
82
83protected:
85 void parseElementFromChild(const QDomElement &) override;
86 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
88
89private:
90 QSharedDataPointer<QXmppPubSubIqPrivate> d;
91};
92
93#endif // QXMPPPUBSUBIQ_H
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppIq & operator=(const QXmppIq &other)
Assigns other to this IQ.
Definition: QXmppIq.cpp:68
The QXmppPubSubIq class represents an IQ used for the publish-subscribe mechanisms defined by XEP-006...
Definition: QXmppPubSubIq.h:43
QueryType
This enum is used to describe a publish-subscribe query type.
Definition: QXmppPubSubIq.h:46