diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-02-11 07:51:06 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-02-11 07:51:06 +0000 |
| commit | e386059f004474d4ffa32a9573a3f36dbec4439b (patch) | |
| tree | 1d734bbbf62ac4182e20a036fa43eaf0b7b7cebb /source/QXmppDiscoveryIq.h | |
| parent | c8ce37573791629d5d475e00d81c371d44d4311d (diff) | |
| download | qxmpp-e386059f004474d4ffa32a9573a3f36dbec4439b.tar.gz | |
add support for XEP-0030 : Service Discovery
Diffstat (limited to 'source/QXmppDiscoveryIq.h')
| -rw-r--r-- | source/QXmppDiscoveryIq.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/source/QXmppDiscoveryIq.h b/source/QXmppDiscoveryIq.h new file mode 100644 index 00000000..31c97630 --- /dev/null +++ b/source/QXmppDiscoveryIq.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2010 Bolloré telecom + * + * Author: + * Jeremy Lainé + * + * Source: + * http://code.google.com/p/qxmpp + * + * This file is a part of QXmpp library. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + */ + +#ifndef QXMPPDISCOVERY_H +#define QXMPPDISCOVERY_H + +#include "QXmppIq.h" + +#include <QMap> +#include <QStringList> + +class QDomElement; + +class QXmppDiscoveryItem +{ +public: + QStringList attributes() const; + + QString attribute(const QString &name) const; + void setAttribute(const QString &name, const QString &value); + + QString type() const; + void setType(const QString &type); + +private: + QMap<QString, QString> m_attributes; + QString m_type; +}; + +class QXmppDiscoveryIq : public QXmppIq +{ +public: + enum QueryType { + InfoQuery, + ItemsQuery, + }; + + void toXmlElementFromChild(QXmlStreamWriter *writer) const; + void parse( QDomElement &element ); + static bool isDiscoveryIq( QDomElement &element ); + + QList<QXmppDiscoveryItem> getItems() const; + void setItems(const QList<QXmppDiscoveryItem> &items); + + enum QueryType getQueryType() const; + void setQueryType(enum QueryType type); + +private: + QList<QXmppDiscoveryItem> m_items; + enum QueryType m_queryType; +}; + +#endif |
