QXmpp Version: 0.9.3
Loading...
Searching...
No Matches
QXmppPubSubIq.h
1/*
2 * Copyright (C) 2008-2014 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
32
33class QXMPP_EXPORT QXmppPubSubItem
34{
35public:
36 QString id() const;
37 void setId(const QString &id);
38
39 QXmppElement contents() const;
40 void setContents(const QXmppElement &contents);
41
43 void parse(const QDomElement &element);
44 void toXml(QXmlStreamWriter *writer) const;
46
47private:
48 QString m_id;
49 QXmppElement m_contents;
50};
51
56
57class QXMPP_EXPORT QXmppPubSubIq : public QXmppIq
58{
59public:
62 {
63 AffiliationsQuery,
64 DefaultQuery,
65 ItemsQuery,
66 PublishQuery,
67 RetractQuery,
68 SubscribeQuery,
69 SubscriptionQuery,
70 SubscriptionsQuery,
71 UnsubscribeQuery
72 };
73
74 QXmppPubSubIq::QueryType queryType() const;
75 void setQueryType(QXmppPubSubIq::QueryType queryType);
76
77 QString queryJid() const;
78 void setQueryJid(const QString &jid);
79
80 QString queryNode() const;
81 void setQueryNode(const QString &node);
82
83 QList<QXmppPubSubItem> items() const;
84 void setItems(const QList<QXmppPubSubItem> &items);
85
86 QString subscriptionId() const;
87 void setSubscriptionId(const QString &id);
88
90 static bool isPubSubIq(const QDomElement &element);
92
93protected:
95 void parseElementFromChild(const QDomElement&);
96 void toXmlElementFromChild(QXmlStreamWriter *writer) const;
98
99private:
100 QXmppPubSubIq::QueryType m_queryType;
101 QString m_queryJid;
102 QString m_queryNode;
103 QList<QXmppPubSubItem> m_items;
104 QString m_subscriptionId;
105 QString m_subscriptionType;
106};
107
108#endif
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:43
The QXmppPubSubIq class represents an IQ used for the publish-subscribe mechanisms defined by XEP-006...
Definition: QXmppPubSubIq.h:58
QueryType
This enum is used to describe a publish-subscribe query type.
Definition: QXmppPubSubIq.h:62
The QXmppPubSubItem class represents a publish-subscribe item as defined by XEP-0060: Publish-Subscri...
Definition: QXmppPubSubIq.h:34