servicebrowser.h
/* This file is part of the KDE project
*
* Copyright (C) 2004 Jakub Stachowski <qbast@go2.pl>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef DNSSDSERVICEBROWSER_H
#define DNSSDSERVICEBROWSER_H
#include <qobject.h>
#include <qdict.h>
#include <dnssd/remoteservice.h>
class QStringList;
namespace DNSSD
{
class DomainBrowser;
class ServiceBrowserPrivate;
class KDNSSD_EXPORT ServiceBrowser : public QObject
{
Q_OBJECT
public:
enum Flags {
AutoDelete =1,
AutoResolve = 2
};
enum State { Working, Stopped, Unsupported };
ServiceBrowser(const QStringList& types,DomainBrowser* domains,int flags);
ServiceBrowser(const QString& type,DomainBrowser* domains=0,bool autoResolve=false);
ServiceBrowser(const QString& type,const QString& domain, int flags);
ServiceBrowser(const QString& type,const QString& domain, bool autoResolve=false);
~ServiceBrowser();
const QValueList<RemoteService::Ptr>& services() const;
virtual void startBrowse();
const DomainBrowser* browsedDomains() const;
static const QString AllServices;
static const State isAvailable();
signals:
void serviceAdded(DNSSD::RemoteService::Ptr);
void serviceRemoved(DNSSD::RemoteService::Ptr);
void finished();
public slots:
void removeDomain(const QString& domain);
void addDomain(const QString& domain);
protected:
virtual void virtual_hook(int, void*);
private:
ServiceBrowserPrivate *d;
bool allFinished();
void init(const QStringList&, DomainBrowser*, int);
QValueList<RemoteService::Ptr>::Iterator findDuplicate(RemoteService::Ptr src);
private slots:
void serviceResolved(bool success);
void gotNewService(DNSSD::RemoteService::Ptr);
void gotRemoveService(DNSSD::RemoteService::Ptr);
void queryFinished();
};
}
#endif
DNSSD::ServiceBrowser
Most important class for applications that want to discover specific services on network.
Definition: servicebrowser.h:54
DNSSD::ServiceBrowser::AllServices
static const QString AllServices
Special service type to search for all available service types.
Definition: servicebrowser.h:142
DNSSD::DomainBrowser
Class used to provide current list of domains for browsing.
Definition: domainbrowser.h:41
DNSSD::ServiceBrowser::State
State
Availability of DNS-SD services.
Definition: servicebrowser.h:75
DNSSD::ServiceBrowser::Flags
Flags
Definition: servicebrowser.h:64

KDE Home | KDE Accessibility Home | Description of Access Keys