QXmpp: QXmppMessage.h Source File

QXmpp Version:0.7.5

- Main Page
- Modules
- Classes
- Files

- File List

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,
56 Active,
57 Inactive,
58 Gone,
59 Composing,
60 Paused,
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 mucInvitationJid() const;
80 void setMucInvitationJid(const QString &jid);
81
82 QString mucInvitationPassword() const;
83 void setMucInvitationPassword(const QString &password);
84
85 QString mucInvitationReason() const;
86 void setMucInvitationReason(const QString &reason);
87
88 QString receiptId() const;
89 void setReceiptId(const QString &id);
90
91 QDateTime stamp() const;
92 void setStamp(const QDateTime &stamp);
93
94 QXmppMessage::State state() const;
95 void setState(QXmppMessage::State);
96
97 QString subject() const;
98 void setSubject(const QString&);
99
100 QString thread() const;
101 void setThread(const QString&);
102
103 QXmppMessage::Type type() const;
104 void setType(QXmppMessage::Type);
105
106 QString xhtml() const;
107 void setXhtml(const QString &xhtml);
108
110 void parse(const QDomElement &element);
111 void toXml(QXmlStreamWriter *writer) const;
113
114 private:
115 QSharedDataPointer<QXmppMessagePrivate> d;
116 };
117
118 #endif // QXMPPMESSAGE_H