aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppArchiveIq.h
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-02-03 16:13:38 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-02-03 16:13:38 +0000
commit468450f99b8549beb9bc1f68e50acbef728e6ad0 (patch)
treec17e569b73a8abab90d222125b99d48911555d4d /source/QXmppArchiveIq.h
parent3f55d48265edd996ed8d4d52300f299a8715b3a1 (diff)
downloadqxmpp-468450f99b8549beb9bc1f68e50acbef728e6ad0.tar.gz
add initial XEP-0136 IQs and manager
Diffstat (limited to 'source/QXmppArchiveIq.h')
-rw-r--r--source/QXmppArchiveIq.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/source/QXmppArchiveIq.h b/source/QXmppArchiveIq.h
new file mode 100644
index 00000000..fabdebc7
--- /dev/null
+++ b/source/QXmppArchiveIq.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2010 Bolloré telecom
+ *
+ * Author:
+ * Jeremy Lainé
+ *
+ * Source:
+ * http://code.google.com/p/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#ifndef QXMPPARCHIVEIQ_H
+#define QXMPPARCHIVEIQ_H
+
+#include "QXmppIq.h"
+
+#include <QDateTime>
+
+class QXmlStreamWriter;
+class QDomElement;
+
+class QXmppArchiveMessage
+{
+public:
+ QDateTime datetime;
+ bool local;
+ QString body;
+};
+
+class QXmppArchiveChat
+{
+public:
+ QString with;
+ QDateTime start;
+
+ QString subject;
+ QList<QXmppArchiveMessage> messages;
+ int version;
+};
+
+class QXmppArchiveChatIq : public QXmppIq
+{
+public:
+ void parse( QDomElement &element );
+ static bool isArchiveChatIq( QDomElement &element );
+
+ QXmppArchiveChat getChat() const;
+
+private:
+ QXmppArchiveChat m_chat;
+};
+
+class QXmppArchiveListIq : public QXmppIq
+{
+public:
+ QXmppArchiveListIq();
+ void toXmlElementFromChild(QXmlStreamWriter *writer) const;
+ void parse( QDomElement &element );
+ static bool isArchiveListIq( QDomElement &element );
+
+ QList<QXmppArchiveChat> getChats() const;
+
+ int getMax() const;
+ void setMax(int max);
+
+ QString getWith() const;
+ void setWith( const QString &with );
+
+ QDateTime getStart() const;
+ void setStart(const QDateTime &start );
+
+ QDateTime getEnd() const;
+ void setEnd(const QDateTime &end );
+
+private:
+ int m_max;
+ QString m_with;
+ QDateTime m_start;
+ QDateTime m_end;
+ QList<QXmppArchiveChat> m_chats;
+};
+
+class QXmppArchiveRetrieveIq : public QXmppIq
+{
+public:
+ QXmppArchiveRetrieveIq();
+ void toXmlElementFromChild(QXmlStreamWriter *writer) const;
+
+ int getMax() const;
+ void setMax(int max);
+
+ QDateTime getStart() const;
+ void setStart( const QDateTime &start );
+
+ QString getWith() const;
+ void setWith( const QString &with );
+
+private:
+ int m_max;
+ QString m_with;
+ QDateTime m_start;
+};
+
+class QXmppArchivePrefIq : public QXmppIq
+{
+public:
+ void toXmlElementFromChild(QXmlStreamWriter *writer) const;
+ void parse( QDomElement &element );
+ static bool isArchivePrefIq( QDomElement &element );
+};
+
+#endif // QXMPPARCHIVEIQ_H