QtZeroConf
 All Classes Functions Variables Pages
zconfservice.h
1 /*
2  * This file is part of qtzeroconf. (c) 2012 Johannes Hilden
3  * https://github.com/johanneshilden/qtzeroconf
4  *
5  * qtzeroconf is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as
7  * published by the Free Software Foundation; either version 2.1 of the
8  * License, or (at your option) any later version.
9  *
10  * qtzeroconf is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13  * Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with qtzeroconf; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18  */
19 
20 #ifndef ZCONFSERVICE_H
21 #define ZCONFSERVICE_H
22 
23 #include <QObject>
24 #include <arpa/inet.h>
25 
26 class ZConfServicePrivate;
27 class ZConfService : public QObject
28 {
29  Q_OBJECT
30 
31 public:
32  explicit ZConfService(QObject *parent = 0);
33  ~ZConfService();
34 
35  bool isValid() const;
36  QString errorString() const;
37 
38 signals:
39  void entryGroupEstablished();
40  void entryGroupNameCollision();
41  void entryGroupFailure();
42 
43 public slots:
44  void registerService(QString name, in_port_t port, QString type = "_http._tcp");
45  void resetService();
46 
47 protected:
48  ZConfServicePrivate *const d_ptr;
49 
50 private:
51  Q_DECLARE_PRIVATE(ZConfService);
52 };
53 
54 #endif // ZCONFSERVICE_H