QXmpp Version: 1.10.4
 
Loading...
Searching...
No Matches
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:
19 QXmppArchiveMessage();
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:
42 QXmppArchiveChat();
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
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
126 void setResultSetQuery(const QXmppResultSetQuery &rsm);
127
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:
187 QXmppArchiveRetrieveIq();
188
189 QDateTime start() const;
190 void setStart(const QDateTime &start);
191
192 QString with() const;
193 void setWith(const QString &with);
194
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
QXmppResultSetReply resultSetReply() const
Definition QXmppArchiveIq.cpp:205
void setResultSetReply(const QXmppResultSetReply &rsm)
Definition QXmppArchiveIq.cpp:215
QXmppArchiveChat chat() const
Returns the chat conversation carried by this IQ.
Definition QXmppArchiveIq.cpp:189
void setChat(const QXmppArchiveChat &chat)
Sets the chat conversation carried by this IQ.
Definition QXmppArchiveIq.cpp:195
The QXmppArchiveChat class represents an archived conversation as defined by XEP-0136: Message Archiv...
Definition QXmppArchiveIq.h:40
void setVersion(int version)
Sets the conversation's version.
Definition QXmppArchiveIq.cpp:171
int version() const
Returns the conversation's version.
Definition QXmppArchiveIq.cpp:165
QString subject() const
Returns the conversation's subject.
Definition QXmppArchiveIq.cpp:141
QString thread() const
Returns the conversation's thread.
Definition QXmppArchiveIq.cpp:153
void setThread(const QString &thread)
Sets the conversation's thread.
Definition QXmppArchiveIq.cpp:159
void setStart(const QDateTime &start)
Sets the start of this conversation.
Definition QXmppArchiveIq.cpp:135
QList< QXmppArchiveMessage > messages() const
Returns the conversation's messages.
Definition QXmppArchiveIq.cpp:117
QDateTime start() const
Returns the start of this conversation.
Definition QXmppArchiveIq.cpp:129
void setWith(const QString &with)
Sets the JID of the remote party.
Definition QXmppArchiveIq.cpp:183
QString with() const
Returns the JID of the remote party.
Definition QXmppArchiveIq.cpp:177
void setSubject(const QString &subject)
Sets the conversation's subject.
Definition QXmppArchiveIq.cpp:147
void setMessages(const QList< QXmppArchiveMessage > &messages)
Sets the conversation's messages.
Definition QXmppArchiveIq.cpp:123
QDateTime end() const
Returns the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:283
void setResultSetReply(const QXmppResultSetReply &rsm)
Definition QXmppArchiveIq.cpp:329
QDateTime start() const
Returns the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:271
QXmppResultSetQuery resultSetQuery() const
Definition QXmppArchiveIq.cpp:299
QList< QXmppArchiveChat > chats() const
Returns the list of chat conversations.
Definition QXmppArchiveIq.cpp:247
void setStart(const QDateTime &start)
Sets the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:277
QXmppResultSetReply resultSetReply() const
Definition QXmppArchiveIq.cpp:319
void setResultSetQuery(const QXmppResultSetQuery &rsm)
Definition QXmppArchiveIq.cpp:309
QXmppArchiveListIq()
Constructs a QXmppArchiveListIq.
Definition QXmppArchiveIq.cpp:241
QString with() const
Returns the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:259
void setChats(const QList< QXmppArchiveChat > &chats)
Sets the list of chat conversations.
Definition QXmppArchiveIq.cpp:253
void setEnd(const QDateTime &end)
Sets the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:289
void setWith(const QString &with)
Sets the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:265
bool isReceived() const
Returns true if the archived message was received, false if it was sent.
Definition QXmppArchiveIq.cpp:47
void setBody(const QString &body)
Sets the archived message's body.
Definition QXmppArchiveIq.cpp:29
QString body() const
Returns the archived message's body.
Definition QXmppArchiveIq.cpp:23
void setDate(const QDateTime &date)
Sets the archived message's date.
Definition QXmppArchiveIq.cpp:41
void setReceived(bool isReceived)
Set to true if the archived message was received, false if it was sent.
Definition QXmppArchiveIq.cpp:53
QDateTime date() const
Returns the archived message's date.
Definition QXmppArchiveIq.cpp:35
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
QString with() const
Returns the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:401
QDateTime start() const
Returns the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:413
void setEnd(const QDateTime &end)
Sets the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:431
QDateTime end() const
Returns the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:425
void setWith(const QString &with)
Sets the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:407
void setStart(const QDateTime &start)
Sets the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:419
void setWith(const QString &with)
Sets the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:491
QString with() const
Returns the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:485
QDateTime start() const
Returns the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:473
void setStart(const QDateTime &start)
Sets the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:479
QXmppResultSetQuery resultSetQuery() const
Definition QXmppArchiveIq.cpp:501
void setResultSetQuery(const QXmppResultSetQuery &rsm)
Definition QXmppArchiveIq.cpp:511
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:34
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