responder.h

00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2004 Jakub Stachowski <qbast@go2.pl>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef DNSSDRESPONDER_H
00022 #define DNSSDRESPONDER_H
00023 
00024 #include <qobject.h>
00025 #include <qsocketnotifier.h>
00026 #include <qsignal.h>
00027 #include <config.h>
00028 #include <avahi-client/client.h>
00029 namespace DNSSD
00030 {
00031 
00038 class Responder : public QObject
00039 {
00040     Q_OBJECT
00041 
00042 public:
00043     Responder();
00044 
00045     ~Responder();
00046 
00047     static Responder& self();
00048     AvahiClientState state() const;
00049     AvahiClient* client() const { return m_client; }
00050     void process();
00051 signals:
00052     void stateChanged(AvahiClientState);
00053 private:
00054     AvahiClient* m_client;
00055     static Responder* m_self;
00056     friend void client_callback(AvahiClient*, AvahiClientState, void*);
00057 
00058 };
00059 
00060 /* Utils functions */
00061 
00062 bool domainIsLocal(const QString& domain);
00063 // Encodes domain name using utf8() or IDN 
00064 QCString domainToDNS(const QString &domain);
00065 QString DNSToDomain(const char* domain);
00066 
00067 
00068 }
00069 
00070 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys