QXmpp Version:0.3.0
QXmppArchiveIq.h
00001 /*
00002  * Copyright (C) 2008-2011 The QXmpp developers
00003  *
00004  * Author:
00005  *  Jeremy Lainé
00006  *
00007  * Source:
00008  *  http://code.google.com/p/qxmpp
00009  *
00010  * This file is a part of QXmpp library.
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  */
00023 
00024 #ifndef QXMPPARCHIVEIQ_H
00025 #define QXMPPARCHIVEIQ_H
00026 
00027 #include "QXmppIq.h"
00028 
00029 #include <QDateTime>
00030 
00031 class QXmlStreamWriter;
00032 class QDomElement;
00033 
00036 
00037 class QXmppArchiveMessage
00038 {
00039 public:
00040     QXmppArchiveMessage();
00041 
00042     QString body() const;
00043     void setBody(const QString &body);
00044 
00045     QDateTime date() const;
00046     void setDate(const QDateTime &date);
00047 
00048     bool isReceived() const;
00049     void setReceived(bool isReceived);
00050 
00051 private:
00052     QString m_body;
00053     QDateTime m_date;
00054     bool m_received;
00055 };
00056 
00059 
00060 class QXmppArchiveChat
00061 {
00062 public:
00063     QXmppArchiveChat();
00064 
00065     QList<QXmppArchiveMessage> messages() const;
00066     void setMessages(const QList<QXmppArchiveMessage> &messages);
00067 
00068     QDateTime start() const;
00069     void setStart(const QDateTime &start);
00070 
00071     QString subject() const;
00072     void setSubject(const QString &subject);
00073 
00074     QString thread() const;
00075     void setThread(const QString &thread);
00076 
00077     int version() const;
00078     void setVersion(int version);
00079 
00080     QString with() const;
00081     void setWith(const QString &with);
00082 
00084     void parse(const QDomElement &element);
00085     void toXml(QXmlStreamWriter *writer) const;
00087 
00088 private:
00089     QList<QXmppArchiveMessage> m_messages;
00090     QDateTime m_start;
00091     QString m_subject;
00092     QString m_thread;
00093     int m_version;
00094     QString m_with;
00095 };
00096 
00102 
00103 class QXmppArchiveChatIq : public QXmppIq
00104 {
00105 public:
00106     QXmppArchiveChat chat() const;
00107     void setChat(const QXmppArchiveChat &chat);
00108 
00110     static bool isArchiveChatIq(const QDomElement &element);
00112 
00113 protected:
00115     void parseElementFromChild(const QDomElement &element);
00116     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
00118 
00119 private:
00120     QXmppArchiveChat m_chat;
00121 };
00122 
00126 
00127 class QXmppArchiveListIq : public QXmppIq
00128 {
00129 public:
00130     QXmppArchiveListIq();
00131 
00132     QList<QXmppArchiveChat> chats() const;
00133     void setChats(const QList<QXmppArchiveChat> &chats);
00134 
00135     int max() const;
00136     void setMax(int max);
00137 
00138     QString with() const;
00139     void setWith( const QString &with );
00140 
00141     QDateTime start() const;
00142     void setStart(const QDateTime &start );
00143 
00144     QDateTime end() const;
00145     void setEnd(const QDateTime &end );
00146 
00148     static bool isArchiveListIq(const QDomElement &element);
00150 
00151 protected:
00153     void parseElementFromChild(const QDomElement &element);
00154     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
00156 
00157 private:
00158     int m_max;
00159     QString m_with;
00160     QDateTime m_start;
00161     QDateTime m_end;
00162     QList<QXmppArchiveChat> m_chats;
00163 };
00164 
00168 
00169 class QXmppArchiveRetrieveIq : public QXmppIq
00170 {
00171 public:
00172     QXmppArchiveRetrieveIq();
00173 
00174     int max() const;
00175     void setMax(int max);
00176 
00177     QDateTime start() const;
00178     void setStart(const QDateTime &start);
00179 
00180     QString with() const;
00181     void setWith(const QString &with);
00182 
00184     static bool isArchiveRetrieveIq(const QDomElement &element);
00186 
00187 protected:
00189     void parseElementFromChild(const QDomElement &element);
00190     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
00192 
00193 private:
00194     int m_max;
00195     QString m_with;
00196     QDateTime m_start;
00197 };
00198 
00202 
00203 class QXmppArchivePrefIq : public QXmppIq
00204 {
00205 public:
00207     static bool isArchivePrefIq(const QDomElement &element);
00209 
00210 protected:
00212     void parseElementFromChild(const QDomElement &element);
00213     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
00215 };
00216 
00217 #endif // QXMPPARCHIVEIQ_H
 All Classes Functions Enumerations Enumerator Properties