00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QXMPPMESSAGE_H
00026 #define QXMPPMESSAGE_H
00027
00028 #include <QDateTime>
00029 #include "QXmppStanza.h"
00030
00035
00036 class QXmppMessage : public QXmppStanza
00037 {
00038 public:
00040 enum Type
00041 {
00042 Error = 0,
00043 Normal,
00044 Chat,
00045 GroupChat,
00046 Headline
00047 };
00048
00051 enum State
00052 {
00053 None = 0,
00054 Active,
00055 Inactive,
00056 Gone,
00057 Composing,
00058 Paused,
00059 };
00060
00061 QXmppMessage(const QString& from = "", const QString& to = "",
00062 const QString& body = "", const QString& thread = "");
00063 ~QXmppMessage();
00064
00065 QString body() const;
00066 void setBody(const QString&);
00067
00068 QDateTime stamp() const;
00069 void setStamp(const QDateTime &stamp);
00070
00071 QXmppMessage::State state() const;
00072 void setState(QXmppMessage::State);
00073
00074 QString subject() const;
00075 void setSubject(const QString&);
00076
00077 QString thread() const;
00078 void setThread(const QString&);
00079
00080 QXmppMessage::Type type() const;
00081 void setType(QXmppMessage::Type);
00082
00084 void parse(const QDomElement &element);
00085 void toXml(QXmlStreamWriter *writer) const;
00086
00087
00088
00089 QXmppMessage::Type Q_DECL_DEPRECATED getType() const;
00090 QXmppMessage::State Q_DECL_DEPRECATED getState() const;
00091 QString Q_DECL_DEPRECATED getBody() const;
00092 QString Q_DECL_DEPRECATED getSubject() const;
00093 QString Q_DECL_DEPRECATED getThread() const;
00095
00096 private:
00098 enum StampType
00099 {
00100 LegacyDelayedDelivery,
00101 DelayedDelivery,
00102 };
00103
00104 QString getTypeStr() const;
00105 void setTypeFromStr(const QString&);
00106
00107 Type m_type;
00108 QDateTime m_stamp;
00109 StampType m_stampType;
00110 State m_state;
00111
00112 QString m_body;
00113 QString m_subject;
00114 QString m_thread;
00115 };
00116
00117 #endif // QXMPPMESSAGE_H