KDECore
k3reverseresolver.h
Go to the documentation of this file.
00001 /* -*- C++ -*- 00002 * Copyright (C) 2003,2005 Thiago Macieira <thiago@kde.org> 00003 * 00004 * 00005 * Permission is hereby granted, free of charge, to any person obtaining 00006 * a copy of this software and associated documentation files (the 00007 * "Software"), to deal in the Software without restriction, including 00008 * without limitation the rights to use, copy, modify, merge, publish, 00009 * distribute, sublicense, and/or sell copies of the Software, and to 00010 * permit persons to whom the Software is furnished to do so, subject to 00011 * the following conditions: 00012 * 00013 * The above copyright notice and this permission notice shall be included 00014 * in all copies or substantial portions of the Software. 00015 * 00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00017 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00019 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 00020 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 00021 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00022 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 */ 00024 00025 #ifndef KREVERSERESOLVER_H 00026 #define KREVERSERESOLVER_H 00027 00029 // Needed includes 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 } // namespace KNetwork 00196 00197 #endif
KDE 4.6 API Reference