QXmpp  Version:0.7.3
 All Classes Functions Variables Enumerations Enumerator Properties Groups
QXmppMessage.h
1 /*
2  * Copyright (C) 2008-2012 The QXmpp developers
3  *
4  * Author:
5  * Manjeet Dahiya
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 
25 #ifndef QXMPPMESSAGE_H
26 #define QXMPPMESSAGE_H
27 
28 #include <QDateTime>
29 #include "QXmppStanza.h"
30 
31 class QXmppMessagePrivate;
32 
37 
38 class QXMPP_EXPORT QXmppMessage : public QXmppStanza
39 {
40 public:
42  enum Type
43  {
44  Error = 0,
45  Normal,
46  Chat,
47  GroupChat,
48  Headline
49  };
50 
53  enum State
54  {
55  None = 0,
58  Gone,
61  };
62 
63  QXmppMessage(const QString& from = "", const QString& to = "",
64  const QString& body = "", const QString& thread = "");
65  QXmppMessage(const QXmppMessage &other);
66  ~QXmppMessage();
67 
68  QXmppMessage& operator=(const QXmppMessage &other);
69 
70  QString body() const;
71  void setBody(const QString&);
72 
73  bool isAttentionRequested() const;
74  void setAttentionRequested(bool requested);
75 
76  bool isReceiptRequested() const;
77  void setReceiptRequested(bool requested);
78 
79  QString receiptId() const;
80  void setReceiptId(const QString &id);
81 
82  QDateTime stamp() const;
83  void setStamp(const QDateTime &stamp);
84 
85  QXmppMessage::State state() const;
86  void setState(QXmppMessage::State);
87 
88  QString subject() const;
89  void setSubject(const QString&);
90 
91  QString thread() const;
92  void setThread(const QString&);
93 
94  QXmppMessage::Type type() const;
95  void setType(QXmppMessage::Type);
96 
97  QString xhtml() const;
98  void setXhtml(const QString &xhtml);
99 
101  void parse(const QDomElement &element);
102  void toXml(QXmlStreamWriter *writer) const;
104 
105 private:
106  QSharedDataPointer<QXmppMessagePrivate> d;
107 };
108 
109 #endif // QXMPPMESSAGE_H