1 /* This file is part of the KDE project
3 * Copyright (C) 2004 Jakub Stachowski <qbast@go2.pl>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef MDNSD_SDEVENT_H
22 #define MDNSD_SDEVENT_H
24 #include <QtCore/QEvent>
25 #include <QtCore/QString>
26 #include <QtCore/QMap>
31 enum Operation
{ SD_ERROR
= 101,SD_ADDREMOVE
, SD_PUBLISH
, SD_RESOLVE
};
33 class ErrorEvent
: public QEvent
36 ErrorEvent() : QEvent((QEvent::Type
)(QEvent::User
+SD_ERROR
))
39 class AddRemoveEvent
: public QEvent
42 enum Operation
{ Add
, Remove
};
43 AddRemoveEvent(Operation op
,const QString
& name
,const QString
& type
,
44 const QString
& domain
, bool last
) : QEvent((QEvent::Type
)(QEvent::User
+SD_ADDREMOVE
)),
45 m_op(op
), m_name(name
), m_type(type
), m_domain(domain
), m_last(last
)
51 const QString m_domain
;
55 class PublishEvent
: public QEvent
58 PublishEvent(const QString
& name
) : QEvent((QEvent::Type
)(QEvent::User
+SD_PUBLISH
)), m_name(name
)
64 class ResolveEvent
: public QEvent
67 ResolveEvent(const QString
& hostname
, unsigned short port
,
68 const QMap
<QString
,QByteArray
>& txtdata
)
69 : QEvent((QEvent::Type
)(QEvent::User
+SD_RESOLVE
)), m_hostname(hostname
),
70 m_port(port
), m_txtdata(txtdata
)
73 const QString m_hostname
;
74 const unsigned short m_port
;
75 const QMap
<QString
,QByteArray
> m_txtdata
;