KDECore
k3reverseresolver.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KREVERSERESOLVER_H
00026 #define KREVERSERESOLVER_H
00027
00029
00030 #include <QtCore/QObject>
00031 #include <QtCore/QString>
00032
00033 #include "k3socketaddress.h"
00034
00035 namespace KNetwork {
00036
00037 class KReverseResolverPrivate;
00051 class KDECORE_EXPORT KReverseResolver: public QObject
00052 {
00053 Q_OBJECT
00054
00055 public:
00075 enum Flags
00076 {
00077 NumericHost = 0x01,
00078 NumericService = 0x02,
00079 NodeNameOnly = 0x04,
00080 Datagram = 0x08,
00081 NumericScope = 0x10,
00082 ResolutionRequired = 0x20
00083 };
00084
00092 explicit KReverseResolver(const KSocketAddress& addr, int flags = 0,
00093 QObject *parent = 0L);
00094
00098 virtual ~KReverseResolver();
00099
00103 bool isRunning() const;
00104
00109 bool success() const;
00110
00115 bool failure() const;
00116
00121 QString node() const;
00122
00127 QString service() const;
00128
00132 const KSocketAddress& address() const;
00133
00138 bool start();
00139
00143 virtual bool event(QEvent* );
00144
00145 Q_SIGNALS:
00151 void finished(const KNetwork::KReverseResolver& obj);
00152
00153 public:
00169 static bool resolve(const KSocketAddress& addr, QString& node,
00170 QString& serv, int flags = 0);
00171
00188 static bool resolve(const struct sockaddr* sa, quint16 salen,
00189 QString& node, QString& serv, int flags = 0);
00190
00191 private:
00192 KReverseResolverPrivate* const d;
00193 };
00194
00195 }
00196
00197 #endif