QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppArchiveIq.h
1 /*
2  * Copyright (C) 2008-2011 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
6  *
7  * Source:
8  * http://code.google.com/p/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPARCHIVEIQ_H
25 #define QXMPPARCHIVEIQ_H
26 
27 #include "QXmppIq.h"
28 
29 #include <QDateTime>
30 
31 class QXmlStreamWriter;
32 class QDomElement;
33 
36 
37 class QXMPP_EXPORT QXmppArchiveMessage
38 {
39 public:
41 
42  QString body() const;
43  void setBody(const QString &body);
44 
45  QDateTime date() const;
46  void setDate(const QDateTime &date);
47 
48  bool isReceived() const;
49  void setReceived(bool isReceived);
50 
51 private:
52  QString m_body;
53  QDateTime m_date;
54  bool m_received;
55 };
56 
59 
60 class QXMPP_EXPORT QXmppArchiveChat
61 {
62 public:
64 
65  QList<QXmppArchiveMessage> messages() const;
66  void setMessages(const QList<QXmppArchiveMessage> &messages);
67 
68  QDateTime start() const;
69  void setStart(const QDateTime &start);
70 
71  QString subject() const;
72  void setSubject(const QString &subject);
73 
74  QString thread() const;
75  void setThread(const QString &thread);
76 
77  int version() const;
78  void setVersion(int version);
79 
80  QString with() const;
81  void setWith(const QString &with);
82 
84  void parse(const QDomElement &element);
85  void toXml(QXmlStreamWriter *writer) const;
87 
88 private:
89  QList<QXmppArchiveMessage> m_messages;
90  QDateTime m_start;
91  QString m_subject;
92  QString m_thread;
93  int m_version;
94  QString m_with;
95 };
96 
102 
103 class QXMPP_EXPORT QXmppArchiveChatIq : public QXmppIq
104 {
105 public:
106  QXmppArchiveChat chat() const;
107  void setChat(const QXmppArchiveChat &chat);
108 
110  static bool isArchiveChatIq(const QDomElement &element);
112 
113 protected:
115  void parseElementFromChild(const QDomElement &element);
116  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
118 
119 private:
120  QXmppArchiveChat m_chat;
121 };
122 
126 
127 class QXMPP_EXPORT QXmppArchiveListIq : public QXmppIq
128 {
129 public:
131 
132  QList<QXmppArchiveChat> chats() const;
133  void setChats(const QList<QXmppArchiveChat> &chats);
134 
135  int max() const;
136  void setMax(int max);
137 
138  QString with() const;
139  void setWith( const QString &with );
140 
141  QDateTime start() const;
142  void setStart(const QDateTime &start );
143 
144  QDateTime end() const;
145  void setEnd(const QDateTime &end );
146 
148  static bool isArchiveListIq(const QDomElement &element);
150 
151 protected:
153  void parseElementFromChild(const QDomElement &element);
154  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
156 
157 private:
158  int m_max;
159  QString m_with;
160  QDateTime m_start;
161  QDateTime m_end;
162  QList<QXmppArchiveChat> m_chats;
163 };
164 
168 
169 class QXMPP_EXPORT QXmppArchiveRemoveIq : public QXmppIq
170 {
171 public:
172  QString with() const;
173  void setWith( const QString &with );
174 
175  QDateTime start() const;
176  void setStart(const QDateTime &start );
177 
178  QDateTime end() const;
179  void setEnd(const QDateTime &end );
180 
182  static bool isArchiveRemoveIq(const QDomElement &element);
184 
185 protected:
187  void parseElementFromChild(const QDomElement &element);
188  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
190 
191 private:
192  QString m_with;
193  QDateTime m_start;
194  QDateTime m_end;
195 };
196 
200 
201 class QXMPP_EXPORT QXmppArchiveRetrieveIq : public QXmppIq
202 {
203 public:
205 
206  int max() const;
207  void setMax(int max);
208 
209  QDateTime start() const;
210  void setStart(const QDateTime &start);
211 
212  QString with() const;
213  void setWith(const QString &with);
214 
216  static bool isArchiveRetrieveIq(const QDomElement &element);
218 
219 protected:
221  void parseElementFromChild(const QDomElement &element);
222  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
224 
225 private:
226  int m_max;
227  QString m_with;
228  QDateTime m_start;
229 };
230 
234 
235 class QXMPP_EXPORT QXmppArchivePrefIq : public QXmppIq
236 {
237 public:
239  static bool isArchivePrefIq(const QDomElement &element);
241 
242 protected:
244  void parseElementFromChild(const QDomElement &element);
245  void toXmlElementFromChild(QXmlStreamWriter *writer) const;
247 };
248 
249 #endif // QXMPPARCHIVEIQ_H