QtZeroConf
 All Classes Functions Variables Pages
zconfserviceclient.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 ZCONFSERVICECLIENT_H
21 #define ZCONFSERVICECLIENT_H
22 
23 #include <QObject>
24 #include <avahi-client/client.h>
25 
26 class ZConfServiceClient : public QObject
27 {
28  Q_OBJECT
29 
30 signals:
31  void clientRunning();
32  void clientFailure();
33  void clientConnecting();
34  void clientReset();
35 
36 private:
37  friend class ZConfService;
38  friend class ZConfServiceBrowser;
39  friend class ZConfServiceBrowserPrivate;
40 
41  ZConfServiceClient(QObject *parent = 0);
42  ~ZConfServiceClient();
43 
44  void run();
45  QString errorString() const;
46 
47  static void callback(AvahiClient *client, AvahiClientState state, void *userdata);
48 
49  const AvahiPoll *const poll;
50  AvahiClient *client;
51  int error;
52 };
53 
54 #endif // ZCONFSERVICECLIENT_H