QXmpp Version: 1.10.0
QXmppArchiveIq.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPARCHIVEIQ_H
6#define QXMPPARCHIVEIQ_H
7
8#include "QXmppIq.h"
9#include "QXmppResultSet.h"
10
11#include <QDateTime>
12
15
16class QXMPP_EXPORT QXmppArchiveMessage
17{
18public:
20
21 QString body() const;
22 void setBody(const QString &body);
23
24 QDateTime date() const;
25 void setDate(const QDateTime &date);
26
27 bool isReceived() const;
28 void setReceived(bool isReceived);
29
30private:
31 QString m_body;
32 QDateTime m_date;
33 bool m_received;
34};
35
38
39class QXMPP_EXPORT QXmppArchiveChat
40{
41public:
43
44 QList<QXmppArchiveMessage> messages() const;
45 void setMessages(const QList<QXmppArchiveMessage> &messages);
46
47 QDateTime start() const;
48 void setStart(const QDateTime &start);
49
50 QString subject() const;
51 void setSubject(const QString &subject);
52
53 QString thread() const;
54 void setThread(const QString &thread);
55
56 int version() const;
57 void setVersion(int version);
58
59 QString with() const;
60 void setWith(const QString &with);
61
63 void parse(const QDomElement &element);
64 void toXml(QXmlStreamWriter *writer, const QXmppResultSetReply &rsm = QXmppResultSetReply()) const;
66
67private:
68 QList<QXmppArchiveMessage> m_messages;
69 QDateTime m_start;
70 QString m_subject;
71 QString m_thread;
72 int m_version;
73 QString m_with;
74};
75
81
82class QXMPP_EXPORT QXmppArchiveChatIq : public QXmppIq
83{
84public:
85 QXmppArchiveChat chat() const;
86 void setChat(const QXmppArchiveChat &chat);
87
88 QXmppResultSetReply resultSetReply() const;
89 void setResultSetReply(const QXmppResultSetReply &rsm);
90
92 static bool isArchiveChatIq(const QDomElement &element);
93
94protected:
95 void parseElementFromChild(const QDomElement &element) override;
96 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
98
99private:
100 QXmppArchiveChat m_chat;
101 QXmppResultSetReply m_rsmReply;
102};
103
107
108class QXMPP_EXPORT QXmppArchiveListIq : public QXmppIq
109{
110public:
112
113 QList<QXmppArchiveChat> chats() const;
114 void setChats(const QList<QXmppArchiveChat> &chats);
115
116 QString with() const;
117 void setWith(const QString &with);
118
119 QDateTime start() const;
120 void setStart(const QDateTime &start);
121
122 QDateTime end() const;
123 void setEnd(const QDateTime &end);
124
125 QXmppResultSetQuery resultSetQuery() const;
126 void setResultSetQuery(const QXmppResultSetQuery &rsm);
127
128 QXmppResultSetReply resultSetReply() const;
129 void setResultSetReply(const QXmppResultSetReply &rsm);
130
132 static bool isArchiveListIq(const QDomElement &element);
134
135protected:
137 void parseElementFromChild(const QDomElement &element) override;
138 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
140
141private:
142 QString m_with;
143 QDateTime m_start;
144 QDateTime m_end;
145 QList<QXmppArchiveChat> m_chats;
146 QXmppResultSetQuery m_rsmQuery;
147 QXmppResultSetReply m_rsmReply;
148};
149
153
154class QXMPP_EXPORT QXmppArchiveRemoveIq : public QXmppIq
155{
156public:
157 QString with() const;
158 void setWith(const QString &with);
159
160 QDateTime start() const;
161 void setStart(const QDateTime &start);
162
163 QDateTime end() const;
164 void setEnd(const QDateTime &end);
165
167 static bool isArchiveRemoveIq(const QDomElement &element);
168
169protected:
170 void parseElementFromChild(const QDomElement &element) override;
171 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
173
174private:
175 QString m_with;
176 QDateTime m_start;
177 QDateTime m_end;
178};
179
183
184class QXMPP_EXPORT QXmppArchiveRetrieveIq : public QXmppIq
185{
186public:
188
189 QDateTime start() const;
190 void setStart(const QDateTime &start);
191
192 QString with() const;
193 void setWith(const QString &with);
194
195 QXmppResultSetQuery resultSetQuery() const;
196 void setResultSetQuery(const QXmppResultSetQuery &rsm);
197
199 static bool isArchiveRetrieveIq(const QDomElement &element);
200
201protected:
202 void parseElementFromChild(const QDomElement &element) override;
203 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
205
206private:
207 QString m_with;
208 QDateTime m_start;
209 QXmppResultSetQuery m_rsmQuery;
210};
211
215
216class QXMPP_EXPORT QXmppArchivePrefIq : public QXmppIq
217{
218public:
220 static bool isArchivePrefIq(const QDomElement &element);
221
222protected:
223 void parseElementFromChild(const QDomElement &element) override;
224 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
226};
227
228#endif // QXMPPARCHIVEIQ_H
Represents an archive chat as defined by XEP-0136: Message Archiving.
Definition: QXmppArchiveIq.h:83
The QXmppArchiveChat class represents an archived conversation as defined by XEP-0136: Message Archiv...
Definition: QXmppArchiveIq.h:40
Represents an archive list as defined by XEP-0136: Message Archiving.
Definition: QXmppArchiveIq.h:109
The QXmppArchiveMessage class represents an archived message as defined by XEP-0136: Message Archivin...
Definition: QXmppArchiveIq.h:17
Represents an archive preference IQ as defined by XEP-0136: Message Archiving.
Definition: QXmppArchiveIq.h:217
Represents an archive remove IQ as defined by XEP-0136: Message Archiving.
Definition: QXmppArchiveIq.h:155
Represents an archive retrieve IQ as defined by XEP-0136: Message Archiving.
Definition: QXmppArchiveIq.h:185
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:23
The QXmppResultSetQuery class represents a set element in a query as defined by XEP-0059: Result Set ...
Definition: QXmppResultSet.h:16
The QXmppResultSetReply class represents a set element in a reply as defined by XEP-0059: Result Set ...
Definition: QXmppResultSet.h:50