]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/socket_callback.h
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / socket_callback.h
1 // -*- C++ -*-
2 /**
3  * \file io_callback.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  * \author João Luis M. Assirati
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef SOCKET_CALLBACK_H
15 #define SOCKET_CALLBACK_H
16
17
18 #include <qobject.h>
19 #include <qsocketnotifier.h>
20 #include <boost/scoped_ptr.hpp>
21
22 class LyXServerSocket;
23 class LyXDataSocket;
24
25 /**
26  * socket_callback - a simple wrapper for asynchronous socket notification
27  *
28  * This is used by the lyxsocket to notice the socket is ready to be
29  * connected/read.
30  *
31  * FIXME: this code apparently will not work on Windows.
32  */
33 class socket_callback : public QObject {
34         Q_OBJECT
35 public:
36         /// connect a connection notification from the LyXServerSocket
37         socket_callback(LyXServerSocket * server);
38         socket_callback(LyXDataSocket * data);
39 public slots:
40         void server_received();
41         void data_received();
42 private:
43         /// our notifier
44         boost::scoped_ptr<QSocketNotifier> sn_;
45
46         LyXServerSocket * server_;
47         LyXDataSocket * data_;
48 };
49
50 #endif // SOCKET_CALLBACK_H