KDNSSD

mdnsd-sdevent.h
1 /*
2  This file is part of the KDE project
3 
4  SPDX-FileCopyrightText: 2004 Jakub Stachowski <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef MDNSD_SDEVENT_H
10 #define MDNSD_SDEVENT_H
11 
12 #include <QEvent>
13 #include <QString>
14 #include <QMap>
15 
16 namespace KDNSSD
17 {
18 
19 enum Operation { SD_ERROR = 101, SD_ADDREMOVE, SD_PUBLISH, SD_RESOLVE};
20 
21 class ErrorEvent : public QEvent
22 {
23 public:
24  ErrorEvent() : QEvent((QEvent::Type)(QEvent::User + SD_ERROR))
25  {}
26 };
27 class AddRemoveEvent : public QEvent
28 {
29 public:
30  enum Operation { Add, Remove };
31  AddRemoveEvent(Operation op, const QString &name, const QString &type,
32  const QString &domain, bool last) : QEvent((QEvent::Type)(QEvent::User + SD_ADDREMOVE)),
33  m_op(op), m_name(name), m_type(type), m_domain(domain), m_last(last)
34  {}
35 
36  const Operation m_op;
37  const QString m_name;
38  const QString m_type;
39  const QString m_domain;
40  const bool m_last;
41 };
42 
43 class PublishEvent : public QEvent
44 {
45 public:
46  PublishEvent(const QString &name) : QEvent((QEvent::Type)(QEvent::User + SD_PUBLISH)), m_name(name)
47  {}
48 
49  const QString m_name;
50 };
51 
52 class ResolveEvent : public QEvent
53 {
54 public:
55  ResolveEvent(const QString &hostname, unsigned short port,
56  const QMap<QString, QByteArray> &txtdata)
57  : QEvent((QEvent::Type)(QEvent::User + SD_RESOLVE)), m_hostname(hostname),
58  m_port(port), m_txtdata(txtdata)
59  {}
60 
61  const QString m_hostname;
62  const unsigned short m_port;
63  const QMap<QString, QByteArray> m_txtdata;
64 };
65 
66 }
67 
68 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:40:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.