00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef DNSSDSERVICEBROWSER_H
00022
#define DNSSDSERVICEBROWSER_H
00023
00024
#include <qobject.h>
00025
#include <qdict.h>
00026
#include <dnssd/remoteservice.h>
00027
00028
00029
class QStringList;
00030
namespace DNSSD
00031 {
00032
class DomainBrowser;
00033
class ServiceBrowserPrivate;
00034
00054 class KDNSSD_EXPORT ServiceBrowser :
public QObject
00055 {
00056 Q_OBJECT
00057
public:
00064 enum State { Working, Stopped, Unsupported };
00065
00079 ServiceBrowser(
const QString& type,
DomainBrowser* domains=0,
bool autoResolve=
false);
00080
00087 ServiceBrowser(
const QString& type,
const QString& domain,
bool autoResolve=
false);
00088
00089 ~ServiceBrowser();
00090
00094
const QValueList<RemoteService::Ptr>& services() const;
00095
00100 virtual
void startBrowse();
00101
00107 const
DomainBrowser* browsedDomains() const;
00108
00113 static const
QString AllServices;
00114
00143 static const State isAvailable();
00144
00145 signals:
00150
void serviceAdded(DNSSD::
RemoteService::Ptr);
00156
void serviceRemoved(DNSSD::
RemoteService::Ptr);
00157
00167
void finished();
00168
00169 public slots:
00173
void removeDomain(const
QString& domain);
00174
00178
void addDomain(const
QString& domain);
00179
00180 protected:
00181 virtual
void virtual_hook(
int,
void*);
00182 private:
00183 ServiceBrowserPrivate *d;
00184
00185
bool allFinished();
00186
QValueList<
RemoteService::Ptr>::Iterator findDuplicate(
RemoteService::Ptr src);
00187 private slots:
00188
void serviceResolved(
bool success);
00189
void gotNewService(DNSSD::
RemoteService::Ptr);
00190
void gotRemoveService(DNSSD::
RemoteService::Ptr);
00191
void queryFinished();
00192
void init(const
QString&,
DomainBrowser*,
bool);
00193
00194 };
00195
00196 }
00197
00198 #endif