KDNSSD

mdnsd-sdevent.h
1/*
2 This file is part of the KDE project
3
4 SPDX-FileCopyrightText: 2004 Jakub Stachowski <qbast@go2.pl>
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 <QMap>
14#include <QString>
15
16namespace KDNSSD
17{
18enum Operation { SD_ERROR = 101, SD_ADDREMOVE, SD_PUBLISH, SD_RESOLVE };
19
20class ErrorEvent : public QEvent
21{
22public:
23 ErrorEvent()
24 : QEvent((QEvent::Type)(QEvent::User + SD_ERROR))
25 {
26 }
27};
28class AddRemoveEvent : public QEvent
29{
30public:
31 enum Operation { Add, Remove };
32 AddRemoveEvent(Operation op, const QString &name, const QString &type, const QString &domain, bool last)
33 : QEvent((QEvent::Type)(QEvent::User + SD_ADDREMOVE))
34 , m_op(op)
35 , m_name(name)
36 , m_type(type)
37 , m_domain(domain)
38 , m_last(last)
39 {
40 }
41
42 const Operation m_op;
43 const QString m_name;
44 const QString m_type;
45 const QString m_domain;
46 const bool m_last;
47};
48
49class PublishEvent : public QEvent
50{
51public:
52 PublishEvent(const QString &name)
53 : QEvent((QEvent::Type)(QEvent::User + SD_PUBLISH))
54 , m_name(name)
55 {
56 }
57
58 const QString m_name;
59};
60
61class ResolveEvent : public QEvent
62{
63public:
64 ResolveEvent(const QString &hostname, unsigned short port, const QMap<QString, QByteArray> &txtdata)
65 : QEvent((QEvent::Type)(QEvent::User + SD_RESOLVE))
66 , m_hostname(hostname)
67 , m_port(port)
68 , m_txtdata(txtdata)
69 {
70 }
71
72 const QString m_hostname;
73 const unsigned short m_port;
74 const QMap<QString, QByteArray> m_txtdata;
75};
76
77}
78
79#endif
QString name(StandardAction id)
NETWORKMANAGERQT_EXPORT QString hostname()
Type type() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.