QXmpp: QXmppArchiveIq.h Source File

QXmpp Version: 1.14.2

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
17 class QXMPP_EXPORT QXmppArchiveMessage
18{
19public:
20 QXmppArchiveMessage();
21
22 QString body() const;
23 void setBody(const QString &body);
24
25 QDateTime date() const;
26 void setDate(const QDateTime &date);
27
28 bool isReceived() const;
29 void setReceived(bool isReceived);
30
31private:
32 QString m_body;
33 QDateTime m_date;
34 bool m_received;
35};
36
41 class QXMPP_EXPORT QXmppArchiveChat
42{
43public:
44 QXmppArchiveChat();
45
46 QList<QXmppArchiveMessage> messages() const;
47 void setMessages(const QList<QXmppArchiveMessage> &messages);
48
49 QDateTime start() const;
50 void setStart(const QDateTime &start);
51
52 QString subject() const;
53 void setSubject(const QString &subject);
54
55 QString thread() const;
56 void setThread(const QString &thread);
57
58 int version() const;
59 void setVersion(int version);
60
61 QString with() const;
62 void setWith(const QString &with);
63
65 static constexpr std::tuple XmlTag = { u"chat", QXmpp::Private::ns_archive };
66 void parse(const QDomElement &element);
67 void toXml(QXmlStreamWriter *writer) const { toXml(writer, {}); }
68 void toXml(QXmlStreamWriter *writer, const QXmppResultSetReply &rsm) const;
70
71private:
72 QList<QXmppArchiveMessage> m_messages;
73 QDateTime m_start;
74 QString m_subject;
75 QString m_thread;
76 int m_version;
77 QString m_with;
78};
79
87 class QXMPP_EXPORT QXmppArchiveChatIq : public QXmppIq
88{
89public:
90 QXmppArchiveChat chat() const;
91 void setChat(const QXmppArchiveChat &chat);
92
93 QXmppResultSetReply resultSetReply() const;
94 void setResultSetReply(const QXmppResultSetReply &rsm);
95
97 static constexpr std::tuple PayloadXmlTag = { u"chat", QXmpp::Private::ns_archive };
98 [[deprecated("Use QXmpp::isIqElement()")]]
99 static bool isArchiveChatIq(const QDomElement &element);
100
101protected:
102 void parseElementFromChild(const QDomElement &element) override;
103 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
105
106private:
107 QXmppArchiveChat m_chat;
108 QXmppResultSetReply m_rsmReply;
109};
110
116 class QXMPP_EXPORT QXmppArchiveListIq : public QXmppIq
117{
118public:
119 QXmppArchiveListIq();
120
121 QList<QXmppArchiveChat> chats() const;
122 void setChats(const QList<QXmppArchiveChat> &chats);
123
124 QString with() const;
125 void setWith(const QString &with);
126
127 QDateTime start() const;
128 void setStart(const QDateTime &start);
129
130 QDateTime end() const;
131 void setEnd(const QDateTime &end);
132
133 QXmppResultSetQuery resultSetQuery() const;
134 void setResultSetQuery(const QXmppResultSetQuery &rsm);
135
136 QXmppResultSetReply resultSetReply() const;
137 void setResultSetReply(const QXmppResultSetReply &rsm);
138
140 static constexpr std::tuple PayloadXmlTag = { u"list", QXmpp::Private::ns_archive };
141 [[deprecated("Use QXmpp::isIqElement()")]]
142 static bool isArchiveListIq(const QDomElement &element);
144
145protected:
147 void parseElementFromChild(const QDomElement &element) override;
148 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
150
151private:
152 QString m_with;
153 QDateTime m_start;
154 QDateTime m_end;
155 QList<QXmppArchiveChat> m_chats;
156 QXmppResultSetQuery m_rsmQuery;
157 QXmppResultSetReply m_rsmReply;
158};
159
165 class QXMPP_EXPORT QXmppArchiveRemoveIq : public QXmppIq
166{
167public:
168 QString with() const;
169 void setWith(const QString &with);
170
171 QDateTime start() const;
172 void setStart(const QDateTime &start);
173
174 QDateTime end() const;
175 void setEnd(const QDateTime &end);
176
178 static constexpr std::tuple PayloadXmlTag = { u"remove", QXmpp::Private::ns_archive };
179 [[deprecated("Use QXmpp::isIqElement()")]]
180 static bool isArchiveRemoveIq(const QDomElement &element);
181
182protected:
183 void parseElementFromChild(const QDomElement &element) override;
184 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
186
187private:
188 QString m_with;
189 QDateTime m_start;
190 QDateTime m_end;
191};
192
198 class QXMPP_EXPORT QXmppArchiveRetrieveIq : public QXmppIq
199{
200public:
201 QXmppArchiveRetrieveIq();
202
203 QDateTime start() const;
204 void setStart(const QDateTime &start);
205
206 QString with() const;
207 void setWith(const QString &with);
208
209 QXmppResultSetQuery resultSetQuery() const;
210 void setResultSetQuery(const QXmppResultSetQuery &rsm);
211
213 static constexpr std::tuple PayloadXmlTag = { u"retrieve", QXmpp::Private::ns_archive };
214 [[deprecated("Use QXmpp::isIqElement()")]]
215 static bool isArchiveRetrieveIq(const QDomElement &element);
216
217protected:
218 void parseElementFromChild(const QDomElement &element) override;
219 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
221
222private:
223 QString m_with;
224 QDateTime m_start;
225 QXmppResultSetQuery m_rsmQuery;
226};
227
233 class QXMPP_EXPORT QXmppArchivePrefIq : public QXmppIq
234{
235public:
237 static constexpr std::tuple PayloadXmlTag = { u"pref", QXmpp::Private::ns_archive };
238 [[deprecated("Use QXmpp::isIqElement()")]]
239 static bool isArchivePrefIq(const QDomElement &element);
240
241protected:
242 void parseElementFromChild(const QDomElement &element) override;
243 void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
245};
246
247#endif // QXMPPARCHIVEIQ_H
QXmppArchiveChat
The QXmppArchiveChat class represents an archived conversation as defined by XEP-0136: Message Archiv...
Definition QXmppArchiveIq.h:42
QXmppArchiveChat::setVersion
void setVersion(int version)
Sets the conversation's version.
Definition QXmppArchiveIq.cpp:170
QXmppArchiveChat::version
int version() const
Returns the conversation's version.
Definition QXmppArchiveIq.cpp:164
QXmppArchiveChat::subject
QString subject() const
Returns the conversation's subject.
Definition QXmppArchiveIq.cpp:140
QXmppArchiveChat::thread
QString thread() const
Returns the conversation's thread.
Definition QXmppArchiveIq.cpp:152
QXmppArchiveChat::setThread
void setThread(const QString &thread)
Sets the conversation's thread.
Definition QXmppArchiveIq.cpp:158
QXmppArchiveChat::setStart
void setStart(const QDateTime &start)
Sets the start of this conversation.
Definition QXmppArchiveIq.cpp:134
QXmppArchiveChat::messages
QList< QXmppArchiveMessage > messages() const
Returns the conversation's messages.
Definition QXmppArchiveIq.cpp:116
QXmppArchiveChat::start
QDateTime start() const
Returns the start of this conversation.
Definition QXmppArchiveIq.cpp:128
QXmppArchiveChat::setWith
void setWith(const QString &with)
Sets the JID of the remote party.
Definition QXmppArchiveIq.cpp:182
QXmppArchiveChat::with
QString with() const
Returns the JID of the remote party.
Definition QXmppArchiveIq.cpp:176
QXmppArchiveChat::setSubject
void setSubject(const QString &subject)
Sets the conversation's subject.
Definition QXmppArchiveIq.cpp:146
QXmppArchiveChat::setMessages
void setMessages(const QList< QXmppArchiveMessage > &messages)
Sets the conversation's messages.
Definition QXmppArchiveIq.cpp:122
QXmppArchiveChatIq
Represents an archive chat as defined by XEP-0136: Message Archiving.
Definition QXmppArchiveIq.h:88
QXmppArchiveChatIq::resultSetReply
QXmppResultSetReply resultSetReply() const
Definition QXmppArchiveIq.cpp:204
QXmppArchiveChatIq::setResultSetReply
void setResultSetReply(const QXmppResultSetReply &rsm)
Definition QXmppArchiveIq.cpp:214
QXmppArchiveChatIq::chat
QXmppArchiveChat chat() const
Returns the chat conversation carried by this IQ.
Definition QXmppArchiveIq.cpp:188
QXmppArchiveChatIq::setChat
void setChat(const QXmppArchiveChat &chat)
Sets the chat conversation carried by this IQ.
Definition QXmppArchiveIq.cpp:194
QXmppArchiveListIq::end
QDateTime end() const
Returns the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:276
QXmppArchiveListIq::setResultSetReply
void setResultSetReply(const QXmppResultSetReply &rsm)
Definition QXmppArchiveIq.cpp:322
QXmppArchiveListIq::start
QDateTime start() const
Returns the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:264
QXmppArchiveListIq::resultSetQuery
QXmppResultSetQuery resultSetQuery() const
Definition QXmppArchiveIq.cpp:292
QXmppArchiveListIq::chats
QList< QXmppArchiveChat > chats() const
Returns the list of chat conversations.
Definition QXmppArchiveIq.cpp:240
QXmppArchiveListIq::setStart
void setStart(const QDateTime &start)
Sets the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:270
QXmppArchiveListIq::resultSetReply
QXmppResultSetReply resultSetReply() const
Definition QXmppArchiveIq.cpp:312
QXmppArchiveListIq::setResultSetQuery
void setResultSetQuery(const QXmppResultSetQuery &rsm)
Definition QXmppArchiveIq.cpp:302
QXmppArchiveListIq::QXmppArchiveListIq
QXmppArchiveListIq()
Constructs a QXmppArchiveListIq.
Definition QXmppArchiveIq.cpp:234
QXmppArchiveListIq::with
QString with() const
Returns the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:252
QXmppArchiveListIq::setChats
void setChats(const QList< QXmppArchiveChat > &chats)
Sets the list of chat conversations.
Definition QXmppArchiveIq.cpp:246
QXmppArchiveListIq::setEnd
void setEnd(const QDateTime &end)
Sets the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:282
QXmppArchiveListIq::setWith
void setWith(const QString &with)
Sets the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:258
QXmppArchiveMessage::isReceived
bool isReceived() const
Returns true if the archived message was received, false if it was sent.
Definition QXmppArchiveIq.cpp:48
QXmppArchiveMessage::setBody
void setBody(const QString &body)
Sets the archived message's body.
Definition QXmppArchiveIq.cpp:30
QXmppArchiveMessage::body
QString body() const
Returns the archived message's body.
Definition QXmppArchiveIq.cpp:24
QXmppArchiveMessage::setDate
void setDate(const QDateTime &date)
Sets the archived message's date.
Definition QXmppArchiveIq.cpp:42
QXmppArchiveMessage::setReceived
void setReceived(bool isReceived)
Set to true if the archived message was received, false if it was sent.
Definition QXmppArchiveIq.cpp:54
QXmppArchiveMessage::date
QDateTime date() const
Returns the archived message's date.
Definition QXmppArchiveIq.cpp:36
QXmppArchivePrefIq
Represents an archive preference IQ as defined by XEP-0136: Message Archiving.
Definition QXmppArchiveIq.h:234
QXmppArchiveRemoveIq
Represents an archive remove IQ as defined by XEP-0136: Message Archiving.
Definition QXmppArchiveIq.h:166
QXmppArchiveRemoveIq::with
QString with() const
Returns the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:367
QXmppArchiveRemoveIq::start
QDateTime start() const
Returns the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:379
QXmppArchiveRemoveIq::setEnd
void setEnd(const QDateTime &end)
Sets the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:397
QXmppArchiveRemoveIq::end
QDateTime end() const
Returns the end date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:391
QXmppArchiveRemoveIq::setWith
void setWith(const QString &with)
Sets the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:373
QXmppArchiveRemoveIq::setStart
void setStart(const QDateTime &start)
Sets the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:385
QXmppArchiveRetrieveIq::setWith
void setWith(const QString &with)
Sets the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:446
QXmppArchiveRetrieveIq::with
QString with() const
Returns the JID which archived conversations must match.
Definition QXmppArchiveIq.cpp:440
QXmppArchiveRetrieveIq::start
QDateTime start() const
Returns the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:428
QXmppArchiveRetrieveIq::setStart
void setStart(const QDateTime &start)
Sets the start date/time for the archived conversations.
Definition QXmppArchiveIq.cpp:434
QXmppArchiveRetrieveIq::resultSetQuery
QXmppResultSetQuery resultSetQuery() const
Definition QXmppArchiveIq.cpp:456
QXmppArchiveRetrieveIq::setResultSetQuery
void setResultSetQuery(const QXmppResultSetQuery &rsm)
Definition QXmppArchiveIq.cpp:466
QXmppIq::QXmppIq
QXmppIq(QXmppIq::Type type=QXmppIq::Get)
Definition QXmppIq.cpp:39
QXmppResultSetQuery
The QXmppResultSetQuery class represents a set element in a query as defined by XEP-0059: Result Set ...
Definition QXmppResultSet.h:18
QXmppResultSetReply
The QXmppResultSetReply class represents a set element in a reply as defined by XEP-0059: Result Set ...
Definition QXmppResultSet.h:53