QXmpp
Version:0.9.3
|
00001 /* 00002 * Copyright (C) 2008-2014 The QXmpp developers 00003 * 00004 * Author: 00005 * Manjeet Dahiya 00006 * 00007 * Source: 00008 * https://github.com/qxmpp-project/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 00025 #ifndef QXMPPMESSAGE_H 00026 #define QXMPPMESSAGE_H 00027 00028 #include <QDateTime> 00029 #include "QXmppStanza.h" 00030 00031 class QXmppMessagePrivate; 00032 00037 00038 class QXMPP_EXPORT QXmppMessage : public QXmppStanza 00039 { 00040 public: 00042 enum Type 00043 { 00044 Error = 0, 00045 Normal, 00046 Chat, 00047 GroupChat, 00048 Headline 00049 }; 00050 00053 enum State 00054 { 00055 None = 0, 00056 Active, 00057 Inactive, 00058 Gone, 00059 Composing, 00060 Paused 00061 }; 00062 00065 enum Marker { 00066 NoMarker = 0, 00067 Received, 00068 Displayed, 00069 Acknowledged 00070 }; 00071 00072 QXmppMessage(const QString& from = QString(), const QString& to = QString(), 00073 const QString& body = QString(), const QString& thread = QString()); 00074 00075 QXmppMessage(const QXmppMessage &other); 00076 ~QXmppMessage(); 00077 00078 QXmppMessage& operator=(const QXmppMessage &other); 00079 00080 QString body() const; 00081 void setBody(const QString&); 00082 00083 bool isAttentionRequested() const; 00084 void setAttentionRequested(bool requested); 00085 00086 bool isReceiptRequested() const; 00087 void setReceiptRequested(bool requested); 00088 00089 QString mucInvitationJid() const; 00090 void setMucInvitationJid(const QString &jid); 00091 00092 QString mucInvitationPassword() const; 00093 void setMucInvitationPassword(const QString &password); 00094 00095 QString mucInvitationReason() const; 00096 void setMucInvitationReason(const QString &reason); 00097 00098 QString receiptId() const; 00099 void setReceiptId(const QString &id); 00100 00101 QDateTime stamp() const; 00102 void setStamp(const QDateTime &stamp); 00103 00104 QXmppMessage::State state() const; 00105 void setState(QXmppMessage::State); 00106 00107 QString subject() const; 00108 void setSubject(const QString&); 00109 00110 QString thread() const; 00111 void setThread(const QString&); 00112 00113 QXmppMessage::Type type() const; 00114 void setType(QXmppMessage::Type); 00115 00116 QString xhtml() const; 00117 void setXhtml(const QString &xhtml); 00118 00119 // XEP-0333 00120 bool isMarkable() const; 00121 void setMarkable(const bool); 00122 00123 QString markedId() const; 00124 void setMarkerId(const QString&); 00125 00126 QString markedThread() const; 00127 void setMarkedThread(const QString&); 00128 00129 Marker marker() const; 00130 void setMarker(const Marker); 00131 00133 void parse(const QDomElement &element); 00134 void toXml(QXmlStreamWriter *writer) const; 00136 00137 private: 00138 QSharedDataPointer<QXmppMessagePrivate> d; 00139 }; 00140 00141 #endif // QXMPPMESSAGE_H