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 QXMPPSRVINFO_H 00025 #define QXMPPSRVINFO_H 00026 00027 #include <QList> 00028 #include <QString> 00029 00030 class QObject; 00031 class QXmppSrvInfoPrivate; 00032 class QXmppSrvRecordPrivate; 00033 00036 00037 class QXmppSrvRecord 00038 { 00039 public: 00040 QXmppSrvRecord(); 00041 QXmppSrvRecord(const QXmppSrvRecord &other); 00042 ~QXmppSrvRecord(); 00043 00044 QString target() const; 00045 void setTarget(const QString &target); 00046 00047 quint16 port() const; 00048 void setPort(quint16 port); 00049 00050 quint16 priority() const; 00051 void setPriority(quint16 priority); 00052 00053 quint16 weight() const; 00054 void setWeight(quint16 weight); 00055 00056 QXmppSrvRecord &operator=(const QXmppSrvRecord &other); 00057 00058 private: 00059 QXmppSrvRecordPrivate *d; 00060 }; 00061 00064 00065 class QXmppSrvInfo 00066 { 00067 public: 00069 enum Error 00070 { 00071 NoError = 0, 00072 NotFoundError = 1, 00073 UnknownError = 2, 00074 }; 00075 00076 QXmppSrvInfo(); 00077 QXmppSrvInfo(const QXmppSrvInfo &other); 00078 ~QXmppSrvInfo(); 00079 00080 Error error() const; 00081 QString errorString() const; 00082 QList<QXmppSrvRecord> records() const; 00083 00084 static QXmppSrvInfo fromName(const QString &dname); 00085 static void lookupService(const QString &name, QObject *receiver, const char *member); 00086 00087 private: 00088 QXmppSrvInfoPrivate *d; 00089 }; 00090 00091 #endif