Loading...
Searching...
No Matches
QXmppArchiveIq.h
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPARCHIVEIQ_H
#define QXMPPARCHIVEIQ_H
#include "QXmppIq.h"
#include "QXmppResultSet.h"
#include <QDateTime>
class QXMPP_EXPORT QXmppArchiveMessage
{
public:
QXmppArchiveMessage();
QString body() const;
void setBody(const QString &body);
QDateTime date() const;
void setDate(const QDateTime &date);
bool isReceived() const;
void setReceived(bool isReceived);
private:
QString m_body;
QDateTime m_date;
bool m_received;
};
class QXMPP_EXPORT QXmppArchiveChat
{
public:
QXmppArchiveChat();
QList<QXmppArchiveMessage> messages() const;
void setMessages(const QList<QXmppArchiveMessage> &messages);
QDateTime start() const;
void setStart(const QDateTime &start);
QString subject() const;
void setSubject(const QString &subject);
QString thread() const;
void setThread(const QString &thread);
int version() const;
void setVersion(int version);
QString with() const;
void setWith(const QString &with);
static constexpr std::tuple XmlTag = { u"chat", QXmpp::Private::ns_archive };
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const { toXml(writer, {}); }
void toXml(QXmlStreamWriter *writer, const QXmppResultSetReply &rsm) const;
private:
QList<QXmppArchiveMessage> m_messages;
QDateTime m_start;
QString m_subject;
QString m_thread;
int m_version;
QString m_with;
};
class QXMPP_EXPORT QXmppArchiveChatIq : public QXmppIq
{
public:
QXmppArchiveChat chat() const;
void setChat(const QXmppArchiveChat &chat);
QXmppResultSetReply resultSetReply() const;
void setResultSetReply(const QXmppResultSetReply &rsm);
static constexpr std::tuple PayloadXmlTag = { u"chat", QXmpp::Private::ns_archive };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isArchiveChatIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QXmppArchiveChat m_chat;
QXmppResultSetReply m_rsmReply;
};
class QXMPP_EXPORT QXmppArchiveListIq : public QXmppIq
{
public:
QXmppArchiveListIq();
QList<QXmppArchiveChat> chats() const;
void setChats(const QList<QXmppArchiveChat> &chats);
QString with() const;
void setWith(const QString &with);
QDateTime start() const;
void setStart(const QDateTime &start);
QDateTime end() const;
void setEnd(const QDateTime &end);
QXmppResultSetQuery resultSetQuery() const;
void setResultSetQuery(const QXmppResultSetQuery &rsm);
QXmppResultSetReply resultSetReply() const;
void setResultSetReply(const QXmppResultSetReply &rsm);
static constexpr std::tuple PayloadXmlTag = { u"list", QXmpp::Private::ns_archive };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isArchiveListIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QString m_with;
QDateTime m_start;
QDateTime m_end;
QList<QXmppArchiveChat> m_chats;
QXmppResultSetQuery m_rsmQuery;
QXmppResultSetReply m_rsmReply;
};
class QXMPP_EXPORT QXmppArchiveRemoveIq : public QXmppIq
{
public:
QString with() const;
void setWith(const QString &with);
QDateTime start() const;
void setStart(const QDateTime &start);
QDateTime end() const;
void setEnd(const QDateTime &end);
static constexpr std::tuple PayloadXmlTag = { u"remove", QXmpp::Private::ns_archive };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isArchiveRemoveIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QString m_with;
QDateTime m_start;
QDateTime m_end;
};
class QXMPP_EXPORT QXmppArchiveRetrieveIq : public QXmppIq
{
public:
QXmppArchiveRetrieveIq();
QDateTime start() const;
void setStart(const QDateTime &start);
QString with() const;
void setWith(const QString &with);
QXmppResultSetQuery resultSetQuery() const;
void setResultSetQuery(const QXmppResultSetQuery &rsm);
static constexpr std::tuple PayloadXmlTag = { u"retrieve", QXmpp::Private::ns_archive };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isArchiveRetrieveIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
private:
QString m_with;
QDateTime m_start;
QXmppResultSetQuery m_rsmQuery;
};
class QXMPP_EXPORT QXmppArchivePrefIq : public QXmppIq
{
public:
static constexpr std::tuple PayloadXmlTag = { u"pref", QXmpp::Private::ns_archive };
[[deprecated("Use QXmpp::isIqElement()")]]
static bool isArchivePrefIq(const QDomElement &element);
protected:
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
};
#endif // QXMPPARCHIVEIQ_H
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
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
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