kreverseresolver.h
/* -*- C++ -*-
* Copyright (C) 2003 Thiago Macieira <thiago.macieira@kdemail.net>
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef KREVERSERESOLVER_H
#define KREVERSERESOLVER_H
// Needed includes
#include <qobject.h>
#include <qstring.h>
#include "ksocketaddress.h"
namespace KNetwork {
class KReverseResolverPrivate;
class KDECORE_EXPORT KReverseResolver: public QObject
{
Q_OBJECT
public:
enum Flags
{
NumericHost = 0x01,
NumericService = 0x02,
NodeNameOnly = 0x04,
Datagram = 0x08,
NumericScope = 0x10,
ResolutionRequired = 0x20
};
KReverseResolver(const KSocketAddress& addr, int flags = 0,
QObject * = 0L, const char * = 0L);
virtual ~KReverseResolver();
bool isRunning() const;
bool success() const;
bool failure() const;
QString node() const;
QString service() const;
const KSocketAddress& address() const;
bool start();
virtual bool event(QEvent* );
signals:
void finished(const KReverseResolver& obj);
public:
static bool resolve(const KSocketAddress& addr, QString& node,
QString& serv, int flags = 0);
static bool resolve(const struct sockaddr* sa, Q_UINT16 salen,
QString& node, QString& serv, int flags = 0);
private:
KReverseResolverPrivate* d;
};
} // namespace KNetwork
#endif
KNetwork::KSocketAddress
A generic socket address.
Definition: ksocketaddress.h:423
KNetwork::KReverseResolver
Run a reverse-resolution on a socket address.
Definition: kreverseresolver.h:50
KNetwork::KReverseResolver::Flags
Flags
Flags for the reverse resolution.
Definition: kreverseresolver.h:74

KDE Home | KDE Accessibility Home | Description of Access Keys