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