KDNSSD 5.109.0
publicservice.h
1/*
2 This file is part of the KDE project
3
4 SPDX-FileCopyrightText: 2004, 2005 Jakub Stachowski <qbast@go2.pl>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KDNSSDPUBLICSERVICE_H
10#define KDNSSDPUBLICSERVICE_H
11
12#include "servicebase.h"
13#include <QObject>
14#include <QStringList>
15
16namespace KDNSSD
17{
18class PublicServicePrivate;
19
47class KDNSSD_EXPORT PublicService : public QObject, public ServiceBase
48{
49 Q_OBJECT
50
51public:
79 explicit PublicService(const QString &name = QString(),
80 const QString &type = QString(),
81 unsigned int port = 0,
82 const QString &domain = QString(),
83 const QStringList &subtypes = QStringList());
84
85 ~PublicService() override;
86
95 void stop();
96
108 bool publish();
109
116 bool isPublished() const;
117
126
137 void setTextData(const QMap<QString, QByteArray> &textData);
138
147 void setServiceName(const QString &serviceName);
148
159 void setType(const QString &type);
160
172 void setSubTypes(const QStringList &subtypes);
173
182 void setPort(unsigned short port);
183
195 void setDomain(const QString &domain);
196
202 QStringList subtypes() const;
203
204Q_SIGNALS:
212 void published(bool successful);
213
214protected:
215 void virtual_hook(int, void *) override;
216
217private:
218 friend class PublicServicePrivate;
219};
220
221}
222
223#endif
Represents a service to be published.
Definition publicservice.h:48
void stop()
Stops publishing or aborts an incomplete publish request.
bool publish()
Publish the service synchronously.
void setServiceName(const QString &serviceName)
Sets the name of the service.
void setDomain(const QString &domain)
Sets the domain where the service is published.
void setSubTypes(const QStringList &subtypes)
Sets the subtypetypes of the service.
PublicService(const QString &name=QString(), const QString &type=QString(), unsigned int port=0, const QString &domain=QString(), const QStringList &subtypes=QStringList())
Creates a service description that can be published.
void setPort(unsigned short port)
Sets the port.
void setType(const QString &type)
Sets the service type.
void published(bool successful)
Emitted when publishing is complete.
bool isPublished() const
Whether the service is currently published.
void setTextData(const QMap< QString, QByteArray > &textData)
Sets new text properties.
void publishAsync()
Publish the service asynchronously.
QStringList subtypes() const
The subtypes of service.
Describes a service.
Definition servicebase.h:41