/usr/include/jreen-qt5/jreen/disco.h is in libjreen-qt5-dev 1.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | /****************************************************************************
**
** Jreen
**
** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
**
*****************************************************************************
**
** $JREEN_BEGIN_LICENSE$
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 2 of the License, or
** (at your option) any later version.
**
** This program 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see http://www.gnu.org/licenses/.
** $JREEN_END_LICENSE$
**
****************************************************************************/
#ifndef JREEN_DISCO_H
#define JREEN_DISCO_H
#include <QObject>
#include <QString>
#include <QSet>
#include "dataform.h"
#include "jid.h"
#include "stanzaextension.h"
#include "iq.h"
namespace Jreen
{
class IQ;
class IQReply;
class Client;
class DiscoPrivate;
class DiscoReply;
class DiscoReplyPrivate;
class JREEN_EXPORT Disco : public QObject
{
Q_DISABLE_COPY(Disco)
Q_OBJECT
Q_DECLARE_PRIVATE(Disco)
public:
class IdentityData;
class JREEN_EXPORT Identity
{
public:
Identity();
Identity(const QString &category, const QString &type, const QString &name, const QString &lang = QString());
Identity(const Identity &item);
Identity &operator =(const Identity &item);
~Identity();
QString category() const;
QString type() const;
QString name() const;
QString lang() const;
private:
QSharedDataPointer<IdentityData> d;
};
typedef QList<Identity> IdentityList;
class InfoPrivate;
class JREEN_EXPORT Info : public Payload
{
Q_DECLARE_PRIVATE(Info)
J_PAYLOAD(Jreen::Disco::Info)
public:
Info(const QString &node = QString(), const IdentityList &identities = IdentityList(),
const QSet<QString> &features = QSet<QString>(),
QSharedPointer<DataForm> form = QSharedPointer<DataForm>());
~Info();
QString node() const;
IdentityList identities() const;
QSet<QString> features() const;
DataForm::Ptr form() const;
private:
QScopedPointer<InfoPrivate> d_ptr;
};
class ItemData;
class JREEN_EXPORT Item
{
public:
enum Action
{
ActionExecute = 0x01,
ActionRegister = 0x02,
ActionJoin = 0x04,
ActionSearch = 0x08,
ActionAdd = 0x10,
ActionVCard = 0x20,
ActionProxy = 0x40,
ActionExpand = 0x80
};
typedef QFlags<Action> Actions;
Item();
Item(const JID &jid, const QString &node, const QString &name);
Item(const Item &item);
Item &operator =(const Item &item);
~Item();
JID jid() const;
void setJid(const JID &jid);
QString node() const;
void setNode(const QString &node);
QString name() const;
void setName(const QString &name);
IdentityList identities() const;
bool hasIdentity(const QString &category, const QString &type = QString()) const;
void addIdentity(const Identity &identity);
void setIdentities(const IdentityList &identities);
QSet<QString> features() const;
void setFeatures(const QSet<QString> &features);
DataForm::Ptr form() const;
void setForm(const DataForm::Ptr &form);
Actions actions() const;
private:
QSharedDataPointer<ItemData> d;
};
typedef QList<Item> ItemList;
class ItemsPrivate;
class JREEN_EXPORT Items : public Payload
{
Q_DECLARE_PRIVATE(Items)
J_PAYLOAD(Jreen::Disco::Items)
public:
Items(const QString &node = QString(), const ItemList &items = ItemList());
~Items();
QString node() const;
ItemList items() const;
private:
QScopedPointer<ItemsPrivate> d_ptr;
};
Disco(Client *client);
virtual ~Disco();
DiscoReply *requestInfo(const Item &item);
DiscoReply *requestItems(const Item &item);
void addIdentity(const Identity &identity);
void addIdentity(const QString &category, const QString &type, const QString &name, const QString &lang = QString());
const IdentityList &identities() const;
IdentityList &identities();
const QSet<QString> &features() const;
QSet<QString> &features();
void addFeature(const QString &feature);
void setSoftwareVersion(const QString &name, const QString &version, const QString &os = QString());
void setSoftwareVersion(const QString &name, const QString &version, const QString &os, const QString &osVersion);
const DataForm *form() const;
void setForm(DataForm *form);
protected:
Q_PRIVATE_SLOT(d_func(), void _q_received(const Jreen::IQ &))
QScopedPointer<DiscoPrivate> d_ptr;
};
class JREEN_EXPORT DiscoReply : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(DiscoReply)
public:
virtual ~DiscoReply();
Disco::Item item() const;
Disco::ItemList subitems() const;
QString errorText() const;
Jreen::Error::Ptr error() const;
signals:
void finished();
void error(const Jreen::Error::Ptr &error);
void infoReceived(const Jreen::Disco::Item &item);
void itemsReceived(const Jreen::Disco::ItemList &items);
private:
DiscoReply(const Disco::Item &item, Jreen::IQReply *reply);
Q_PRIVATE_SLOT(d_func(), void _q_received(const Jreen::IQ &))
friend class Disco;
QScopedPointer<DiscoReplyPrivate> d_ptr;
};
}
Q_DECLARE_METATYPE(Jreen::Disco::Identity)
Q_DECLARE_METATYPE(Jreen::Disco::IdentityList)
Q_DECLARE_METATYPE(Jreen::Disco::Item)
Q_DECLARE_METATYPE(Jreen::Disco::ItemList)
Q_DECLARE_OPERATORS_FOR_FLAGS(Jreen::Disco::Item::Actions)
#endif // JREEN_DISCO_H
|