]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/socket_callback.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / 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 #include <boost/function.hpp>
22
23
24 /**
25  * socket_callback - a simple wrapper for asynchronous socket notification
26  *
27  * This is used by the lyxsocket to notice the socket is ready to be
28  * connected/read.
29  *
30  * FIXME: this code apparently will not work on Windows.
31  */
32 class socket_callback : public QObject {
33         Q_OBJECT
34 public:
35         /// connect a connection notification from the LyXServerSocket
36         socket_callback(int fd, boost::function<void()> func);
37 public Q_SLOTS:
38         void data_received();
39 private:
40         /// our notifier
41         boost::scoped_ptr<QSocketNotifier> sn_;
42         /// The callback function
43         boost::function<void()> func_;
44 };
45
46 #endif // SOCKET_CALLBACK_H