2002-09-24 13:57:09 +00:00
|
|
|
// -*- C++ -*-
|
2002-07-14 02:04:19 +00:00
|
|
|
/**
|
|
|
|
* \file io_callback.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-07-14 02:04:19 +00:00
|
|
|
*
|
|
|
|
* \author unknown
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-07-14 02:04:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IO_CALLBACK_H
|
|
|
|
#define IO_CALLBACK_H
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
2002-07-14 02:04:19 +00:00
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
#include <qobject.h>
|
|
|
|
#include <qsocketnotifier.h>
|
2002-07-31 04:33:03 +00:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
|
|
class LyXComm;
|
|
|
|
|
2002-07-30 00:53:57 +00:00
|
|
|
/**
|
|
|
|
* io_callback - a simple wrapper for asynchronous pipe notification
|
|
|
|
*
|
|
|
|
* This is used by the lyxserver to notice the pipe is ready to be
|
|
|
|
* read.
|
|
|
|
*
|
|
|
|
* FIXME: this code apparently will not work on Windows.
|
|
|
|
*/
|
2002-07-14 02:04:19 +00:00
|
|
|
class io_callback : public QObject {
|
2002-09-24 13:57:09 +00:00
|
|
|
Q_OBJECT
|
2002-07-14 02:04:19 +00:00
|
|
|
public:
|
2002-07-30 00:53:57 +00:00
|
|
|
/// connect a read ready notification for fd to the LyXComm
|
2002-09-24 13:57:09 +00:00
|
|
|
io_callback(int fd, LyXComm * comm);
|
2002-07-14 02:04:19 +00:00
|
|
|
public slots:
|
2002-09-24 13:57:09 +00:00
|
|
|
void data_received();
|
2002-07-14 02:04:19 +00:00
|
|
|
private:
|
2002-07-31 04:33:03 +00:00
|
|
|
/// our notifier
|
|
|
|
boost::scoped_ptr<QSocketNotifier> sn_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-14 02:04:19 +00:00
|
|
|
LyXComm * comm_;
|
|
|
|
};
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
#endif // IO_CALLBACK_H
|