]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/socket_callback.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / socket_callback.C
1 /**
2  * \file io_callback.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author unknown
7  * \author John Levon
8  * \author João Luis M. Assirati
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #include <config.h>
14
15
16 #include "lyxsocket.h"
17 #include "socket_callback.h"
18
19
20 socket_callback::socket_callback(LyXServerSocket * server)
21         : server_(server)
22 {
23         sn_.reset(new QSocketNotifier(server->fd(), QSocketNotifier::Read, this));
24         connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(server_received()));
25 }
26
27 socket_callback::socket_callback(LyXDataSocket * data)
28         : data_(data)
29 {
30         sn_.reset(new QSocketNotifier(data->fd(), QSocketNotifier::Read, this));
31         connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received()));
32 }
33
34
35 void socket_callback::server_received()
36 {
37         server_->serverCallback();
38 }
39
40 void socket_callback::data_received()
41 {
42         data_->server()->dataCallback(data_);
43 }