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 QXmppArchiveRemoveIq : public QXmppIq
    00170 {
    00171 public:
    00172     QString with() const;
    00173     void setWith( const QString &with );
    00174
    00175     QDateTime start() const;
    00176     void setStart(const QDateTime &start );
    00177
    00178     QDateTime end() const;
    00179     void setEnd(const QDateTime &end );
    00180
    00182     static bool isArchiveRemoveIq(const QDomElement &element);
    00184
    00185 protected:
    00187     void parseElementFromChild(const QDomElement &element);
    00188     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
    00190
    00191 private:
    00192     QString m_with;
    00193     QDateTime m_start;
    00194     QDateTime m_end;
    00195 };
    00196
    00200
    00201 class QXmppArchiveRetrieveIq : public QXmppIq
    00202 {
    00203 public:
    00204     QXmppArchiveRetrieveIq();
    00205
    00206     int max() const;
    00207     void setMax(int max);
    00208
    00209     QDateTime start() const;
    00210     void setStart(const QDateTime &start);
    00211
    00212     QString with() const;
    00213     void setWith(const QString &with);
    00214
    00216     static bool isArchiveRetrieveIq(const QDomElement &element);
    00218
    00219 protected:
    00221     void parseElementFromChild(const QDomElement &element);
    00222     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
    00224
    00225 private:
    00226     int m_max;
    00227     QString m_with;
    00228     QDateTime m_start;
    00229 };
    00230
    00234
    00235 class QXmppArchivePrefIq : public QXmppIq
    00236 {
    00237 public:
    00239     static bool isArchivePrefIq(const QDomElement &element);
    00241
    00242 protected:
    00244     void parseElementFromChild(const QDomElement &element);
    00245     void toXmlElementFromChild(QXmlStreamWriter *writer) const;
    00247 };
    00248
    00249 #endif // QXMPPARCHIVEIQ_H

All Classes Functions Enumerations Enumerator Properties