KDNSSD

dummy-publicservice.cpp
1 /*
2  This file is part of the KDE project
3 
4  SPDX-FileCopyrightText: 2004, 2005 Jakub Stachowski <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "publicservice.h"
10 #include "servicebase_p.h"
11 #include <QStringList>
12 
13 namespace KDNSSD
14 {
15 
16 PublicService::PublicService(const QString &name, const QString &type, unsigned int port,
17  const QString &domain, const QStringList &)
18  : QObject(), ServiceBase(name, type, QString(), domain, port)
19 {
20  if (domain.isNull()) {
21  d->m_domain = QLatin1String("local.");
22  }
23 }
24 
25 PublicService::~PublicService()
26 {}
27 
28 void PublicService::setServiceName(const QString &serviceName)
29 {
30  d->m_serviceName = serviceName;
31 }
32 
33 void PublicService::setDomain(const QString &domain)
34 {
35  d->m_domain = domain;
36 }
37 
39 {
40  d->m_textData = textData;
41 }
42 
43 void PublicService::setType(const QString &type)
44 {
45  d->m_type = type;
46 }
47 
49 {
50  // dummy and empty
51 }
52 
53 void PublicService::setPort(unsigned short port)
54 {
55  d->m_port = port;
56 }
57 
59 {
60  return QStringList();
61 }
62 
63 bool PublicService::isPublished() const
64 {
65  return false;
66 }
67 
69 {
70  return false;
71 }
72 
74 {}
75 
77 {
78  emit published(false);
79 }
80 
81 void PublicService::virtual_hook(int, void *)
82 {
83 }
84 
85 }
86 
87 #include "moc_publicservice.cpp"
void setPort(unsigned short port)
Sets the port.
void setTextData(const QMap< QString, QByteArray > &textData)
Sets new text properties.
void setType(const QString &type)
Sets the service type.
bool isNull() const const
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.
bool publish()
Publish the service synchronously.
void publishAsync()
Publish the service asynchronously.
void setSubTypes(const QStringList &subtypes)
Sets the subtypetypes of the service.
void setServiceName(const QString &serviceName)
Sets the name of the service.
void stop()
Stops publishing or aborts an incomplete publish request.
QStringList subtypes() const
The subtypes of service.
void setDomain(const QString &domain)
Sets the domain where the service is published.
bool isPublished() const
Whether the service is currently published.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 4 2020 22:39:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.