Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /* This file is part of the KDE project |
---|---|
2 | * |
3 | * Copyright (C) 2004 Jakub Stachowski <qbast@go2.pl> |
4 | * |
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. |
9 | * |
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. |
14 | * |
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. |
19 | */ |
20 | |
21 | #ifndef MDNSD_SDEVENT_H |
22 | #define MDNSD_SDEVENT_H |
23 | |
24 | #include <QtCore/QEvent> |
25 | #include <QtCore/QString> |
26 | #include <QtCore/QMap> |
27 | |
28 | namespace DNSSD |
29 | { |
30 | |
31 | enum Operation { SD_ERROR = 101,SD_ADDREMOVE, SD_PUBLISH, SD_RESOLVE}; |
32 | |
33 | class ErrorEvent : public QEvent |
34 | { |
35 | public: |
36 | ErrorEvent() : QEvent((QEvent::Type)(QEvent::User+SD_ERROR)) |
37 | {} |
38 | }; |
39 | class AddRemoveEvent : public QEvent |
40 | { |
41 | public: |
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) |
46 | {} |
47 | |
48 | const Operation m_op; |
49 | const QString m_name; |
50 | const QString m_type; |
51 | const QString m_domain; |
52 | const bool m_last; |
53 | }; |
54 | |
55 | class PublishEvent : public QEvent |
56 | { |
57 | public: |
58 | PublishEvent(const QString& name) : QEvent((QEvent::Type)(QEvent::User+SD_PUBLISH)), m_name(name) |
59 | {} |
60 | |
61 | const QString m_name; |
62 | }; |
63 | |
64 | class ResolveEvent : public QEvent |
65 | { |
66 | public: |
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) |
71 | {} |
72 | |
73 | const QString m_hostname; |
74 | const unsigned short m_port; |
75 | const QMap<QString,QByteArray> m_txtdata; |
76 | }; |
77 | |
78 | |
79 | } |
80 | |
81 | #endif |
82 |
Warning: That file was not part of the compilation database. It may have many parsing errors.