00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef NETINTERFACE_H
00022 #define NETINTERFACE_H
00023
00024 #include "irisnetglobal.h"
00025
00026 namespace XMPP {
00027
00028 class NetInterfaceManager;
00029 class NetInterfacePrivate;
00030 class NetInterfaceManagerPrivate;
00031
00054 class IRISNET_EXPORT NetInterface : public QObject
00055 {
00056 Q_OBJECT
00057 public:
00065 NetInterface(const QString &id, NetInterfaceManager *manager);
00066
00070 ~NetInterface();
00071
00077 bool isValid() const;
00078
00084 QString id() const;
00085
00093 QString name() const;
00094
00100 QList<QHostAddress> addresses() const;
00101
00107 QHostAddress gateway() const;
00108
00109 signals:
00119 void unavailable();
00120
00121 private:
00122 friend class NetInterfacePrivate;
00123 NetInterfacePrivate *d;
00124
00125 friend class NetInterfaceManagerPrivate;
00126 };
00127
00153 class IRISNET_EXPORT NetInterfaceManager : public QObject
00154 {
00155 Q_OBJECT
00156 public:
00160 NetInterfaceManager(QObject *parent = 0);
00161
00165 ~NetInterfaceManager();
00166
00173 QStringList interfaces() const;
00174
00188 static QString interfaceForAddress(const QHostAddress &a);
00189
00190 signals:
00196 void interfaceAvailable(const QString &id);
00197
00198 private:
00199 friend class NetInterfaceManagerPrivate;
00200 NetInterfaceManagerPrivate *d;
00201
00202 friend class NetInterface;
00203 friend class NetInterfacePrivate;
00204
00205 void *reg(const QString &id, NetInterface *i);
00206 void unreg(NetInterface *i);
00207 };
00208
00209 }
00210
00211 #endif