QXmpp
Version:0.9.3
|
00001 /* 00002 * Copyright (C) 2008-2014 The QXmpp developers 00003 * 00004 * Author: 00005 * Jeremy Lainé 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 #ifndef QXMPPDISCOVERY_H 00025 #define QXMPPDISCOVERY_H 00026 00027 #include "QXmppDataForm.h" 00028 #include "QXmppIq.h" 00029 00030 class QXMPP_EXPORT QXmppDiscoveryIq : public QXmppIq 00031 { 00032 public: 00033 class QXMPP_EXPORT Identity 00034 { 00035 public: 00036 QString category() const; 00037 void setCategory(const QString &category); 00038 00039 QString language() const; 00040 void setLanguage(const QString &language); 00041 00042 QString name() const; 00043 void setName(const QString &name); 00044 00045 QString type() const; 00046 void setType(const QString &type); 00047 00048 private: 00049 QString m_category; 00050 QString m_language; 00051 QString m_name; 00052 QString m_type; 00053 }; 00054 00055 class QXMPP_EXPORT Item 00056 { 00057 public: 00058 QString jid() const; 00059 void setJid(const QString &jid); 00060 00061 QString name() const; 00062 void setName(const QString &name); 00063 00064 QString node() const; 00065 void setNode(const QString &node); 00066 00067 private: 00068 QString m_jid; 00069 QString m_name; 00070 QString m_node; 00071 }; 00072 00073 enum QueryType { 00074 InfoQuery, 00075 ItemsQuery 00076 }; 00077 00078 QStringList features() const; 00079 void setFeatures(const QStringList &features); 00080 00081 QList<QXmppDiscoveryIq::Identity> identities() const; 00082 void setIdentities(const QList<QXmppDiscoveryIq::Identity> &identities); 00083 00084 QList<QXmppDiscoveryIq::Item> items() const; 00085 void setItems(const QList<QXmppDiscoveryIq::Item> &items); 00086 00087 QXmppDataForm form() const; 00088 void setForm(const QXmppDataForm &form); 00089 00090 QString queryNode() const; 00091 void setQueryNode(const QString &node); 00092 00093 enum QueryType queryType() const; 00094 void setQueryType(enum QueryType type); 00095 00096 QByteArray verificationString() const; 00097 00098 static bool isDiscoveryIq(const QDomElement &element); 00099 00100 protected: 00102 void parseElementFromChild(const QDomElement &element); 00103 void toXmlElementFromChild(QXmlStreamWriter *writer) const; 00105 00106 private: 00107 QStringList m_features; 00108 QList<QXmppDiscoveryIq::Identity> m_identities; 00109 QList<QXmppDiscoveryIq::Item> m_items; 00110 QXmppDataForm m_form; 00111 QString m_queryNode; 00112 enum QueryType m_queryType; 00113 }; 00114 00115 #endif